Repository: phoenix
Updated Branches:
  refs/heads/4.8-HBase-1.2 23ffd4153 -> 691fc1734


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

Branch: refs/heads/4.8-HBase-1.2
Commit: 691fc17347faf21ceb3efa5b4b3f19cd74aa0d2a
Parents: 23ffd41
Author: Ankit Singhal <ankitsingha...@gmail.com>
Authored: Mon Feb 6 20:18:11 2017 +0530
Committer: Ankit Singhal <ankitsingha...@gmail.com>
Committed: Mon Feb 6 20:18:11 2017 +0530

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


http://git-wip-us.apache.org/repos/asf/phoenix/blob/691fc173/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 6e66071..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
@@ -1518,8 +1518,8 @@ public class ConnectionQueryServicesImpl extends 
DelegateQueryServices implement
                 dropTables(result.getTableNamesToDelete());
             }
             invalidateTables(result.getTableNamesToDelete());
-            long timestamp = MetaDataUtil.getClientTimeStamp(tableMetaData);
             if (tableType == PTableType.TABLE) {
+                long timestamp = 
MetaDataUtil.getClientTimeStamp(tableMetaData);
                 byte[] physicalName = table.getPhysicalName().getBytes();
                 ensureViewIndexTableDropped(physicalName, timestamp);
                 ensureLocalIndexTableDropped(physicalName, timestamp);
@@ -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