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/20501db3 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/20501db3 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/20501db3 Branch: refs/heads/4.x-HBase-1.1 Commit: 20501db35f8828e6ccf919efd802ffd454ab7cf3 Parents: 63147eb 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:09:06 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/20501db3/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/20501db3/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 4e8dd71..4606794 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 @@ -238,11 +238,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; @@ -250,14 +246,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); @@ -1226,7 +1220,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.") @@ -2400,7 +2394,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)