saintstack commented on a change in pull request #287: HBASE-21512 Reimplement
sync client based on async client
URL: https://github.com/apache/hbase/pull/287#discussion_r291391113
##########
File path:
hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionFactory.java
##########
@@ -211,25 +212,22 @@ public static Connection createConnection(Configuration
conf, User user) throws
* @return Connection object for <code>conf</code>
*/
public static Connection createConnection(Configuration conf,
ExecutorService pool,
- final User user) throws IOException {
- String className = conf.get(ClusterConnection.HBASE_CLIENT_CONNECTION_IMPL,
- ConnectionImplementation.class.getName());
- Class<?> clazz;
- try {
- clazz = Class.forName(className);
- } catch (ClassNotFoundException e) {
- throw new IOException(e);
- }
- try {
- // Default HCM#HCI is not accessible; make it so before invoking.
- Constructor<?> constructor =
clazz.getDeclaredConstructor(Configuration.class,
- ExecutorService.class, User.class);
- constructor.setAccessible(true);
- return user.runAs(
- (PrivilegedExceptionAction<Connection>)() ->
- (Connection) constructor.newInstance(conf, pool, user));
- } catch (Exception e) {
- throw new IOException(e);
+ final User user) throws IOException {
+ Class<?> clazz =
conf.getClass(ConnectionUtils.HBASE_CLIENT_CONNECTION_IMPL,
+ ConnectionOverAsyncConnection.class, Connection.class);
Review comment:
At least the naming conention of '...OverAsync...' seems to be applied
consistently. Thats good.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services