Package org.apache.hadoop.hbase.client
Class ConnectionRegistryFactory
java.lang.Object
org.apache.hadoop.hbase.client.ConnectionRegistryFactory
The entry point for creating a
ConnectionRegistry.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.apache.hbase.thirdparty.com.google.common.collect.ImmutableMap<String,ConnectionRegistryURIFactory> private static final org.slf4j.Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static ConnectionRegistryReturns the connection registry implementation to use, for the given connection urluri.(package private) static ConnectionRegistryReturns the connection registry implementation to use.static URItryParseAsConnectionURI(String clusterKey) static voidCheck whether the givenuriis valid.
-
Field Details
-
LOG
-
FACTORIES
private static final org.apache.hbase.thirdparty.com.google.common.collect.ImmutableMap<String,ConnectionRegistryURIFactory> FACTORIES
-
-
Constructor Details
-
ConnectionRegistryFactory
private ConnectionRegistryFactory()
-
-
Method Details
-
create
static ConnectionRegistry create(URI uri, org.apache.hadoop.conf.Configuration conf, User user) throws IOException Returns the connection registry implementation to use, for the given connection urluri. We useServiceLoaderto load different implementations, and use the scheme of the givenurito select. And if there is no protocol specified, or we can not find aConnectionRegistryURIFactoryimplementation for the given scheme, we will fallback to use the old way to create theConnectionRegistry. Notice that, if fallback happens, the specified connection urluriwill not take effect, we will load all the related configurations from the given Configuration instanceconf- Throws:
IOException
-
create
Returns the connection registry implementation to use. This is used when we do not have a connection url, we will use the old way to load the connection registry, by checking the HConstants#CLIENT_CONNECTION_REGISTRY_IMPL_CONF_KEY configuration. -
validate
Check whether the givenuriis valid. Notice that there is no fallback logic for this method, so passing an URI with null scheme can not pass.- Throws:
IOException- if this is not a valid connection registry URI
-
tryParseAsConnectionURI
If the givenclusterKeycan be parsed to aURI, and the scheme of theURIis supported by us, return theURI, otherwise returnnull.- Parameters:
clusterKey- the cluster key, typically from replication peer config- Returns:
- a
URIornull.
-