@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<Integer> |
getCurrentNrHRS()
Get the number of 'running' regionservers.
|
CompletableFuture<ServerName> |
getMasterAddress()
Get the address of HMaster.
|
CompletableFuture<Integer> |
getMasterInfoPort()
Get the info port 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 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
DeserializationExceptionpublic CompletableFuture<String> getClusterId()
AsyncRegistryThe upper layer should store this value somewhere as it will not be change any more.
getClusterId in interface AsyncRegistryReadOnlyZKClient getZKClient()
private static org.apache.hadoop.hbase.shaded.protobuf.generated.ZooKeeperProtos.MetaRegionServer getMetaProto(byte[] data) throws IOException
IOExceptionprivate 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)
public CompletableFuture<RegionLocations> getMetaRegionLocation()
AsyncRegistrygetMetaRegionLocation in interface AsyncRegistrypublic CompletableFuture<Integer> getCurrentNrHRS()
AsyncRegistrygetCurrentNrHRS in interface AsyncRegistryprivate static org.apache.hadoop.hbase.shaded.protobuf.generated.ZooKeeperProtos.Master getMasterProto(byte[] data) throws IOException
IOExceptionpublic CompletableFuture<ServerName> getMasterAddress()
AsyncRegistrygetMasterAddress in interface AsyncRegistrypublic CompletableFuture<Integer> getMasterInfoPort()
AsyncRegistrygetMasterInfoPort in interface AsyncRegistrypublic void close()
AsyncRegistryclose in interface Closeableclose in interface AutoCloseableclose in interface AsyncRegistryCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.