Repository: phoenix
Updated Branches:
  refs/heads/4.8-HBase-1.1 9d64bc3ee -> c9670f1dd


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/c9670f1d
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/c9670f1d
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/c9670f1d

Branch: refs/heads/4.8-HBase-1.1
Commit: c9670f1ddbc55fdacd391c50826689256b9dece8
Parents: 9d64bc3
Author: Ankit Singhal <ankitsingha...@gmail.com>
Authored: Mon Feb 6 20:21:19 2017 +0530
Committer: Ankit Singhal <ankitsingha...@gmail.com>
Committed: Mon Feb 6 20:21:19 2017 +0530

----------------------------------------------------------------------
 .../query/ConnectionQueryServicesImpl.java       | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/c9670f1d/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 208f826..09f841f 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
@@ -2733,9 +2733,8 @@ 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); }
@@ -2753,10 +2752,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()) {
@@ -2844,14 +2843,6 @@ public class ConnectionQueryServicesImpl extends 
DelegateQueryServices implement
         }
     }
 
-    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;

Reply via email to