hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-13664 Use HBase 1.0 interfaces in ConnectionCache (Solomon Duskis)
Date Tue, 12 May 2015 20:30:48 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 8e8e24624 -> e42e7ed11


HBASE-13664 Use HBase 1.0 interfaces in ConnectionCache (Solomon Duskis)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/e42e7ed1
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/e42e7ed1
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/e42e7ed1

Branch: refs/heads/branch-1
Commit: e42e7ed110f2fafad7baafcddd21e83961a60272
Parents: 8e8e246
Author: tedyu <yuzhihong@gmail.com>
Authored: Tue May 12 13:31:43 2015 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Tue May 12 13:31:43 2015 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/util/ConnectionCache.java   | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/e42e7ed1/hbase-server/src/main/java/org/apache/hadoop/hbase/util/ConnectionCache.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/ConnectionCache.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/ConnectionCache.java
index 7179c0d..89e44bd 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/ConnectionCache.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/ConnectionCache.java
@@ -30,10 +30,10 @@ import org.apache.hadoop.hbase.Stoppable;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.Admin;
-import org.apache.hadoop.hbase.client.HConnection;
-import org.apache.hadoop.hbase.client.HConnectionManager;
-import org.apache.hadoop.hbase.client.HTableInterface;
+import org.apache.hadoop.hbase.client.Connection;
+import org.apache.hadoop.hbase.client.ConnectionFactory;
 import org.apache.hadoop.hbase.client.RegionLocator;
+import org.apache.hadoop.hbase.client.Table;
 import org.apache.hadoop.hbase.security.User;
 import org.apache.hadoop.hbase.security.UserProvider;
 import org.apache.hadoop.security.UserGroupInformation;
@@ -147,9 +147,9 @@ public class ConnectionCache {
   /**
    * Caller closes the table afterwards.
    */
-  public HTableInterface getTable(String tableName) throws IOException {
+  public Table getTable(String tableName) throws IOException {
     ConnectionInfo connInfo = getCurrentConnection();
-    return connInfo.connection.getTable(tableName);
+    return connInfo.connection.getTable(TableName.valueOf(tableName));
   }
 
   /**
@@ -176,7 +176,7 @@ public class ConnectionCache {
             ugi = UserGroupInformation.createProxyUser(userName, realUser);
           }
           User user = userProvider.create(ugi);
-          HConnection conn = HConnectionManager.createConnection(conf, user);
+          Connection conn = ConnectionFactory.createConnection(conf, user);
           connInfo = new ConnectionInfo(conn, userName);
           connections.put(userName, connInfo);
         }
@@ -188,14 +188,14 @@ public class ConnectionCache {
   }
 
   class ConnectionInfo {
-    final HConnection connection;
+    final Connection connection;
     final String userName;
 
     volatile Admin admin;
     private long lastAccessTime;
     private boolean closed;
 
-    ConnectionInfo(HConnection conn, String user) {
+    ConnectionInfo(Connection conn, String user) {
       lastAccessTime = EnvironmentEdgeManager.currentTime();
       connection = conn;
       closed = false;


Mime
View raw message