public class RaftAtomicRefService extends Object implements RaftManagedService, RaftRemoteService, RaftGroupLifecycleAwareService, 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 |
|---|---|
DistributedObject |
createDistributedObject(String proxyName)
Creates a distributed object.
|
void |
destroyDistributedObject(String proxyName)
Destroys a distributed object.
|
boolean |
destroyRaftObject(CPGroupId groupId,
String name)
Destroys the given Raft data structure on the Raft 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 |
onGroupDestroy(CPGroupId groupId)
Called on the thread of the Raft group when the given Raft group is
destroyed, either gracefully or forcefully.
|
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 onGroupDestroy(CPGroupId groupId)
RaftGroupLifecycleAwareServiceonGroupDestroy in interface RaftGroupLifecycleAwareServicepublic boolean destroyRaftObject(CPGroupId groupId, String name)
RaftRemoteServicedestroyRaftObject in interface RaftRemoteServicepublic RaftAtomicRef getAtomicRef(CPGroupId groupId, String name)
public DistributedObject createDistributedObject(String proxyName)
RemoteServicecreateDistributedObject in interface RemoteServiceproxyName - the name for the created distributed objectpublic void destroyDistributedObject(String proxyName)
RemoteServicedestroyDistributedObject in interface RemoteServiceproxyName - the name of the distributed object to destroyCopyright © 2019 Hazelcast, Inc.. All Rights Reserved.