You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by an...@apache.org on 2017/02/06 14:36:27 UTC

phoenix git commit: PHOENIX-3652 Users who do not have global access to hbase cluster can't connect to phoenix

Repository: phoenix
Updated Branches:
  refs/heads/master ad113c835 -> 54ddb916e


PHOENIX-3652 Users who do not have global access to hbase cluster can't connect to phoenix


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

Branch: refs/heads/master
Commit: 54ddb916ee1a6cc1b412aa28221b1d2770fb814b
Parents: ad113c8
Author: Ankit Singhal <an...@gmail.com>
Authored: Mon Feb 6 20:06:19 2017 +0530
Committer: Ankit Singhal <an...@gmail.com>
Committed: Mon Feb 6 20:06:19 2017 +0530

----------------------------------------------------------------------
 .../query/ConnectionQueryServicesImpl.java      | 22 ++++++--------------
 1 file changed, 6 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/54ddb916/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
index f2eb8e4..70c0575 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
@@ -153,8 +153,6 @@ import org.apache.phoenix.iterate.TableResultIterator.RenewLeaseStatus;
 import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.ConnectionInfo;
-import org.apache.phoenix.monitoring.GlobalClientMetrics;
-import org.apache.phoenix.monitoring.GlobalMetric;
 import org.apache.phoenix.parse.PFunction;
 import org.apache.phoenix.parse.PSchema;
 import org.apache.phoenix.protobuf.ProtobufUtil;
@@ -2948,9 +2946,9 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement
         HTableInterface metatable = null;
         try (HBaseAdmin admin = getAdmin()) {
             ensureNamespaceCreated(QueryConstants.SYSTEM_SCHEMA_NAME);
-            List<HTableDescriptor> tables = Arrays
-                    .asList(admin.listTables(QueryConstants.SYSTEM_SCHEMA_NAME + "\\..*"));
-            List<String> tableNames = getTableNames(tables);
+            
+             List<TableName> tableNames = Arrays
+                    .asList(admin.listTableNames(QueryConstants.SYSTEM_SCHEMA_NAME + "\\..*"));
             if (tableNames.size() == 0) { return; }
             if (tableNames.size() > 4) { throw new IllegalArgumentException(
                     "Expected 4 system table only but found " + tableNames.size() + ":" + tableNames); }
@@ -2968,10 +2966,10 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement
                 }
                 tableNames.remove(PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME);
             }
-            for (String table : tableNames) {
-                UpgradeUtil.mapTableToNamespace(admin, metatable, table, props, null, PTableType.SYSTEM,
+            for (TableName table : tableNames) {
+                UpgradeUtil.mapTableToNamespace(admin, metatable, table.getNameAsString(), props, null, PTableType.SYSTEM,
                         null);
-                ConnectionQueryServicesImpl.this.removeTable(null, table, null,
+                ConnectionQueryServicesImpl.this.removeTable(null, table.getNameAsString(), null,
                         MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP_4_1_0);
             }
             if (!tableNames.isEmpty()) {
@@ -3039,14 +3037,6 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement
         return released;
     }
 
-    private List<String> getTableNames(List<HTableDescriptor> tables) {
-        List<String> tableNames = new ArrayList<String>(4);
-        for (HTableDescriptor desc : tables) {
-            tableNames.add(desc.getNameAsString());
-        }
-        return tableNames;
-    }
-
     private String addColumn(String columnsToAddSoFar, String columns) {
         if (columnsToAddSoFar == null || columnsToAddSoFar.isEmpty()) {
             return columns;