@InterfaceAudience.Private class ZKConnectionRegistry extends Object implements ConnectionRegistry
| Modifier and Type | Class and Description | 
|---|---|
| private static interface  | ZKConnectionRegistry.Converter<T> | 
| Modifier and Type | Field and Description | 
|---|---|
| private static org.slf4j.Logger | LOG | 
| private ReadOnlyZKClient | zk | 
| private ZNodePaths | znodePaths | 
| Constructor and Description | 
|---|
| ZKConnectionRegistry(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 | 
| CompletableFuture<ServerName> | getActiveMaster()Get the address of active HMaster. | 
| private <T> CompletableFuture<T> | getAndConvert(String path,
             ZKConnectionRegistry.Converter<T> converter) | 
| CompletableFuture<String> | getClusterId()Should only be called once. | 
| private static String | getClusterId(byte[] data) | 
| 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) | 
| private void | getMetaRegionLocation(CompletableFuture<RegionLocations> future,
                     List<String> metaReplicaZNodes) | 
| CompletableFuture<RegionLocations> | getMetaRegionLocations()Get the location of meta region(s). | 
| 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,
           Collection<HRegionLocation> locs,
           CompletableFuture<RegionLocations> future) | 
private static final org.slf4j.Logger LOG
private final ReadOnlyZKClient zk
private final ZNodePaths znodePaths
ZKConnectionRegistry(org.apache.hadoop.conf.Configuration conf)
private <T> CompletableFuture<T> getAndConvert(String path, ZKConnectionRegistry.Converter<T> converter)
private static String getClusterId(byte[] data) throws DeserializationException
DeserializationExceptionpublic CompletableFuture<String> getClusterId()
ConnectionRegistryThe upper layer should store this value somewhere as it will not be change any more.
getClusterId in interface ConnectionRegistryReadOnlyZKClient 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, Collection<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> getMetaRegionLocations()
ConnectionRegistrygetMetaRegionLocations in interface ConnectionRegistryprivate static org.apache.hadoop.hbase.shaded.protobuf.generated.ZooKeeperProtos.Master getMasterProto(byte[] data) throws IOException
IOExceptionpublic CompletableFuture<ServerName> getActiveMaster()
ConnectionRegistrygetActiveMaster in interface ConnectionRegistrypublic void close()
ConnectionRegistryclose in interface Closeableclose in interface AutoCloseableclose in interface ConnectionRegistryCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.