public class ProxySessionManagerService extends AbstractProxySessionManager implements GracefulShutdownAwareService, RaftManagedService
Modifier and Type | Field and Description |
---|---|
static String |
SERVICE_NAME
Name of the service
|
NO_SESSION_ID
Constructor and Description |
---|
ProxySessionManagerService(NodeEngine nodeEngine) |
Modifier and Type | Method and Description |
---|---|
protected ICompletableFuture<Object> |
closeSession(RaftGroupId groupId,
Long sessionId)
Closes the given session on the Raft group
|
protected long |
generateThreadId(RaftGroupId groupId)
Generates a cluster-wide unique thread id for the caller
|
protected ICompletableFuture<Object> |
heartbeat(RaftGroupId groupId,
long sessionId)
Commits a heartbeat for the session on the Raft group
|
void |
init(NodeEngine nodeEngine,
Properties properties)
Initializes this service.
|
void |
onCPSubsystemRestart()
Called when the CP subsystem is restarted.
|
boolean |
onShutdown(long timeout,
TimeUnit unit)
A hook method that's called during graceful shutdown to provide safety for data managed by this service.
|
protected SessionResponse |
requestNewSession(RaftGroupId groupId)
Creates a new session on the Raft group
|
void |
reset()
Resets this service back to its initial state.
|
protected ScheduledFuture<?> |
scheduleWithRepetition(Runnable task,
long period,
TimeUnit unit)
Schedules the given task for repeating execution
|
void |
shutdown(boolean terminate)
Shuts down this service.
|
acquireSession, acquireSession, getOrCreateUniqueThreadId, getSession, getSessionAcquireCount, invalidateSession, releaseSession, releaseSession, resetInternalState, shutdown
public static final String SERVICE_NAME
public ProxySessionManagerService(NodeEngine nodeEngine)
protected long generateThreadId(RaftGroupId groupId)
AbstractProxySessionManager
generateThreadId
in class AbstractProxySessionManager
protected SessionResponse requestNewSession(RaftGroupId groupId)
AbstractProxySessionManager
requestNewSession
in class AbstractProxySessionManager
protected ICompletableFuture<Object> heartbeat(RaftGroupId groupId, long sessionId)
AbstractProxySessionManager
heartbeat
in class AbstractProxySessionManager
protected ICompletableFuture<Object> closeSession(RaftGroupId groupId, Long sessionId)
AbstractProxySessionManager
closeSession
in class AbstractProxySessionManager
protected ScheduledFuture<?> scheduleWithRepetition(Runnable task, long period, TimeUnit unit)
AbstractProxySessionManager
scheduleWithRepetition
in class AbstractProxySessionManager
public boolean onShutdown(long timeout, TimeUnit unit)
GracefulShutdownAwareService
onShutdown
in interface GracefulShutdownAwareService
timeout
- timeout for graceful shutdownunit
- time unitpublic 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
Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.