public class EtcdClient extends Object implements KvStoreClient
| Modifier and Type | Class and Description |
|---|---|
static class |
EtcdClient.Builder |
protected static class |
EtcdClient.EtcdEventThread |
static class |
EtcdClient.Internal |
| Modifier and Type | Field and Description |
|---|---|
protected static Pattern |
ADDR_PATT |
static int |
DEFAULT_PORT |
static int |
DEFAULT_SESSION_TIMEOUT_SECS |
static long |
DEFAULT_TIMEOUT_MS |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected static <T> com.google.common.base.Predicate<T> |
constantPredicate(boolean val) |
protected static boolean |
contains(String str,
String subStr) |
protected static boolean |
endsWith(String str,
String... suffixes) |
static EtcdClient.Builder |
forEndpoint(String host,
int port) |
static EtcdClient.Builder |
forEndpoints(List<String> endpoints) |
static EtcdClient.Builder |
forEndpoints(String endpoints) |
Executor |
getExecutor() |
KvClient |
getKvClient() |
LeaseClient |
getLeaseClient() |
LockClient |
getLockClient() |
PersistentLease |
getSessionLease()
Returns a singular
PersistentLease bound
to the life of this client instance. |
ScheduledExecutorService |
internalScheduledExecutor()
Care should be taken not to use this executor for any blocking
or CPU intensive tasks.
|
boolean |
isClosed() |
protected static boolean |
reauthRequired(Throwable error) |
protected static boolean |
retryAuthRequest(Throwable error) |
protected static boolean |
startsWith(String str,
String prefix) |
public static final int DEFAULT_PORT
public static final long DEFAULT_TIMEOUT_MS
public static final int DEFAULT_SESSION_TIMEOUT_SECS
protected static final Pattern ADDR_PATT
public static EtcdClient.Builder forEndpoint(String host, int port)
host - port - public static EtcdClient.Builder forEndpoints(List<String> endpoints)
endpoints - public static EtcdClient.Builder forEndpoints(String endpoints)
endpoints - public void close()
close in interface Closeableclose in interface AutoCloseablepublic boolean isClosed()
protected static boolean reauthRequired(Throwable error)
protected static boolean retryAuthRequest(Throwable error)
public KvClient getKvClient()
getKvClient in interface KvStoreClientpublic LeaseClient getLeaseClient()
getLeaseClient in interface KvStoreClientpublic LockClient getLockClient()
getLockClient in interface KvStoreClientpublic PersistentLease getSessionLease()
KvStoreClientPersistentLease bound
to the life of this client instance. May be lazily
established, but is revoked only when this client
instance is closed (closing the returned lease has
no effect).getSessionLease in interface KvStoreClientpublic Executor getExecutor()
public ScheduledExecutorService internalScheduledExecutor()
protected static <T> com.google.common.base.Predicate<T> constantPredicate(boolean val)
Copyright © 2023. All rights reserved.