Repository: phoenix
Updated Branches:
  refs/heads/4.8-HBase-0.98 0d593d1f1 -> f63aa5e57


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

Branch: refs/heads/4.8-HBase-0.98
Commit: f63aa5e5740309c96af01dbe7435c56d86401333
Parents: 0d593d1
Author: Ankit Singhal <ankitsingha...@gmail.com>
Authored: Mon Feb 6 20:26:58 2017 +0530
Committer: Ankit Singhal <ankitsingha...@gmail.com>
Committed: Mon Feb 6 20:26:58 2017 +0530

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


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f63aa5e5/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 4436f9b..0acbcde 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
@@ -2730,9 +2730,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); }
@@ -2750,10 +2749,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()) {
@@ -2841,14 +2840,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