public abstract class AbstractProxySessionManager extends Object
Modifier and Type | Field and Description |
---|---|
static long |
NO_SESSION_ID
Represents absence of a Raft session
|
Constructor and Description |
---|
AbstractProxySessionManager() |
Modifier and Type | Method and Description |
---|---|
long |
acquireSession(RaftGroupId groupId)
Increments acquire count of the session.
|
long |
acquireSession(RaftGroupId groupId,
int count)
Increments acquire count of the session.
|
protected abstract ICompletableFuture<Object> |
closeSession(RaftGroupId groupId,
Long sessionId)
Closes the given session on the Raft group
|
protected abstract long |
generateThreadId(RaftGroupId groupId)
Generates a cluster-wide unique thread id for the caller
|
Long |
getOrCreateUniqueThreadId(RaftGroupId groupId) |
long |
getSession(RaftGroupId groupId)
Returns id of the session opened for the given Raft group.
|
long |
getSessionAcquireCount(RaftGroupId groupId,
long sessionId) |
protected abstract ICompletableFuture<Object> |
heartbeat(RaftGroupId groupId,
long sessionId)
Commits a heartbeat for the session on the Raft group
|
void |
invalidateSession(RaftGroupId groupId,
long id)
Invalidates the given session.
|
void |
releaseSession(RaftGroupId groupId,
long id)
Decrements acquire count of the session.
|
void |
releaseSession(RaftGroupId groupId,
long id,
int count)
Decrements acquire count of the session.
|
protected abstract SessionResponse |
requestNewSession(RaftGroupId groupId)
Creates a new session on the Raft group
|
protected void |
resetInternalState() |
protected abstract ScheduledFuture<?> |
scheduleWithRepetition(Runnable task,
long period,
TimeUnit unit)
Schedules the given task for repeating execution
|
Map<RaftGroupId,ICompletableFuture<Object>> |
shutdown()
Invokes a shutdown call on server to close all existing sessions.
|
public static final long NO_SESSION_ID
protected abstract long generateThreadId(RaftGroupId groupId)
protected abstract SessionResponse requestNewSession(RaftGroupId groupId)
protected abstract ICompletableFuture<Object> heartbeat(RaftGroupId groupId, long sessionId)
protected abstract ICompletableFuture<Object> closeSession(RaftGroupId groupId, Long sessionId)
protected abstract ScheduledFuture<?> scheduleWithRepetition(Runnable task, long period, TimeUnit unit)
protected final void resetInternalState()
public final Long getOrCreateUniqueThreadId(RaftGroupId groupId)
public final long acquireSession(RaftGroupId groupId)
public final long acquireSession(RaftGroupId groupId, int count)
public final void releaseSession(RaftGroupId groupId, long id)
public final void releaseSession(RaftGroupId groupId, long id, int count)
public final void invalidateSession(RaftGroupId groupId, long id)
public final long getSession(RaftGroupId groupId)
NO_SESSION_ID
if no session exists.public Map<RaftGroupId,ICompletableFuture<Object>> shutdown()
public final long getSessionAcquireCount(RaftGroupId groupId, long sessionId)
Copyright © 2022 Hazelcast, Inc.. All Rights Reserved.