@InterfaceAudience.Private public final class ReadOnlyZKClient extends Object implements Closeable
Modifier and Type | Class and Description |
---|---|
private static class |
ReadOnlyZKClient.Task |
private class |
ReadOnlyZKClient.ZKTask<T> |
Modifier and Type | Field and Description |
---|---|
private static ReadOnlyZKClient.Task |
CLOSE |
private AtomicBoolean |
closed |
private String |
connectString |
private static int |
DEFAULT_KEEPALIVE_MILLIS |
private static int |
DEFAULT_RECOVERY_RETRY |
private static int |
DEFAULT_RECOVERY_RETRY_INTERVAL_MILLIS |
private static EnumSet<org.apache.zookeeper.KeeperException.Code> |
FAIL_FAST_CODES |
static String |
KEEPALIVE_MILLIS |
private int |
keepAliveTimeMs |
private static org.slf4j.Logger |
LOG |
private int |
maxRetries |
private int |
pendingRequests |
static String |
RECOVERY_RETRY |
static String |
RECOVERY_RETRY_INTERVAL_MILLIS |
private int |
retryIntervalMs |
private int |
sessionTimeoutMs |
private DelayQueue<ReadOnlyZKClient.Task> |
tasks |
(package private) org.apache.zookeeper.ZooKeeper |
zookeeper |
Constructor and Description |
---|
ReadOnlyZKClient(org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
private void |
closeZk() |
CompletableFuture<org.apache.zookeeper.data.Stat> |
exists(String path) |
CompletableFuture<byte[]> |
get(String path) |
String |
getConnectString() |
private String |
getId() |
private org.apache.zookeeper.ZooKeeper |
getZk() |
private void |
run() |
private static final org.slf4j.Logger LOG
public static final String RECOVERY_RETRY
private static final int DEFAULT_RECOVERY_RETRY
public static final String RECOVERY_RETRY_INTERVAL_MILLIS
private static final int DEFAULT_RECOVERY_RETRY_INTERVAL_MILLIS
public static final String KEEPALIVE_MILLIS
private static final int DEFAULT_KEEPALIVE_MILLIS
private static final EnumSet<org.apache.zookeeper.KeeperException.Code> FAIL_FAST_CODES
private final String connectString
private final int sessionTimeoutMs
private final int maxRetries
private final int retryIntervalMs
private final int keepAliveTimeMs
private static final ReadOnlyZKClient.Task CLOSE
private final DelayQueue<ReadOnlyZKClient.Task> tasks
private final AtomicBoolean closed
org.apache.zookeeper.ZooKeeper zookeeper
private int pendingRequests
public ReadOnlyZKClient(org.apache.hadoop.conf.Configuration conf)
public CompletableFuture<byte[]> get(String path)
public CompletableFuture<org.apache.zookeeper.data.Stat> exists(String path)
private void closeZk()
private org.apache.zookeeper.ZooKeeper getZk() throws IOException
IOException
private void run()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public String getConnectString()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.