diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionRegistryFactory.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionRegistryFactory.java index 5eef2c5f93e1..af4cf75af7fa 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionRegistryFactory.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionRegistryFactory.java @@ -39,7 +39,7 @@ final class ConnectionRegistryFactory { private static final Logger LOG = LoggerFactory.getLogger(ConnectionRegistryFactory.class); - private static final ImmutableMap CREATORS; + private static final ImmutableMap FACTORIES; static { ImmutableMap.Builder builder = ImmutableMap.builder(); for (ConnectionRegistryURIFactory factory : ServiceLoader @@ -47,7 +47,7 @@ final class ConnectionRegistryFactory { builder.put(factory.getScheme().toLowerCase(), factory); } // throw IllegalArgumentException if there are duplicated keys - CREATORS = builder.buildOrThrow(); + FACTORIES = builder.buildOrThrow(); } private ConnectionRegistryFactory() { @@ -69,12 +69,12 @@ static ConnectionRegistry create(URI uri, Configuration conf, User user) throws LOG.warn("No scheme specified for {}, fallback to use old way", uri); return create(conf, user); } - ConnectionRegistryURIFactory creator = CREATORS.get(uri.getScheme().toLowerCase()); - if (creator == null) { - LOG.warn("No creator registered for {}, fallback to use old way", uri); + ConnectionRegistryURIFactory factory = FACTORIES.get(uri.getScheme().toLowerCase()); + if (factory == null) { + LOG.warn("No factory registered for {}, fallback to use old way", uri); return create(conf, user); } - return creator.create(uri, conf, user); + return factory.create(uri, conf, user); } /** diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcConnectionRegistryCreator.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcConnectionRegistryURIFactory.java similarity index 93% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcConnectionRegistryCreator.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcConnectionRegistryURIFactory.java index cb2338b1429d..79081ee6c649 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcConnectionRegistryCreator.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcConnectionRegistryURIFactory.java @@ -29,9 +29,9 @@ * Connection registry creator implementation for creating {@link RpcConnectionRegistry}. */ @InterfaceAudience.Private -public class RpcConnectionRegistryCreator implements ConnectionRegistryURIFactory { +public class RpcConnectionRegistryURIFactory implements ConnectionRegistryURIFactory { - private static final Logger LOG = LoggerFactory.getLogger(RpcConnectionRegistryCreator.class); + private static final Logger LOG = LoggerFactory.getLogger(RpcConnectionRegistryURIFactory.class); @Override public ConnectionRegistry create(URI uri, Configuration conf, User user) throws IOException { diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ZKConnectionRegistryCreator.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ZKConnectionRegistryURIFactory.java similarity index 94% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/client/ZKConnectionRegistryCreator.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/ZKConnectionRegistryURIFactory.java index 8aa51e04fe4d..939adab23b78 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ZKConnectionRegistryCreator.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ZKConnectionRegistryURIFactory.java @@ -30,9 +30,9 @@ * Connection registry creator implementation for creating {@link ZKConnectionRegistry}. */ @InterfaceAudience.Private -public class ZKConnectionRegistryCreator implements ConnectionRegistryURIFactory { +public class ZKConnectionRegistryURIFactory implements ConnectionRegistryURIFactory { - private static final Logger LOG = LoggerFactory.getLogger(ZKConnectionRegistryCreator.class); + private static final Logger LOG = LoggerFactory.getLogger(ZKConnectionRegistryURIFactory.class); @Override public ConnectionRegistry create(URI uri, Configuration conf, User user) throws IOException { diff --git a/hbase-client/src/main/resources/META-INF/services/org.apache.hadoop.hbase.client.ConnectionRegistryURIFactory b/hbase-client/src/main/resources/META-INF/services/org.apache.hadoop.hbase.client.ConnectionRegistryURIFactory index b25a569776f1..229119c6635a 100644 --- a/hbase-client/src/main/resources/META-INF/services/org.apache.hadoop.hbase.client.ConnectionRegistryURIFactory +++ b/hbase-client/src/main/resources/META-INF/services/org.apache.hadoop.hbase.client.ConnectionRegistryURIFactory @@ -13,5 +13,5 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -org.apache.hadoop.hbase.client.RpcConnectionRegistryCreator -org.apache.hadoop.hbase.client.ZKConnectionRegistryCreator \ No newline at end of file +org.apache.hadoop.hbase.client.RpcConnectionRegistryURIFactory +org.apache.hadoop.hbase.client.ZKConnectionRegistryURIFactory \ No newline at end of file diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestConnectionRegistryCreatorUriParsing.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestConnectionRegistryUriParsing.java similarity index 97% rename from hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestConnectionRegistryCreatorUriParsing.java rename to hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestConnectionRegistryUriParsing.java index 4dabd894b5b4..c841346e810e 100644 --- a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestConnectionRegistryCreatorUriParsing.java +++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestConnectionRegistryUriParsing.java @@ -46,11 +46,11 @@ * Make sure we can successfully parse the URI component */ @Category({ ClientTests.class, SmallTests.class }) -public class TestConnectionRegistryCreatorUriParsing { +public class TestConnectionRegistryUriParsing { @ClassRule public static final HBaseClassTestRule CLASS_RULE = - HBaseClassTestRule.forClass(TestConnectionRegistryCreatorUriParsing.class); + HBaseClassTestRule.forClass(TestConnectionRegistryUriParsing.class); private Configuration conf;