Repository: phoenix Updated Branches: refs/heads/4.x-HBase-0.98 afdcca5cc -> c702b263d
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/c702b263 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/c702b263 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/c702b263 Branch: refs/heads/4.x-HBase-0.98 Commit: c702b263d789e99c1aa1d734e4e38bacdf9fa2c4 Parents: afdcca5 Author: Ankit Singhal <[email protected]> Authored: Mon Feb 6 20:13:33 2017 +0530 Committer: Ankit Singhal <[email protected]> Committed: Mon Feb 6 20:13:33 2017 +0530 ---------------------------------------------------------------------- .../query/ConnectionQueryServicesImpl.java | 22 ++++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/c702b263/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 831019d..b695e56 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 @@ -154,8 +154,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; @@ -2946,9 +2944,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); } @@ -2966,10 +2964,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()) { @@ -3037,14 +3035,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;
