public interface Lease extends CloseableClient
Modifier and Type | Method and Description |
---|---|
CompletableFuture<LeaseGrantResponse> |
grant(long ttl)
New a lease with ttl value.
|
CompletableFuture<LeaseGrantResponse> |
grant(long ttl,
long timeout,
TimeUnit unit)
New a lease with ttl value.Waits if necessary for at most the given time
if etcd server is available.
|
CloseableClient |
keepAlive(long leaseId,
io.grpc.stub.StreamObserver<LeaseKeepAliveResponse> observer)
keep the given lease alive forever.
|
CompletableFuture<LeaseKeepAliveResponse> |
keepAliveOnce(long leaseId)
keep alive one lease only once.
|
CompletableFuture<LeaseRevokeResponse> |
revoke(long leaseId)
revoke one lease and the key bind to this lease will be removed.
|
CompletableFuture<LeaseTimeToLiveResponse> |
timeToLive(long leaseId,
LeaseOption leaseOption)
retrieves the lease information of the given lease ID.
|
close
CompletableFuture<LeaseGrantResponse> grant(long ttl)
ttl
- ttl value, unit secondsCompletableFuture<LeaseGrantResponse> grant(long ttl, long timeout, TimeUnit unit)
ttl
- ttl value, unit secondstimeout
- the maximum time to waitsunit
- the time unit of the timeout argumentCompletableFuture<LeaseRevokeResponse> revoke(long leaseId)
leaseId
- id of the lease to revokeCompletableFuture<LeaseKeepAliveResponse> keepAliveOnce(long leaseId)
leaseId
- id of lease to keep alive onceCompletableFuture<LeaseTimeToLiveResponse> timeToLive(long leaseId, LeaseOption leaseOption)
leaseId
- id of leaseleaseOption
- LeaseOptionCloseableClient keepAlive(long leaseId, io.grpc.stub.StreamObserver<LeaseKeepAliveResponse> observer)
leaseId
- lease to be keep alive forever.observer
- the observerCopyright © 2020. All rights reserved.