PHOENIX-4088 Clean up SQLExceptionCode (Csaba Skrabak)
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/b6ca8b49 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/b6ca8b49 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/b6ca8b49 Branch: refs/heads/4.x-HBase-0.98 Commit: b6ca8b49dd0e8f95cf381bd6da5cce57e5f9f812 Parents: 16112c9 Author: Josh Elser <els...@apache.org> Authored: Thu Aug 17 12:52:29 2017 -0400 Committer: Josh Elser <els...@apache.org> Committed: Thu Aug 17 15:15:55 2017 -0400 ---------------------------------------------------------------------- .../apache/phoenix/exception/SQLExceptionCode.java | 16 +++++++++------- .../phoenix/query/ConnectionQueryServicesImpl.java | 10 ++-------- 2 files changed, 11 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/b6ca8b49/phoenix-core/src/main/java/org/apache/phoenix/exception/SQLExceptionCode.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/exception/SQLExceptionCode.java b/phoenix-core/src/main/java/org/apache/phoenix/exception/SQLExceptionCode.java index de45000..4744f69 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/exception/SQLExceptionCode.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/exception/SQLExceptionCode.java @@ -421,17 +421,19 @@ public enum SQLExceptionCode { public SQLException newException(SQLExceptionInfo info) { return new SchemaAlreadyExistsException(info.getSchemaName()); } - }), SCHEMA_NOT_FOUND(722, "43M05", "Schema does not exists", new Factory() { + }), + SCHEMA_NOT_FOUND(722, "43M05", "Schema does not exist", new Factory() { @Override public SQLException newException(SQLExceptionInfo info) { return new SchemaNotFoundException(info.getSchemaName()); } - }), CANNOT_MUTATE_SCHEMA(723, "43M06", "Cannot mutate schema as schema has existing tables"), SCHEMA_NOT_ALLOWED( - 724, "43M07", "Schema name not allowed!!"), CREATE_SCHEMA_NOT_ALLOWED(725, "43M08", - "Cannot create schema because config " + QueryServices.IS_NAMESPACE_MAPPING_ENABLED - + " for enabling name space mapping isn't enabled."), INCONSISTENET_NAMESPACE_MAPPING_PROPERTIES( - 726, "43M10", " Inconsistent namespace mapping properites.."), ASYNC_NOT_ALLOWED( - 727, "43M11", " ASYNC option is not allowed.. "), + }), + CANNOT_MUTATE_SCHEMA(723, "43M06", "Cannot mutate schema as schema has existing tables"), + SCHEMA_NOT_ALLOWED(724, "43M07", "Schema name not allowed!!"), + CREATE_SCHEMA_NOT_ALLOWED(725, "43M08", "Cannot create schema because config " + + QueryServices.IS_NAMESPACE_MAPPING_ENABLED + " for enabling name space mapping isn't enabled."), + INCONSISTENT_NAMESPACE_MAPPING_PROPERTIES(726, "43M10", " Inconsistent namespace mapping properties.."), + ASYNC_NOT_ALLOWED(727, "43M11", " ASYNC option is not allowed.. "), NEW_CONNECTION_THROTTLED(728, "410M1", "Could not create connection " + "because this client already has the maximum number" + " of connections to the target cluster."), http://git-wip-us.apache.org/repos/asf/phoenix/blob/b6ca8b49/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 68d92bf..f7cf522 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 @@ -239,11 +239,7 @@ import org.apache.phoenix.util.ReadOnlyProps; import org.apache.phoenix.util.SchemaUtil; import org.apache.phoenix.util.ServerUtil; import org.apache.phoenix.util.UpgradeUtil; -import org.apache.twill.discovery.ZKDiscoveryService; -import org.apache.twill.zookeeper.RetryStrategies; import org.apache.twill.zookeeper.ZKClientService; -import org.apache.twill.zookeeper.ZKClientServices; -import org.apache.twill.zookeeper.ZKClients; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -251,14 +247,12 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Joiner; import com.google.common.base.Preconditions; import com.google.common.base.Throwables; -import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -import com.google.common.util.concurrent.ThreadFactoryBuilder; public class ConnectionQueryServicesImpl extends DelegateQueryServices implements ConnectionQueryServices { private static final Logger logger = LoggerFactory.getLogger(ConnectionQueryServicesImpl.class); @@ -1228,7 +1222,7 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement } if (isTableNamespaceMappingEnabled != SchemaUtil.isNamespaceMappingEnabled(PTableType.TABLE, getProps())) { throw new SQLExceptionInfo.Builder( - SQLExceptionCode.INCONSISTENET_NAMESPACE_MAPPING_PROPERTIES) + SQLExceptionCode.INCONSISTENT_NAMESPACE_MAPPING_PROPERTIES) .setMessage( "Ensure that config " + QueryServices.IS_NAMESPACE_MAPPING_ENABLED + " is consitent on client and server.") @@ -2397,7 +2391,7 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement } ensureSystemTablesUpgraded(ConnectionQueryServicesImpl.this.getProps()); } else if (mappedSystemCatalogExists) { throw new SQLExceptionInfo.Builder( - SQLExceptionCode.INCONSISTENET_NAMESPACE_MAPPING_PROPERTIES) + SQLExceptionCode.INCONSISTENT_NAMESPACE_MAPPING_PROPERTIES) .setMessage("Cannot initiate connection as " + SchemaUtil.getPhysicalTableName( SYSTEM_CATALOG_NAME_BYTES, true)