public class CoordinationSessionImpl extends Object implements CoordinationSession
CoordinationSession.Observer| Constructor and Description |
|---|
CoordinationSessionImpl(GrpcReadWriteStream<tech.ydb.proto.coordination.SessionResponse,tech.ydb.proto.coordination.SessionRequest> coordinationStream) |
| Modifier and Type | Method and Description |
|---|---|
long |
getSessionId() |
void |
sendAcquireSemaphore(tech.ydb.proto.coordination.SessionRequest.AcquireSemaphore acquireSemaphore)
Used to acquire a semaphore
|
void |
sendCreateSemaphore(tech.ydb.proto.coordination.SessionRequest.CreateSemaphore createSemaphore)
Used to create a new semaphore
|
void |
sendDeleteSemaphore(tech.ydb.proto.coordination.SessionRequest.DeleteSemaphore deleteSemaphore)
Used to delete an existing semaphore
|
void |
sendDescribeSemaphore(tech.ydb.proto.coordination.SessionRequest.DescribeSemaphore describeSemaphore)
Used to describe semaphores and watch them for changes
|
void |
sendPingPong(tech.ydb.proto.coordination.SessionRequest.PingPong pingPong)
Used for checking liveness of the connection
|
void |
sendReleaseSemaphore(tech.ydb.proto.coordination.SessionRequest.ReleaseSemaphore releaseSemaphore)
Used to release a semaphore
|
void |
sendStartSession(tech.ydb.proto.coordination.SessionRequest.SessionStart sessionStart)
First message used to start/restore a session
|
void |
sendUpdateSemaphore(tech.ydb.proto.coordination.SessionRequest.UpdateSemaphore updateSemaphore)
Used to change semaphore data
|
CompletableFuture<Status> |
start(CoordinationSession.Observer observer) |
void |
stop() |
public CoordinationSessionImpl(GrpcReadWriteStream<tech.ydb.proto.coordination.SessionResponse,tech.ydb.proto.coordination.SessionRequest> coordinationStream)
public long getSessionId()
getSessionId in interface CoordinationSessionpublic CompletableFuture<Status> start(CoordinationSession.Observer observer)
start in interface CoordinationSessionpublic void sendStartSession(tech.ydb.proto.coordination.SessionRequest.SessionStart sessionStart)
CoordinationSessionsendStartSession in interface CoordinationSessionsessionStart - session start of proto bodypublic void sendPingPong(tech.ydb.proto.coordination.SessionRequest.PingPong pingPong)
CoordinationSessionsendPingPong in interface CoordinationSessionpingPong - ping pong of proto bodypublic void sendAcquireSemaphore(tech.ydb.proto.coordination.SessionRequest.AcquireSemaphore acquireSemaphore)
CoordinationSessionWARNING: a single session cannot acquire the same semaphore multiple times
Later requests override previous operations with the same semaphore, e.g. to reduce acquired count, change timeout or attached data.
sendAcquireSemaphore in interface CoordinationSessionacquireSemaphore - acquire semaphore of proto bodypublic void sendReleaseSemaphore(tech.ydb.proto.coordination.SessionRequest.ReleaseSemaphore releaseSemaphore)
CoordinationSessionWARNING: a single session cannot release the same semaphore multiple times
The release operation will either remove current session from waiters queue or release an already owned semaphore.
sendReleaseSemaphore in interface CoordinationSessionreleaseSemaphore - release semaphore of proto bodypublic void sendDescribeSemaphore(tech.ydb.proto.coordination.SessionRequest.DescribeSemaphore describeSemaphore)
CoordinationSessionWARNING: a describe operation will cancel previous watches on the same semaphore
sendDescribeSemaphore in interface CoordinationSessiondescribeSemaphore - describe semaphore of proto bodypublic void sendCreateSemaphore(tech.ydb.proto.coordination.SessionRequest.CreateSemaphore createSemaphore)
CoordinationSessionsendCreateSemaphore in interface CoordinationSessioncreateSemaphore - create semaphore of proto bodypublic void sendUpdateSemaphore(tech.ydb.proto.coordination.SessionRequest.UpdateSemaphore updateSemaphore)
CoordinationSessionsendUpdateSemaphore in interface CoordinationSessionupdateSemaphore - update semaphore of proto bodypublic void sendDeleteSemaphore(tech.ydb.proto.coordination.SessionRequest.DeleteSemaphore deleteSemaphore)
CoordinationSessionsendDeleteSemaphore in interface CoordinationSessiondeleteSemaphore - delete semaphore of proto bodypublic void stop()
stop in interface CoordinationSessionCopyright © 2024. All rights reserved.