public class CRDTReplicationMigrationService extends Object implements ManagedService, MembershipAwareService, GracefulShutdownAwareService
CRDTReplicationAwareService
.
The replication is performed periodically on an executor with the name "hz:CRDTReplicationMigration". You may configure this executor accordingly. The migration mechanism uses the same executor but it is performed only on membership changes and on CRDT state merge. The migration checks are triggered on CRDT state merge because CRDT states can get merged when a replica is shutting down and it is trying to replicate any previously unreplicated state to any member in the cluster, regardless of the configured replica count.
Modifier and Type | Field and Description |
---|---|
static String |
CRDT_REPLICATION_MIGRATION_EXECUTOR
The executor for the CRDT replication and migration tasks
|
static String |
SERVICE_NAME
The name of this service
|
Constructor and Description |
---|
CRDTReplicationMigrationService() |
Modifier and Type | Method and Description |
---|---|
void |
init(NodeEngine nodeEngine,
Properties properties)
Initializes this service.
|
void |
memberAdded(MembershipServiceEvent event)
Invoked when a new member is added to the cluster.
|
void |
memberAttributeChanged(MemberAttributeServiceEvent event)
Invoked when a member attribute is changed.
|
void |
memberRemoved(MembershipServiceEvent event)
Invoked when an existing member leaves the cluster.
|
boolean |
onShutdown(long timeout,
TimeUnit unit)
Attempts to replicate only the unreplicated CRDT state to any non-local
member in the cluster.
|
void |
reset()
Resets this service back to its initial state.
|
void |
shutdown(boolean terminate)
Shuts down this service.
|
String |
toString() |
public static final String SERVICE_NAME
public static final String CRDT_REPLICATION_MIGRATION_EXECUTOR
public void init(NodeEngine nodeEngine, Properties properties)
ManagedService
init
in interface ManagedService
nodeEngine
- the NodeEngine that this service belongs toproperties
- the Properties (can be used to pass settings to the service)public void reset()
ManagedService
TODO: what is the purpose of reset
reset
in interface ManagedService
public void shutdown(boolean terminate)
ManagedService
TODO: what is the purpose of the terminate variable
shutdown
in interface ManagedService
terminate
- true
to shut down this servicepublic boolean onShutdown(long timeout, TimeUnit unit)
onShutdown
in interface GracefulShutdownAwareService
timeout
- timeout for graceful shutdownunit
- time unitCRDTReplicationTask
public void memberAdded(MembershipServiceEvent event)
MembershipAwareService
memberAdded
in interface MembershipAwareService
event
- the event for a new member added to the clusterpublic void memberRemoved(MembershipServiceEvent event)
MembershipAwareService
memberRemoved
in interface MembershipAwareService
event
- the event for an existing member leaving the clusterpublic void memberAttributeChanged(MemberAttributeServiceEvent event)
MembershipAwareService
memberAttributeChanged
in interface MembershipAwareService
event
- the event for a member attribute being changedCopyright © 2021 Hazelcast, Inc.. All Rights Reserved.