Package org.apache.hadoop.hbase.client
Class RpcConnectionRegistry
java.lang.Object
org.apache.hadoop.hbase.client.AbstractRpcBasedConnectionRegistry
org.apache.hadoop.hbase.client.RpcConnectionRegistry
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ConnectionRegistry
@LimitedPrivate("Configuration")
public class RpcConnectionRegistry
extends AbstractRpcBasedConnectionRegistry
Rpc based connection registry. It will make use of the
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.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.client.AbstractRpcBasedConnectionRegistry
AbstractRpcBasedConnectionRegistry.Callable<T>
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final char
static final String
private final String
static final String
Configuration key that controls the fan out of requestsstatic final String
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 final String
static final String
Fields inherited from class org.apache.hadoop.hbase.client.AbstractRpcBasedConnectionRegistry
HEDGED_REQS_FANOUT_DEFAULT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate String
buildConnectionString
(org.apache.hadoop.conf.Configuration conf) protected CompletableFuture<Set<ServerName>>
private CompletableFuture<Set<ServerName>>
protected Set<ServerName>
getBootstrapNodes
(org.apache.hadoop.conf.Configuration conf) Return the connection string associated with this registry instance.private static Set<ServerName>
transformServerNames
(org.apache.hadoop.hbase.shaded.protobuf.generated.RegistryProtos.GetBootstrapNodesResponse resp) Methods inherited from class org.apache.hadoop.hbase.client.AbstractRpcBasedConnectionRegistry
call, close, getActiveMaster, getClusterId, getMetaRegionLocations, getParsedServers
-
Field Details
-
HEDGED_REQS_FANOUT_KEY
Configuration key that controls the fan out of requests- See Also:
-
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. So we should have a shorter delay for the initial refresh, to let users quickly switch to the bootstrap nodes we want them to connect to. The default value for initial refresh delay is 1/10 of periodic refresh interval.- See Also:
-
PERIODIC_REFRESH_INTERVAL_SECS
- See Also:
-
MIN_SECS_BETWEEN_REFRESHES
- See Also:
-
BOOTSTRAP_NODES
- See Also:
-
ADDRS_CONF_SEPARATOR
- See Also:
-
connectionString
-
-
Constructor Details
-
RpcConnectionRegistry
RpcConnectionRegistry(org.apache.hadoop.conf.Configuration conf, User user) throws IOException - Throws:
IOException
-
-
Method Details
-
buildConnectionString
private String buildConnectionString(org.apache.hadoop.conf.Configuration conf) throws UnknownHostException - Throws:
UnknownHostException
-
getBootstrapNodes
protected Set<ServerName> getBootstrapNodes(org.apache.hadoop.conf.Configuration conf) throws IOException - Specified by:
getBootstrapNodes
in classAbstractRpcBasedConnectionRegistry
- Throws:
IOException
-
getConnectionString
Description copied from interface:ConnectionRegistry
Return the connection string associated with this registry instance. This value is informational, used for annotating traces. Values returned may not be valid for establishing a working cluster connection. -
transformServerNames
private static Set<ServerName> transformServerNames(org.apache.hadoop.hbase.shaded.protobuf.generated.RegistryProtos.GetBootstrapNodesResponse resp) -
getBootstrapNodes
-
fetchEndpoints
- Specified by:
fetchEndpoints
in classAbstractRpcBasedConnectionRegistry
-