Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.1 21722db31 -> 170524e33
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/170524e3 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/170524e3 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/170524e3 Branch: refs/heads/4.x-HBase-1.1 Commit: 170524e333ecc5d7339a951f4381ca0ac1124002 Parents: 21722db Author: Ankit Singhal <ankitsingha...@gmail.com> Authored: Mon Feb 6 20:06:47 2017 +0530 Committer: Ankit Singhal <ankitsingha...@gmail.com> Committed: Mon Feb 6 20:06:47 2017 +0530 ---------------------------------------------------------------------- .../query/ConnectionQueryServicesImpl.java | 22 ++++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/170524e3/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 854fac5..7777b63 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;