public class RaftAtomicRefService extends Object implements RaftManagedService, RaftRemoteService, RaftNodeLifecycleAwareService, SnapshotAwareService<RaftAtomicRefSnapshot>
| Modifier and Type | Field and Description |
|---|---|
static String |
SERVICE_NAME
Name of the service
|
| Constructor and Description |
|---|
RaftAtomicRefService(NodeEngine nodeEngine) |
| Modifier and Type | Method and Description |
|---|---|
IAtomicReference |
createProxy(String proxyName)
Creates a proxy for a CP data structure.
|
boolean |
destroyRaftObject(CPGroupId groupId,
String name)
Destroys the given CP data structure on the CP group.
|
RaftAtomicRef |
getAtomicRef(CPGroupId groupId,
String name) |
void |
init(NodeEngine nodeEngine,
Properties properties)
Initializes this service.
|
void |
onCPSubsystemRestart()
Called when the CP subsystem is restarted.
|
void |
onRaftGroupDestroyed(CPGroupId groupId)
Called on the thread of the Raft group when the given Raft node is
destroyed, either gracefully or forcefully.
|
void |
onRaftNodeSteppedDown(CPGroupId groupId)
Called on the thread of the Raft group when the given Raft node is
stepped down, either because it is shutting down, or it could not be
added to the Raft group
|
void |
reset()
Resets this service back to its initial state.
|
void |
restoreSnapshot(CPGroupId groupId,
long commitIndex,
RaftAtomicRefSnapshot snapshot)
Restores the snapshot for specified
CPGroupId. |
void |
shutdown(boolean terminate)
Shuts down this service.
|
RaftAtomicRefSnapshot |
takeSnapshot(CPGroupId groupId,
long commitIndex)
Creates a snapshot for specified
CPGroupId. |
public static final String SERVICE_NAME
public RaftAtomicRefService(NodeEngine nodeEngine)
public void init(NodeEngine nodeEngine, Properties properties)
ManagedServiceinit in interface ManagedServicenodeEngine - the NodeEngine that this service belongs toproperties - the Properties (can be used to pass settings to the service)public void reset()
ManagedServiceTODO: what is the purpose of reset
reset in interface ManagedServicepublic void shutdown(boolean terminate)
ManagedServiceTODO: what is the purpose of the terminate variable
shutdown in interface ManagedServiceterminate - true to shut down this servicepublic void onCPSubsystemRestart()
RaftManagedServiceonCPSubsystemRestart in interface RaftManagedServicepublic RaftAtomicRefSnapshot takeSnapshot(CPGroupId groupId, long commitIndex)
SnapshotAwareServiceCPGroupId.
The snapshot object returned from this method will be stored among
the Raft log and it can be sent to other Raft nodes anytime. Therefore,
this method must not return a snapshot object that can mutate after
the takeSnapshot() call.takeSnapshot in interface SnapshotAwareService<RaftAtomicRefSnapshot>groupId - CPGroupId which is snapshot requested forcommitIndex - commitIndex of the taken snapshotCPGroupId.public void restoreSnapshot(CPGroupId groupId, long commitIndex, RaftAtomicRefSnapshot snapshot)
SnapshotAwareServiceCPGroupId.restoreSnapshot in interface SnapshotAwareService<RaftAtomicRefSnapshot>groupId - CPGroupId of the snapshot to be restoredcommitIndex - commitIndex of the restored snapshotsnapshot - snapshot for specified CPGroupIdpublic void onRaftGroupDestroyed(CPGroupId groupId)
RaftNodeLifecycleAwareServiceonRaftGroupDestroyed in interface RaftNodeLifecycleAwareServicepublic void onRaftNodeSteppedDown(CPGroupId groupId)
RaftNodeLifecycleAwareServiceonRaftNodeSteppedDown in interface RaftNodeLifecycleAwareServicepublic boolean destroyRaftObject(CPGroupId groupId, String name)
RaftRemoteServicedestroyRaftObject in interface RaftRemoteServicepublic RaftAtomicRef getAtomicRef(CPGroupId groupId, String name)
public IAtomicReference createProxy(String proxyName)
RaftRemoteServicecreateProxy in interface RaftRemoteServiceproxyName - the name of the CP data structureCopyright © 2020 Hazelcast, Inc.. All Rights Reserved.