PHOENIX-4759 During restart RS that hosts SYSTEM.CATALOG table may get stuck


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/9ccc32dd
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/9ccc32dd
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/9ccc32dd

Branch: refs/heads/4.x-HBase-1.1
Commit: 9ccc32dd03b77fa4fc7ed177f5e3eb326bc5b6b3
Parents: e71e767
Author: Sergey Soldatov <s...@apache.org>
Authored: Thu May 31 12:07:29 2018 -0700
Committer: ss77892 <s...@apache.org>
Committed: Thu May 31 12:48:12 2018 -0700

----------------------------------------------------------------------
 .../phoenix/coprocessor/MetaDataEndpointImpl.java  |  6 +++---
 .../phoenix/coprocessor/MetaDataProtocol.java      | 16 +++++++++++++++-
 .../apache/phoenix/exception/SQLExceptionCode.java |  6 +++---
 .../index/write/ParallelWriterIndexCommitter.java  |  4 ++--
 .../TrackingParallelWriterIndexCommitter.java      |  4 ++--
 .../phoenix/index/PhoenixTransactionalIndexer.java |  4 ++--
 .../phoenix/jdbc/PhoenixDatabaseMetaData.java      | 17 +----------------
 .../phoenix/query/ConnectionQueryServicesImpl.java |  4 ++--
 .../org/apache/phoenix/schema/MetaDataClient.java  |  4 ++--
 .../java/org/apache/phoenix/util/ScanUtil.java     |  3 +--
 10 files changed, 33 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/9ccc32dd/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
index b751d6f..0e84465 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
@@ -919,12 +919,12 @@ public class MetaDataEndpointImpl extends 
MetaDataProtocol implements Coprocesso
                         .getValueArray()[indexStateKv.getValueOffset()]);
         // If client is not yet up to 4.12, then translate PENDING_ACTIVE to 
