public abstract class AbstractCPMigrationAwareService extends Object implements MigrationAwareService
| Modifier and Type | Field and Description |
|---|---|
protected NodeEngineImpl |
nodeEngine |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCPMigrationAwareService(NodeEngine nodeEngine) |
| Modifier and Type | Method and Description |
|---|---|
void |
beforeMigration(PartitionMigrationEvent event)
Called before migration process starts, on both source and destination members.
|
protected abstract void |
clearPartitionReplica(int partitionId) |
void |
commitMigration(PartitionMigrationEvent event)
Commits the migration process for this service, on both source and destination members.
|
protected abstract int |
getBackupCount() |
protected abstract Map<CPGroupId,Object> |
getSnapshotMap(int partitionId) |
Operation |
prepareReplicationOperation(PartitionReplicationEvent event)
Returns an operation to replicate service data and/or state for a specific partition replica
on another cluster member.
|
void |
rollbackMigration(PartitionMigrationEvent event)
Rollback the migration process for this service, on both source and destination members.
|
protected final NodeEngineImpl nodeEngine
protected AbstractCPMigrationAwareService(NodeEngine nodeEngine)
protected abstract int getBackupCount()
protected abstract void clearPartitionReplica(int partitionId)
public final Operation prepareReplicationOperation(PartitionReplicationEvent event)
MigrationAwareServiceThis method will be called on source member whenever partitioning system requires to copy/replicate a partition replica. Returned operation will be executed on destination member. If operation fails by throwing exception, migration process will fail and will be rolled back.
Returning null is allowed and means service does not have anything to replicate.
prepareReplicationOperation in interface MigrationAwareServiceevent - replicationpublic void beforeMigration(PartitionMigrationEvent event)
MigrationAwareServiceService can take actions required before migration. Migration process will block until this method returns. If this method fails by throwing an exception, migration process for specific partition will fail and will be rolled back.
beforeMigration in interface MigrationAwareServiceevent - migration eventpublic final void commitMigration(PartitionMigrationEvent event)
MigrationAwareServiceCommit is not expected to fail at this point, all exceptions will be suppressed and logged. Implementations of this method must be thread safe as this method may be called concurrently for different migrations on different partitions.
commitMigration in interface MigrationAwareServiceevent - migration eventpublic final void rollbackMigration(PartitionMigrationEvent event)
MigrationAwareServiceRollback is not expected to fail at this point, all exceptions will be suppressed and logged. Implementations of this method must be thread safe as this method may be called concurrently for different migrations on different partitions.
rollbackMigration in interface MigrationAwareServiceevent - migration eventCopyright © 2019 Hazelcast, Inc.. All rights reserved.