类 JEtcdClient
- java.lang.Object
-
- org.apache.dubbo.remoting.etcd.support.AbstractEtcdClient<JEtcdClient.EtcdWatcher>
-
- org.apache.dubbo.remoting.etcd.jetcd.JEtcdClient
-
- 所有已实现的接口:
EtcdClient
public class JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher>
etcd3 client.
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 classJEtcdClient.EtcdWatcher
-
构造器概要
构造器 构造器 说明 JEtcdClient(URL url)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 List<String>addChildWatcherListener(String path, JEtcdClient.EtcdWatcher etcdWatcher)booleancheckExists(String path)JEtcdClient.EtcdWatchercreateChildWatcherListener(String path, ChildListener listener)longcreateLease(long second)create new lease from specified second ,it should be waiting if failed.longcreateLease(long ttl, long timeout, TimeUnit unit)create new lease from specified ttl second before waiting specified timeout.voiddelete(String path)remove the specified from etcd registry.voiddoClose()longdoCreateEphemeral(String path)voiddoCreatePersistent(String path)io.grpc.ManagedChannelgetChannel()List<String>getChildren(String path)find direct children directory, excluding path self, Never return null.StringgetKVValue(String key)Get the value of the specified key.booleanisConnected()test if current client is active.booleanput(String key, String value)Put the key value pair to etcdbooleanputEphemeral(String key, String value)Put the key value pair to etcd (Ephemeral)voidremoveChildWatcherListener(String path, JEtcdClient.EtcdWatcher etcdWatcher)voidrevokeLease(long lease)revoke specified lease, any associated path will removed automatically.-
从类继承的方法 org.apache.dubbo.remoting.etcd.support.AbstractEtcdClient
addChildListener, addStateListener, close, create, createEphemeral, getChildListener, getSessionListeners, getUrl, removeChildListener, removeStateListener
-
-
-
-
构造器详细资料
-
JEtcdClient
public JEtcdClient(URL url)
-
-
方法详细资料
-
doCreatePersistent
public void doCreatePersistent(String path)
-
doCreateEphemeral
public long doCreateEphemeral(String path)
-
checkExists
public boolean checkExists(String path)
-
createChildWatcherListener
public JEtcdClient.EtcdWatcher createChildWatcherListener(String path, ChildListener listener)
-
addChildWatcherListener
public List<String> addChildWatcherListener(String path, JEtcdClient.EtcdWatcher etcdWatcher)
-
removeChildWatcherListener
public void removeChildWatcherListener(String path, JEtcdClient.EtcdWatcher etcdWatcher)
-
getChildren
public List<String> getChildren(String path)
从接口复制的说明:EtcdClientfind direct children directory, excluding path self, Never return null.- 参数:
path- the path to be found direct children.- 返回:
- direct children directory, contains zero element list if children directory not exists.
-
isConnected
public boolean isConnected()
从接口复制的说明:EtcdClienttest if current client is active.- 返回:
- true if connection is active else false.
-
createLease
public long createLease(long second)
从接口复制的说明:EtcdClientcreate new lease from specified second ,it should be waiting if failed.- 参数:
second- lease time (support second only).- 返回:
- lease id from etcd
-
createLease
public long createLease(long ttl, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException从接口复制的说明:EtcdClientcreate new lease from specified ttl second before waiting specified timeout.- 参数:
ttl- lease time (support second only).timeout- the maximum time to waitunit- the time unit of the timeout argument- 返回:
- lease id from etcd
- 抛出:
InterruptedException- if the current thread was interrupted while waitingExecutionException- if this future completed exceptionallyTimeoutException- if the wait timed out
-
delete
public void delete(String path)
从接口复制的说明:EtcdClientremove the specified from etcd registry.- 指定者:
delete在接口中EtcdClient- 指定者:
delete在类中AbstractEtcdClient<JEtcdClient.EtcdWatcher>- 参数:
path- the path to be removed
-
revokeLease
public void revokeLease(long lease)
从接口复制的说明:EtcdClientrevoke specified lease, any associated path will removed automatically.- 参数:
lease- to be removed lease
-
doClose
public void doClose()
- 指定者:
doClose在类中AbstractEtcdClient<JEtcdClient.EtcdWatcher>
-
getKVValue
public String getKVValue(String key)
从接口复制的说明:EtcdClientGet the value of the specified key.- 参数:
key- the specified key- 返回:
- null if the value is not found
-
put
public boolean put(String key, String value)
从接口复制的说明:EtcdClientPut the key value pair to etcd- 参数:
key- the specified keyvalue- the paired value- 返回:
- true if put success
-
putEphemeral
public boolean putEphemeral(String key, String value)
从接口复制的说明:EtcdClientPut the key value pair to etcd (Ephemeral)- 参数:
key- the specified keyvalue- the paired value- 返回:
- true if put success
-
getChannel
public io.grpc.ManagedChannel getChannel()
-
-