ACTIVE (as would have been
         // the value in those versions) since the client won't have this index 
state in its enum.
-        if (indexState == PIndexState.PENDING_ACTIVE && clientVersion < 
PhoenixDatabaseMetaData.MIN_PENDING_ACTIVE_INDEX) {
+        if (indexState == PIndexState.PENDING_ACTIVE && clientVersion < 
MetaDataProtocol.MIN_PENDING_ACTIVE_INDEX) {
             indexState = PIndexState.ACTIVE;
         }
         // If client is not yet up to 4.14, then translate PENDING_DISABLE to 
DISABLE
         // since the client won't have this index state in its enum.
-        if (indexState == PIndexState.PENDING_DISABLE && clientVersion < 
PhoenixDatabaseMetaData.MIN_PENDING_DISABLE_INDEX) {
+        if (indexState == PIndexState.PENDING_DISABLE && clientVersion < 
MetaDataProtocol.MIN_PENDING_DISABLE_INDEX) {
             // note: for older clients, we have to rely on the rebuilder to 
transition PENDING_DISABLE -> DISABLE
             indexState = PIndexState.DISABLE;
         }
@@ -3547,7 +3547,7 @@ public class MetaDataEndpointImpl extends 
MetaDataProtocol implements Coprocesso
         boolean isTablesMappingEnabled = 
SchemaUtil.isNamespaceMappingEnabled(PTableType.TABLE,
                 new ReadOnlyProps(config.iterator()));
         if (isTablesMappingEnabled
-                && 
PhoenixDatabaseMetaData.MIN_NAMESPACE_MAPPED_PHOENIX_VERSION > 
request.getClientVersion()) {
+                && MetaDataProtocol.MIN_NAMESPACE_MAPPED_PHOENIX_VERSION > 
request.getClientVersion()) {
             logger.error("Old client is not compatible when" + " system tables 
are upgraded to map to namespace");
             ProtobufUtil.setControllerException(controller,
                     ServerUtil.createIOException(

http://git-wip-us.apache.org/repos/asf/phoenix/blob/9ccc32dd/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataProtocol.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataProtocol.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataProtocol.java
index 62b701d..883f96d 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataProtocol.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataProtocol.java
@@ -93,7 +93,21 @@ public abstract class MetaDataProtocol extends 
MetaDataService {
     public static final long MIN_SYSTEM_TABLE_TIMESTAMP_4_14_0 = 
MIN_TABLE_TIMESTAMP + 28;
     // MIN_SYSTEM_TABLE_TIMESTAMP needs to be set to the max of all the 
MIN_SYSTEM_TABLE_TIMESTAMP_* constants
     public static final long MIN_SYSTEM_TABLE_TIMESTAMP = 
MIN_SYSTEM_TABLE_TIMESTAMP_4_14_0;
-    
+    // Version below which we should disallow usage of mutable secondary 
indexing.
+    public static final int MUTABLE_SI_VERSION_THRESHOLD = 
VersionUtil.encodeVersion("0", "94", "10");
+    public static final int MAX_LOCAL_SI_VERSION_DISALLOW = 
VersionUtil.encodeVersion("0", "98", "8");
+    public static final int MIN_LOCAL_SI_VERSION_DISALLOW = 
VersionUtil.encodeVersion("0", "98", "6");
+    public static final int MIN_RENEW_LEASE_VERSION = 
VersionUtil.encodeVersion("1", "1", "3");
+    public static final int MIN_NAMESPACE_MAPPED_PHOENIX_VERSION = 
VersionUtil.encodeVersion("4", "8", "0");
+    public static final int MIN_PENDING_ACTIVE_INDEX = 
VersionUtil.encodeVersion("4", "12", "0");
+    public static final int MIN_CLIENT_RETRY_INDEX_WRITES = 
VersionUtil.encodeVersion("4", "14", "0");
+    public static final int MIN_TX_CLIENT_SIDE_MAINTENANCE = 
VersionUtil.encodeVersion("4", "14", "0");
+    public static final int MIN_PENDING_DISABLE_INDEX = 
VersionUtil.encodeVersion("4", "14", "0");
+    // Version below which we should turn off essential column family.
+    public static final int ESSENTIAL_FAMILY_VERSION_THRESHOLD = 
VersionUtil.encodeVersion("0", "94", "7");
+    /** Version below which we fall back on the generic KeyValueBuilder */
+    public static final int CLIENT_KEY_VALUE_BUILDER_THRESHOLD = 
VersionUtil.encodeVersion("0", "94", "14");
+
     // ALWAYS update this map whenever rolling out a new release (major, minor 
or patch release). 
     // Key is the SYSTEM.CATALOG timestamp for the version and value is the 
version string.
     private static final NavigableMap<Long, String> TIMESTAMP_VERSION_MAP = 
new TreeMap<>();

http://git-wip-us.apache.org/repos/asf/phoenix/blob/9ccc32dd/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 cb258cc..ea6b868 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
@@ -21,8 +21,8 @@ import java.sql.SQLException;
 import java.sql.SQLTimeoutException;
 import java.util.Map;
 
+import org.apache.phoenix.coprocessor.MetaDataProtocol;
 import org.apache.phoenix.hbase.index.util.IndexManagementUtil;
-import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.query.QueryConstants;
 import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.schema.AmbiguousColumnException;
@@ -242,7 +242,7 @@ public enum SQLExceptionCode {
     SALT_ONLY_ON_CREATE_TABLE(1024, "42Y82", "Salt bucket number may only be 
specified when creating a table."),
     SET_UNSUPPORTED_PROP_ON_ALTER_TABLE(1025, "42Y83", "Unsupported property 
set in ALTER TABLE command."),
     CANNOT_ADD_NOT_NULLABLE_COLUMN(1038, "42Y84", "Only nullable columns may 
be added for a pre-existing table."),
-    NO_MUTABLE_INDEXES(1026, "42Y85", "Mutable secondary indexes are only 
supported for HBase version " + 
MetaDataUtil.decodeHBaseVersionAsString(PhoenixDatabaseMetaData.MUTABLE_SI_VERSION_THRESHOLD)
 + " and above."),
+    NO_MUTABLE_INDEXES(1026, "42Y85", "Mutable secondary indexes are only 
supported for HBase version " + 
MetaDataUtil.decodeHBaseVersionAsString(MetaDataProtocol.MUTABLE_SI_VERSION_THRESHOLD)
 + " and above."),
     INVALID_INDEX_STATE_TRANSITION(1028, "42Y87", "Invalid index state 
transition."),
     INVALID_MUTABLE_INDEX_CONFIG(1029, "42Y88", "Mutable secondary indexes 
must have the "
             + IndexManagementUtil.WAL_EDIT_CODEC_CLASS_KEY + " property set to 
"
@@ -265,7 +265,7 @@ public enum SQLExceptionCode {
     CANNOT_SET_TABLE_PROPERTY_ADD_COLUMN(1053, "43A10", "Table level property 
cannot be set when adding a column."),
 
     NO_LOCAL_INDEXES(1054, "43A11", "Local secondary indexes are not supported 
for HBase versions " +
-        
MetaDataUtil.decodeHBaseVersionAsString(PhoenixDatabaseMetaData.MIN_LOCAL_SI_VERSION_DISALLOW)
 + " through " + 
MetaDataUtil.decodeHBaseVersionAsString(PhoenixDatabaseMetaData.MAX_LOCAL_SI_VERSION_DISALLOW)
 + " inclusive."),
+        
MetaDataUtil.decodeHBaseVersionAsString(MetaDataProtocol.MIN_LOCAL_SI_VERSION_DISALLOW)
 + " through " + 
MetaDataUtil.decodeHBaseVersionAsString(MetaDataProtocol.MAX_LOCAL_SI_VERSION_DISALLOW)
 + " inclusive."),
     UNALLOWED_LOCAL_INDEXES(1055, "43A12", "Local secondary indexes are 
configured to not be allowed."),
     
     DESC_VARBINARY_NOT_SUPPORTED(1056, "43A13", "Descending VARBINARY columns 
not supported."),

http://git-wip-us.apache.org/repos/asf/phoenix/blob/9ccc32dd/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/ParallelWriterIndexCommitter.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/ParallelWriterIndexCommitter.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/ParallelWriterIndexCommitter.java
index 6eb3875..febcbd0 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/ParallelWriterIndexCommitter.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/ParallelWriterIndexCommitter.java
@@ -25,6 +25,7 @@ import org.apache.hadoop.hbase.Stoppable;
 import org.apache.hadoop.hbase.client.HTableInterface;
 import org.apache.hadoop.hbase.client.Mutation;
 import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
+import org.apache.phoenix.coprocessor.MetaDataProtocol;
 import 
org.apache.phoenix.hbase.index.exception.SingleIndexWriteFailureException;
 import org.apache.phoenix.hbase.index.parallel.EarlyExitFailure;
 import org.apache.phoenix.hbase.index.parallel.QuickFailingTaskRunner;
@@ -36,7 +37,6 @@ import org.apache.phoenix.hbase.index.table.HTableFactory;
 import org.apache.phoenix.hbase.index.table.HTableInterfaceReference;
 import org.apache.phoenix.hbase.index.util.KeyValueBuilder;
 import org.apache.phoenix.index.PhoenixIndexFailurePolicy;
-import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.util.IndexUtil;
 
 import com.google.common.collect.Multimap;
@@ -165,7 +165,7 @@ public class ParallelWriterIndexCommitter implements 
IndexCommitter {
                             }
                         }
                      // if the client can retry index writes, then we don't 
need to retry here
-                        HTableFactory factory = clientVersion < 
PhoenixDatabaseMetaData.MIN_CLIENT_RETRY_INDEX_WRITES ? retryingFactory : 
noRetriesfactory;
+                        HTableFactory factory = clientVersion < 
MetaDataProtocol.MIN_CLIENT_RETRY_INDEX_WRITES ? retryingFactory : 
noRetriesfactory;
                         table = factory.getTable(tableReference.get());
                         throwFailureIfDone();
                         table.batch(mutations);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/9ccc32dd/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/TrackingParallelWriterIndexCommitter.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/TrackingParallelWriterIndexCommitter.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/TrackingParallelWriterIndexCommitter.java
index ae099d2..6a138df 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/TrackingParallelWriterIndexCommitter.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/TrackingParallelWriterIndexCommitter.java
@@ -27,6 +27,7 @@ import org.apache.hadoop.hbase.Stoppable;
 import org.apache.hadoop.hbase.client.HTableInterface;
 import org.apache.hadoop.hbase.client.Mutation;
 import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
+import org.apache.phoenix.coprocessor.MetaDataProtocol;
 import org.apache.phoenix.hbase.index.CapturingAbortable;
 import 
org.apache.phoenix.hbase.index.exception.MultiIndexWriteFailureException;
 import 
org.apache.phoenix.hbase.index.exception.SingleIndexWriteFailureException;
@@ -41,7 +42,6 @@ import org.apache.phoenix.hbase.index.table.HTableFactory;
 import org.apache.phoenix.hbase.index.table.HTableInterfaceReference;
 import org.apache.phoenix.hbase.index.util.KeyValueBuilder;
 import org.apache.phoenix.index.PhoenixIndexFailurePolicy;
-import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.util.IndexUtil;
 
 import com.google.common.collect.Multimap;
@@ -177,7 +177,7 @@ public class TrackingParallelWriterIndexCommitter 
implements IndexCommitter {
                             LOG.trace("Writing index update:" + mutations + " 
to table: " + tableReference);
                         }
                         // if the client can retry index writes, then we don't 
need to retry here
-                        HTableFactory factory = clientVersion < 
PhoenixDatabaseMetaData.MIN_CLIENT_RETRY_INDEX_WRITES ? retryingFactory : 
noRetriesFactory;
+                        HTableFactory factory = clientVersion < 
MetaDataProtocol.MIN_CLIENT_RETRY_INDEX_WRITES ? retryingFactory : 
noRetriesFactory;
                         table = factory.getTable(tableReference.get());
                         throwFailureIfDone();
                         table.batch(mutations);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/9ccc32dd/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixTransactionalIndexer.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixTransactionalIndexer.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixTransactionalIndexer.java
index 0893bf6..189102d 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixTransactionalIndexer.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixTransactionalIndexer.java
@@ -45,11 +45,11 @@ import org.apache.htrace.Span;
 import org.apache.htrace.Trace;
 import org.apache.htrace.TraceScope;
 import org.apache.phoenix.coprocessor.DelegateRegionCoprocessorEnvironment;
+import org.apache.phoenix.coprocessor.MetaDataProtocol;
 import org.apache.phoenix.execute.PhoenixTxIndexMutationGenerator;
 import org.apache.phoenix.hbase.index.write.IndexWriter;
 import org.apache.phoenix.hbase.index.write.LeaveIndexActiveFailurePolicy;
 import org.apache.phoenix.hbase.index.write.ParallelWriterIndexCommitter;
-import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.trace.TracingUtils;
 import org.apache.phoenix.trace.util.NullSpan;
 import org.apache.phoenix.transaction.PhoenixTransactionContext;
@@ -141,7 +141,7 @@ public class PhoenixTransactionalIndexer extends 
BaseRegionObserver {
         }
 
         PhoenixIndexMetaData indexMetaData = new 
PhoenixIndexMetaDataBuilder(c.getEnvironment()).getIndexMetaData(miniBatchOp);
-        if (    indexMetaData.getClientVersion() >= 
PhoenixDatabaseMetaData.MIN_TX_CLIENT_SIDE_MAINTENANCE
+        if (    indexMetaData.getClientVersion() >= 
MetaDataProtocol.MIN_TX_CLIENT_SIDE_MAINTENANCE
             && !indexMetaData.hasLocalIndexes()) { // Still generate index 
updates server side for local indexes
             super.preBatchMutate(c, miniBatchOp);
             return;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/9ccc32dd/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixDatabaseMetaData.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixDatabaseMetaData.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixDatabaseMetaData.java
index 2e12ca2..5bcd286 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixDatabaseMetaData.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixDatabaseMetaData.java
@@ -325,22 +325,7 @@ public class PhoenixDatabaseMetaData implements 
DatabaseMetaData {
     
     private final PhoenixConnection connection;
     private final ResultSet emptyResultSet;
-    public static final int MAX_LOCAL_SI_VERSION_DISALLOW = 
VersionUtil.encodeVersion("0", "98", "8");
-    public static final int MIN_LOCAL_SI_VERSION_DISALLOW = 
VersionUtil.encodeVersion("0", "98", "6");
-    public static final int MIN_RENEW_LEASE_VERSION = 
VersionUtil.encodeVersion("1", "1", "3");
-    public static final int MIN_NAMESPACE_MAPPED_PHOENIX_VERSION = 
VersionUtil.encodeVersion("4", "8", "0");
-    public static final int MIN_PENDING_ACTIVE_INDEX = 
VersionUtil.encodeVersion("4", "12", "0");
-    public static final int MIN_PENDING_DISABLE_INDEX = 
VersionUtil.encodeVersion("4", "14", "0");
-    public static final int MIN_CLIENT_RETRY_INDEX_WRITES = 
VersionUtil.encodeVersion("4", "14", "0");
-    public static final int MIN_TX_CLIENT_SIDE_MAINTENANCE = 
VersionUtil.encodeVersion("4", "14", "0");
-    
-    // Version below which we should turn off essential column family.
-    public static final int ESSENTIAL_FAMILY_VERSION_THRESHOLD = 
VersionUtil.encodeVersion("0", "94", "7");
-    // Version below which we should disallow usage of mutable secondary 
indexing.
-    public static final int MUTABLE_SI_VERSION_THRESHOLD = 
VersionUtil.encodeVersion("0", "94", "10");
-    /** Version below which we fall back on the generic KeyValueBuilder */
-    public static final int CLIENT_KEY_VALUE_BUILDER_THRESHOLD = 
VersionUtil.encodeVersion("0", "94", "14");
-    
+
     public static final String IMMUTABLE_STORAGE_SCHEME = 
"IMMUTABLE_STORAGE_SCHEME";
     public static final byte[] STORAGE_SCHEME_BYTES = 
Bytes.toBytes(IMMUTABLE_STORAGE_SCHEME);
     public static final String ENCODING_SCHEME = "ENCODING_SCHEME";

http://git-wip-us.apache.org/repos/asf/phoenix/blob/9ccc32dd/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 a3e27a5..9a5de26 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
@@ -335,14 +335,14 @@ public class ConnectionQueryServicesImpl extends 
DelegateQueryServices implement
                 @Override
                 public boolean isSupported(ConnectionQueryServices services) {
                     int hbaseVersion = services.getLowestClusterHBaseVersion();
-                    return hbaseVersion < 
PhoenixDatabaseMetaData.MIN_LOCAL_SI_VERSION_DISALLOW || hbaseVersion > 
PhoenixDatabaseMetaData.MAX_LOCAL_SI_VERSION_DISALLOW;
+                    return hbaseVersion < 
MetaDataProtocol.MIN_LOCAL_SI_VERSION_DISALLOW || hbaseVersion > 
MetaDataProtocol.MAX_LOCAL_SI_VERSION_DISALLOW;
                 }
             },
             Feature.RENEW_LEASE, new FeatureSupported() {
                 @Override
                 public boolean isSupported(ConnectionQueryServices services) {
                     int hbaseVersion = services.getLowestClusterHBaseVersion();
-                    return hbaseVersion >= 
PhoenixDatabaseMetaData.MIN_RENEW_LEASE_VERSION;
+                    return hbaseVersion >= 
MetaDataProtocol.MIN_RENEW_LEASE_VERSION;
                 }
             });
     private QueryLoggerDisruptor queryDisruptor;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/9ccc32dd/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
index 31fc6dc..0d1137f 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
@@ -1511,7 +1511,7 @@ public class MetaDataClient {
                     }
                 }
                 if (!dataTable.isImmutableRows()) {
-                    if (hbaseVersion < 
PhoenixDatabaseMetaData.MUTABLE_SI_VERSION_THRESHOLD) {
+                    if (hbaseVersion < 
MetaDataProtocol.MUTABLE_SI_VERSION_THRESHOLD) {
                         throw new 
SQLExceptionInfo.Builder(SQLExceptionCode.NO_MUTABLE_INDEXES).setTableName(indexTableName.getTableName()).build().buildException();
                     }
                     if (!connection.getQueryServices().hasIndexWALCodec() && 
!dataTable.isTransactional()) {
@@ -3415,7 +3415,7 @@ public class MetaDataClient {
                     // have existing indexes.
                     if 
(Boolean.FALSE.equals(metaPropertiesEvaluated.getIsImmutableRows()) && 
!table.getIndexes().isEmpty()) {
                         int hbaseVersion = 
connection.getQueryServices().getLowestClusterHBaseVersion();
-                        if (hbaseVersion < 
PhoenixDatabaseMetaData.MUTABLE_SI_VERSION_THRESHOLD) {
+                        if (hbaseVersion < 
MetaDataProtocol.MUTABLE_SI_VERSION_THRESHOLD) {
                             throw new 
SQLExceptionInfo.Builder(SQLExceptionCode.NO_MUTABLE_INDEXES)
                             
.setSchemaName(schemaName).setTableName(tableName).build().buildException();
                         }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/9ccc32dd/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
index 996e1dc..62ecebd 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
@@ -60,7 +60,6 @@ import 
org.apache.phoenix.filter.MultiEncodedCQKeyValueComparisonFilter;
 import org.apache.phoenix.filter.SkipScanFilter;
 import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr;
 import org.apache.phoenix.hbase.index.util.VersionUtil;
-import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.query.KeyRange;
 import org.apache.phoenix.query.KeyRange.Bound;
 import org.apache.phoenix.query.QueryConstants;
@@ -895,7 +894,7 @@ public class ScanUtil {
      *         the server side. To make sure HBase doesn't cancel the leases 
and close the open
      *         scanners, we need to periodically renew leases. To look at the 
earliest HBase version
      *         that supports renewing leases, see
-     *         {@link PhoenixDatabaseMetaData#MIN_RENEW_LEASE_VERSION}
+     *         {@link MetaDataProtocol#MIN_RENEW_LEASE_VERSION}
      */
     public static boolean isPacingScannersPossible(StatementContext context) {
         return 
context.getConnection().getQueryServices().isRenewingLeasesEnabled();

Reply via email to