@InterfaceAudience.LimitedPrivate(value="Configuration") public class RpcConnectionRegistry extends Object
RegistryProtos.ClientMetaService
to get registry
information.
It needs bootstrap node list when start up, and then it will use RegistryProtos.ClientMetaService
to
refresh the bootstrap node list periodically.
Usually, you could set masters as the bootstrap nodes,as they will also implement the
RegistryProtos.ClientMetaService
, and then, we will switch to use region servers after refreshing the
bootstrap nodes.Modifier and Type | Class and Description |
---|---|
protected static interface |
AbstractRpcBasedConnectionRegistry.Callable<T>
For describing the actual asynchronous rpc call.
|
Modifier and Type | Field and Description |
---|---|
static String |
BOOTSTRAP_NODES |
static int |
HEDGED_REQS_FANOUT_DEFAULT
Default value for the fan out of hedged requests.
|
static String |
HEDGED_REQS_FANOUT_KEY
Configuration key that controls the fan out of requests
|
static String |
INITIAL_REFRESH_DELAY_SECS
As end users could configure any nodes in a cluster as the initial bootstrap nodes, it is
possible that different end users will configure the same machine which makes the machine over
load.
|
static String |
MIN_SECS_BETWEEN_REFRESHES |
static String |
PERIODIC_REFRESH_INTERVAL_SECS |
Modifier and Type | Method and Description |
---|---|
protected <T extends org.apache.hbase.thirdparty.com.google.protobuf.Message> |
call(AbstractRpcBasedConnectionRegistry.Callable<T> callable,
Predicate<T> isValidResp,
String debug) |
void |
close()
Closes this instance and releases any system resources associated with it
|
protected CompletableFuture<Set<ServerName>> |
fetchEndpoints() |
CompletableFuture<ServerName> |
getActiveMaster()
Get the address of active HMaster.
|
protected Set<ServerName> |
getBootstrapNodes(org.apache.hadoop.conf.Configuration conf) |
CompletableFuture<String> |
getClusterId()
Should only be called once.
|
String |
getConnectionString()
Return the connection string associated with this registry instance.
|
CompletableFuture<RegionLocations> |
getMetaRegionLocations()
Get the location of meta region(s).
|
public static final String HEDGED_REQS_FANOUT_KEY
public static final String INITIAL_REFRESH_DELAY_SECS
public static final String PERIODIC_REFRESH_INTERVAL_SECS
public static final String MIN_SECS_BETWEEN_REFRESHES
public static final String BOOTSTRAP_NODES
public static final int HEDGED_REQS_FANOUT_DEFAULT
protected Set<ServerName> getBootstrapNodes(org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
public String getConnectionString()
ConnectionRegistry
protected CompletableFuture<Set<ServerName>> fetchEndpoints()
protected final <T extends org.apache.hbase.thirdparty.com.google.protobuf.Message> CompletableFuture<T> call(AbstractRpcBasedConnectionRegistry.Callable<T> callable, Predicate<T> isValidResp, String debug)
public CompletableFuture<RegionLocations> getMetaRegionLocations()
ConnectionRegistry
getMetaRegionLocations
in interface ConnectionRegistry
public CompletableFuture<String> getClusterId()
ConnectionRegistry
The upper layer should store this value somewhere as it will not be change any more.
getClusterId
in interface ConnectionRegistry
public CompletableFuture<ServerName> getActiveMaster()
ConnectionRegistry
getActiveMaster
in interface ConnectionRegistry
public void close()
ConnectionRegistry
close
in interface Closeable
close
in interface AutoCloseable
close
in interface ConnectionRegistry
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.