public class SimpleLeaseManager<T extends Node> extends AbstractLifecycleObservable implements LeaseManager<T>
Mar 09, 2021
| 限定符和类型 | 字段和说明 |
|---|---|
protected AtomicLong |
currentEpoch |
protected ConcurrentMap<String,Lease<T>> |
localRepo |
protected ReentrantReadWriteLock |
lock |
protected Logger |
logger |
| 构造器和说明 |
|---|
SimpleLeaseManager() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected boolean |
cancel(Lease<T> lease) |
Lease<T> |
getLease(T renewal)
Gets get lease.
|
VersionedList<Lease<T>> |
getLeaseMeta()
Gets get lease meta.
|
protected boolean |
refreshEpoch(long newEpoch) |
protected void |
register(Lease<T> lease) |
boolean |
renew(T renewal,
int leaseDuration)
Renew Lease.
|
addObserver, notifyObservers, removeObserverdispose, doDispose, doInitialize, doStart, doStop, getLifecycleState, initialize, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitializedisposegetLifecycleStateprotected final Logger logger
protected final AtomicLong currentEpoch
protected final ConcurrentMap<String,Lease<T extends Node>> localRepo
protected final ReentrantReadWriteLock lock
public boolean renew(T renewal, int leaseDuration)
LeaseManagerrenew 在接口中 LeaseManager<T extends Node>renewal - the renewalleaseDuration - the lease durationpublic Lease<T> getLease(T renewal)
LeaseManagergetLease 在接口中 LeaseManager<T extends Node>renewal - the renewalpublic VersionedList<Lease<T>> getLeaseMeta()
LeaseManagergetLeaseMeta 在接口中 LeaseManager<T extends Node>protected boolean refreshEpoch(long newEpoch)
Copyright © 2023 The Ant Financial. All rights reserved.