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)
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 void onCPSubsystemRestart()
RaftManagedService
onCPSubsystemRestart
in interface RaftManagedService
public RaftAtomicRefSnapshot takeSnapshot(CPGroupId groupId, long commitIndex)
SnapshotAwareService
CPGroupId
.
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)
SnapshotAwareService
CPGroupId
.restoreSnapshot
in interface SnapshotAwareService<RaftAtomicRefSnapshot>
groupId
- CPGroupId
of the snapshot to be restoredcommitIndex
- commitIndex of the restored snapshotsnapshot
- snapshot for specified CPGroupId
public void onGroupDestroy(CPGroupId groupId)
RaftGroupLifecycleAwareService
onGroupDestroy
in interface RaftGroupLifecycleAwareService
public boolean destroyRaftObject(CPGroupId groupId, String name)
RaftRemoteService
destroyRaftObject
in interface RaftRemoteService
public RaftAtomicRef getAtomicRef(CPGroupId groupId, String name)
public DistributedObject createDistributedObject(String proxyName)
RemoteService
createDistributedObject
in interface RemoteService
proxyName
- the name for the created distributed objectpublic void destroyDistributedObject(String proxyName)
RemoteService
destroyDistributedObject
in interface RemoteService
proxyName
- the name of the distributed object to destroyCopyright © 2019 Hazelcast, Inc.. All Rights Reserved.