public abstract class DefaultServiceEntity extends Object implements Closeable
Modifier and Type | Field and Description |
---|---|
ReentrantLock |
mLock |
AtomicBoolean |
mNeedReconnect |
protected long |
mRevision |
protected String |
mServiceEntityName |
Constructor and Description |
---|
DefaultServiceEntity()
CTOR for DefaultServiceEntity.
|
DefaultServiceEntity(String serviceEntityName)
CTOR for ServiceEntity with given ServiceEntity name.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
deserialize(byte[] buf)
Deserialize the ServiceEntity from bytes.
|
io.etcd.jetcd.support.CloseableClient |
getKeepAliveClient()
Get the keepalive client instance.
|
AlluxioEtcdClient.Lease |
getLease() |
long |
getLeaseTimeoutInSec()
Get the timeout for lease in seconds.
|
long |
getLeaseTTLInSec()
Get the TTL for lease in seconds.
|
long |
getRevisionNumber()
Get the revision number of currently registered DefaultServiceEntity
on ETCD.
|
String |
getServiceEntityName()
Get service entity name.
|
byte[] |
serialize()
Serialize the ServiceEntity to bytes.
|
void |
setKeepAliveClient(io.etcd.jetcd.support.CloseableClient keepAliveClient)
Set keep alive client.
|
void |
setLease(AlluxioEtcdClient.Lease lease)
Set lease.
|
void |
setLeaseTimeoutInSec(long timeout)
Set the timeout for lease in seconds.
|
void |
setLeaseTTLInSec(long ttl)
Set the TTL for lease in seconds.
|
void |
setRevisionNumber(long revisionNumber)
Set revision number.
|
@Expose @SerializedName(value="ServiceEntityName") protected String mServiceEntityName
protected long mRevision
public final ReentrantLock mLock
public AtomicBoolean mNeedReconnect
public DefaultServiceEntity()
public DefaultServiceEntity(String serviceEntityName)
serviceEntityName
- public String getServiceEntityName()
public void setKeepAliveClient(io.etcd.jetcd.support.CloseableClient keepAliveClient)
keepAliveClient
- public io.etcd.jetcd.support.CloseableClient getKeepAliveClient()
public AlluxioEtcdClient.Lease getLease()
public void setLease(AlluxioEtcdClient.Lease lease)
lease
- public long getRevisionNumber()
public void setRevisionNumber(long revisionNumber)
revisionNumber
- public long getLeaseTTLInSec()
public void setLeaseTTLInSec(long ttl)
ttl
- public long getLeaseTimeoutInSec()
public void setLeaseTimeoutInSec(long timeout)
timeout
- public byte[] serialize()
public void deserialize(byte[] buf)
buf
- public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2023. All Rights Reserved.