public interface CoordinationSession
| Modifier and Type | Interface and Description |
|---|---|
static interface |
CoordinationSession.Observer |
| 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() |
long getSessionId()
CompletableFuture<Status> start(CoordinationSession.Observer observer)
void sendStartSession(tech.ydb.proto.coordination.SessionRequest.SessionStart sessionStart)
sessionStart - session start of proto bodyvoid sendPingPong(tech.ydb.proto.coordination.SessionRequest.PingPong pingPong)
pingPong - ping pong of proto bodyvoid sendAcquireSemaphore(tech.ydb.proto.coordination.SessionRequest.AcquireSemaphore acquireSemaphore)
WARNING: 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.
acquireSemaphore - acquire semaphore of proto bodyvoid sendReleaseSemaphore(tech.ydb.proto.coordination.SessionRequest.ReleaseSemaphore releaseSemaphore)
WARNING: 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.
releaseSemaphore - release semaphore of proto bodyvoid sendDescribeSemaphore(tech.ydb.proto.coordination.SessionRequest.DescribeSemaphore describeSemaphore)
WARNING: a describe operation will cancel previous watches on the same semaphore
describeSemaphore - describe semaphore of proto bodyvoid sendCreateSemaphore(tech.ydb.proto.coordination.SessionRequest.CreateSemaphore createSemaphore)
createSemaphore - create semaphore of proto bodyvoid sendUpdateSemaphore(tech.ydb.proto.coordination.SessionRequest.UpdateSemaphore updateSemaphore)
updateSemaphore - update semaphore of proto bodyvoid sendDeleteSemaphore(tech.ydb.proto.coordination.SessionRequest.DeleteSemaphore deleteSemaphore)
deleteSemaphore - delete semaphore of proto bodyvoid stop()
Copyright © 2023. All rights reserved.