public interface LeaseClient
| Modifier and Type | Interface and Description |
|---|---|
static interface |
LeaseClient.FluentGrantRequest |
static interface |
LeaseClient.FluentMaintainRequest |
| Modifier and Type | Method and Description |
|---|---|
default com.google.common.util.concurrent.ListenableFuture<LeaseGrantResponse> |
create(long ttlSecs)
Deprecated.
use the more flexible
grant(long) |
com.google.common.util.concurrent.ListenableFuture<LeaseGrantResponse> |
create(long leaseId,
long ttlSecs)
Deprecated.
use the more flexible
grant(long) |
LeaseClient.FluentGrantRequest |
grant(long ttlSecs)
Start a fluent grant request for "one time" lease establishment.
|
com.google.common.util.concurrent.ListenableFuture<LeaseKeepAliveResponse> |
keepAliveOnce(long leaseId) |
com.google.common.util.concurrent.ListenableFuture<LeaseLeasesResponse> |
list()
List all existing leases
Supported in versions >= 3.3 only
|
LeaseClient.FluentMaintainRequest |
maintain()
Maintain a "persistent" lease.
|
com.google.common.util.concurrent.ListenableFuture<LeaseRevokeResponse> |
revoke(long leaseId) |
com.google.common.util.concurrent.ListenableFuture<LeaseRevokeResponse> |
revoke(long leaseId,
boolean ensureWithRetries) |
default com.google.common.util.concurrent.ListenableFuture<LeaseTimeToLiveResponse> |
ttl(long leaseId) |
com.google.common.util.concurrent.ListenableFuture<LeaseTimeToLiveResponse> |
ttl(long leaseId,
boolean includeKeys) |
@Deprecated com.google.common.util.concurrent.ListenableFuture<LeaseGrantResponse> create(long leaseId, long ttlSecs)
grant(long)leaseId - ttlSecs - LeaseGrantResponse@Deprecated default com.google.common.util.concurrent.ListenableFuture<LeaseGrantResponse> create(long ttlSecs)
grant(long)ttlSecs - LeaseGrantResponseLeaseClient.FluentGrantRequest grant(long ttlSecs)
PersistentLease
via the maintain() method.ttlSecs - com.google.common.util.concurrent.ListenableFuture<LeaseRevokeResponse> revoke(long leaseId)
leaseId - LeaseRevokeResponsecom.google.common.util.concurrent.ListenableFuture<LeaseRevokeResponse> revoke(long leaseId, boolean ensureWithRetries)
leaseId - ensureWithRetries - if true, the asynchronous request will be retried
continuously in the background after connection failures (between back-off pauses)LeaseRevokeResponsecom.google.common.util.concurrent.ListenableFuture<LeaseTimeToLiveResponse> ttl(long leaseId, boolean includeKeys)
leaseId - includeKeys - LeaseTimeToLiveResponsedefault com.google.common.util.concurrent.ListenableFuture<LeaseTimeToLiveResponse> ttl(long leaseId)
leaseId - LeaseTimeToLiveResponsecom.google.common.util.concurrent.ListenableFuture<LeaseKeepAliveResponse> keepAliveOnce(long leaseId)
leaseId - LeaseKeepAliveResponsecom.google.common.util.concurrent.ListenableFuture<LeaseLeasesResponse> list()
Supported in versions >= 3.3 only
LeaseLeasesResponseLeaseClient.FluentMaintainRequest maintain()
PersistentLease object.
Specifying a lease id is optional. If not provided it will be server-assigned.
The return PersistentLease is also a future, which will be completed
with the lease id when it is granted/confirmed.
NOTE sole "ownership" of the lease is assumed - i.e. the lease should not be revoked elsewhere.
Copyright © 2023. All rights reserved.