@InterfaceAudience.Private class ZKAsyncRegistry extends Object implements AsyncRegistry
Modifier and Type | Class and Description |
---|---|
private static interface |
ZKAsyncRegistry.Converter<T> |
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
private ReadOnlyZKClient |
zk |
private ZNodePaths |
znodePaths |
Constructor and Description |
---|
ZKAsyncRegistry(org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this instance and releases any system resources associated with it
|
private <T> CompletableFuture<T> |
getAndConvert(String path,
ZKAsyncRegistry.Converter<T> converter) |
CompletableFuture<String> |
getClusterId()
Should only be called once.
|
private static String |
getClusterId(byte[] data) |
CompletableFuture<ServerName> |
getMasterAddress()
Get the address of HMaster.
|
private static org.apache.hadoop.hbase.shaded.protobuf.generated.ZooKeeperProtos.Master |
getMasterProto(byte[] data) |
private static org.apache.hadoop.hbase.shaded.protobuf.generated.ZooKeeperProtos.MetaRegionServer |
getMetaProto(byte[] data) |
CompletableFuture<RegionLocations> |
getMetaRegionLocation()
Get the location of meta region.
|
private void |
getMetaRegionLocation(CompletableFuture<RegionLocations> future,
List<String> metaReplicaZNodes) |
private Pair<RegionState.State,ServerName> |
getStateAndServerName(org.apache.hadoop.hbase.shaded.protobuf.generated.ZooKeeperProtos.MetaRegionServer proto) |
(package private) ReadOnlyZKClient |
getZKClient() |
private static void |
tryComplete(org.apache.commons.lang3.mutable.MutableInt remaining,
HRegionLocation[] locs,
CompletableFuture<RegionLocations> future) |
private static final org.slf4j.Logger LOG
private final ReadOnlyZKClient zk
private final ZNodePaths znodePaths
ZKAsyncRegistry(org.apache.hadoop.conf.Configuration conf)
private <T> CompletableFuture<T> getAndConvert(String path, ZKAsyncRegistry.Converter<T> converter)
private static String getClusterId(byte[] data) throws DeserializationException
DeserializationException
public CompletableFuture<String> getClusterId()
AsyncRegistry
The upper layer should store this value somewhere as it will not be change any more.
getClusterId
in interface AsyncRegistry
ReadOnlyZKClient getZKClient()
private static org.apache.hadoop.hbase.shaded.protobuf.generated.ZooKeeperProtos.MetaRegionServer getMetaProto(byte[] data) throws IOException
IOException
private static void tryComplete(org.apache.commons.lang3.mutable.MutableInt remaining, HRegionLocation[] locs, CompletableFuture<RegionLocations> future)
private Pair<RegionState.State,ServerName> getStateAndServerName(org.apache.hadoop.hbase.shaded.protobuf.generated.ZooKeeperProtos.MetaRegionServer proto)
private void getMetaRegionLocation(CompletableFuture<RegionLocations> future, List<String> metaReplicaZNodes)
public CompletableFuture<RegionLocations> getMetaRegionLocation()
AsyncRegistry
getMetaRegionLocation
in interface AsyncRegistry
private static org.apache.hadoop.hbase.shaded.protobuf.generated.ZooKeeperProtos.Master getMasterProto(byte[] data) throws IOException
IOException
public CompletableFuture<ServerName> getMasterAddress()
AsyncRegistry
getMasterAddress
in interface AsyncRegistry
public void close()
AsyncRegistry
close
in interface Closeable
close
in interface AutoCloseable
close
in interface AsyncRegistry
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.