public static class MigrationServiceImpl.InvalidatorMigrator extends Object implements MigrationService.Migrator
migrator
wrapper to send invalidations to other nodes when calling
notifyStatusChange()
.Modifier and Type | Field and Description |
---|---|
protected String |
id |
protected MigrationServiceImpl.MigrationInvalidator |
invalidator |
protected MigrationService.Migrator |
migrator |
Constructor and Description |
---|
InvalidatorMigrator(String id,
MigrationService.Migrator migrator,
MigrationServiceImpl.MigrationInvalidator invalidator) |
Modifier and Type | Method and Description |
---|---|
void |
notifyStatusChange()
Allows notification of status change for a running step or new state.
|
String |
probeState()
Probes the current state of a migration by analyzing persistent data.
|
void |
run(String step,
MigrationService.MigrationContext migrationContext)
Runs a migration step.
|
protected final MigrationService.Migrator migrator
protected final MigrationServiceImpl.MigrationInvalidator invalidator
public InvalidatorMigrator(String id, MigrationService.Migrator migrator, MigrationServiceImpl.MigrationInvalidator invalidator)
public String probeState()
MigrationService.Migrator
Assumes no migration step is currently running.
THIS METHOD MAY TAKE A WHILE as it needs to get information from persistent storage.
probeState
in interface MigrationService.Migrator
null
if it cannot be determinedpublic void run(String step, MigrationService.MigrationContext migrationContext)
MigrationService.Migrator
This method should periodically check for MigrationService.MigrationContext.isShutdownRequested()
and
Thread.isInterrupted()
and return if true
.
run
in interface MigrationService.Migrator
step
- the migration step to runmigrationContext
- the migration context.public void notifyStatusChange()
MigrationService.Migrator
notifyStatusChange
in interface MigrationService.Migrator
Copyright © 2019 Nuxeo. All rights reserved.