[phoenix-connectors] branch 4.14-HBase-1.4 updated: Add hadoop-hdfs tests jar

2019-01-17 Thread vincentpoon
This is an automated email from the ASF dual-hosted git repository.

vincentpoon pushed a commit to branch 4.14-HBase-1.4
in repository https://gitbox.apache.org/repos/asf/phoenix-connectors.git


The following commit(s) were added to refs/heads/4.14-HBase-1.4 by this push:
 new 83ce33f  Add hadoop-hdfs tests jar
83ce33f is described below

commit 83ce33f09c1b8bc2d597e6ae88ffd2291e3ca8cf
Author: Vincent Poon 
AuthorDate: Thu Jan 17 17:59:40 2019 -0800

Add hadoop-hdfs tests jar
---
 presto-phoenix-shaded/pom.xml |  3 ++-
 .../presto-hbase-testing-util-shaded/pom.xml  | 15 ++-
 .../presto-phoenix-client-shaded/pom.xml  |  4 ++--
 3 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/presto-phoenix-shaded/pom.xml b/presto-phoenix-shaded/pom.xml
index 895b172..7f33fb4 100644
--- a/presto-phoenix-shaded/pom.xml
+++ b/presto-phoenix-shaded/pom.xml
@@ -12,7 +12,7 @@
 Presto Apache Phoenix Shaded
 Shaded version of Apache Phoenix for Presto
 presto-phoenix-shaded
-4.14.1-HBase-1.4-PPS-0.1
+4.14.1-HBase-1.4-PPS-0.2
 pom
 
 
@@ -24,6 +24,7 @@
 
 
 
+4.14.1-HBase-1.4
 
 true
 org.apache.phoenix.shaded
diff --git a/presto-phoenix-shaded/presto-hbase-testing-util-shaded/pom.xml 
b/presto-phoenix-shaded/presto-hbase-testing-util-shaded/pom.xml
index 998fcaf..097efc7 100644
--- a/presto-phoenix-shaded/presto-hbase-testing-util-shaded/pom.xml
+++ b/presto-phoenix-shaded/presto-hbase-testing-util-shaded/pom.xml
@@ -5,7 +5,7 @@
 
 org.apache.phoenix
 presto-phoenix-shaded
-4.14.1-HBase-1.4-PPS-0.1
+4.14.1-HBase-1.4-PPS-0.2
 ..
 
 
@@ -101,6 +101,19 @@
 
 
 
+
+
+org.apache.hadoop
+hadoop-hdfs
+compile
+test-jar
+
+
+*
+*
+
+
+
 
 
 
diff --git a/presto-phoenix-shaded/presto-phoenix-client-shaded/pom.xml 
b/presto-phoenix-shaded/presto-phoenix-client-shaded/pom.xml
index 5a20f0f..7270a45 100644
--- a/presto-phoenix-shaded/presto-phoenix-client-shaded/pom.xml
+++ b/presto-phoenix-shaded/presto-phoenix-client-shaded/pom.xml
@@ -5,7 +5,7 @@
 
 org.apache.phoenix
 presto-phoenix-shaded
-4.14.1-HBase-1.4-PPS-0.1
+4.14.1-HBase-1.4-PPS-0.2
 ..
 
 
@@ -27,7 +27,7 @@
 
 org.apache.phoenix
 phoenix-core
-${project.version}
+${phoenix.version}
 
 



[phoenix-connectors] branch master created (now 786e7e4)

2019-01-17 Thread tdsilva
This is an automated email from the ASF dual-hosted git repository.

tdsilva pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix-connectors.git.


  at 786e7e4  Add README

This branch includes the following new commits:

 new 786e7e4  Add README

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[phoenix-connectors] 01/01: Add README

2019-01-17 Thread tdsilva
This is an automated email from the ASF dual-hosted git repository.

tdsilva pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix-connectors.git

commit 786e7e42014d36039938492980534c6f8c435ef2
Author: Thomas D'Silva 
AuthorDate: Thu Jan 17 15:44:02 2019 -0800

Add README
---
 README.md | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/README.md b/README.md
new file mode 100644
index 000..b012021
--- /dev/null
+++ b/README.md
@@ -0,0 +1,22 @@
+
+
+![logo](https://phoenix.apache.org/images/phoenix-logo-small.png)
+
+[Apache Phoenix](http://phoenix.apache.org/) enables OLTP and 
operational analytics in Hadoop for low latency applications. Visit the Apache 
Phoenix website [here](http://phoenix.apache.org/). This repo contains 
connectors for third party libraries to access data stored in Phoenix/HBase. 
+
+Copyright ©2019 [Apache Software Foundation](http://www.apache.org/). All 
Rights Reserved. 



[phoenix] branch 4.x-HBase-1.4 updated: PHOENIX-4009 Run UPDATE STATISTICS command by using MR integration on snapshots

2019-01-17 Thread karanmehta93
This is an automated email from the ASF dual-hosted git repository.

karanmehta93 pushed a commit to branch 4.x-HBase-1.4
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x-HBase-1.4 by this push:
 new e3280f6  PHOENIX-4009 Run UPDATE STATISTICS command by using MR 
integration on snapshots
e3280f6 is described below

commit e3280f6e8738b78fe865e4a717ef96c66a31b03f
Author: karanmehta93 
AuthorDate: Thu Jan 17 15:03:50 2019 -0800

PHOENIX-4009 Run UPDATE STATISTICS command by using MR integration on 
snapshots
---
 phoenix-core/pom.xml   |   8 +
 ...olumnEncodedImmutableNonTxStatsCollectorIT.java |  39 ---
 .../ColumnEncodedImmutableTxStatsCollectorIT.java  |  42 ---
 .../ColumnEncodedMutableTxStatsCollectorIT.java|  41 ---
 ...java => NamespaceDisabledStatsCollectorIT.java} |  27 +-
 java => NamespaceEnabledStatsCollectorIT.java} |  46 ++-
 ...onColumnEncodedImmutableTxStatsCollectorIT.java |  42 ---
 ...CollectorIT.java => NonTxStatsCollectorIT.java} |  25 +-
 .../apache/phoenix/end2end/TxStatsCollectorIT.java |  52 
 ...sCollectorIT.java => BaseStatsCollectorIT.java} | 228 +++---
 .../UngroupedAggregateRegionObserver.java  |  19 +-
 .../apache/phoenix/iterate/SnapshotScanner.java|  67 +++-
 .../iterate/TableSnapshotResultIterator.java   |  13 +
 .../phoenix/mapreduce/PhoenixInputFormat.java  |  32 +-
 .../phoenix/mapreduce/PhoenixRecordReader.java |   5 +-
 .../mapreduce/util/PhoenixConfigurationUtil.java   |  40 ++-
 .../mapreduce/util/PhoenixMapReduceUtil.java   |  13 +-
 .../org/apache/phoenix/schema/MetaDataClient.java  |  16 +-
 .../schema/stats/DefaultStatisticsCollector.java   | 344 ++---
 .../schema/stats/NoOpStatisticsCollector.java  |  21 +-
 .../phoenix/schema/stats/StatisticsCollector.java  |  21 +-
 .../schema/stats/StatisticsCollectorFactory.java   |  11 +-
 .../phoenix/schema/stats/StatisticsScanner.java|   3 +-
 .../phoenix/schema/stats/StatisticsUtil.java   |  23 +-
 .../phoenix/schema/stats/StatisticsWriter.java |  65 +++-
 .../phoenix/schema/stats/UpdateStatisticsTool.java | 223 +
 .../java/org/apache/phoenix/util/ServerUtil.java   |   6 +-
 .../util/PhoenixConfigurationUtilTest.java |  17 +
 .../phoenix/pig/util/PhoenixPigSchemaUtil.java |   4 +-
 pom.xml|  10 +
 30 files changed, 919 insertions(+), 584 deletions(-)

diff --git a/phoenix-core/pom.xml b/phoenix-core/pom.xml
index 018d054..3007d3b 100644
--- a/phoenix-core/pom.xml
+++ b/phoenix-core/pom.xml
@@ -399,6 +399,14 @@
 
 
   org.apache.hbase
+  hbase-metrics-api
+
+
+  org.apache.hbase
+  hbase-metrics
+
+
+  org.apache.hbase
   hbase-common
   test
   test-jar
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedImmutableNonTxStatsCollectorIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedImmutableNonTxStatsCollectorIT.java
deleted file mode 100644
index 0481ba5..000
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedImmutableNonTxStatsCollectorIT.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.phoenix.end2end;
-
-import java.util.Arrays;
-import java.util.Collection;
-
-import org.apache.phoenix.schema.stats.StatsCollectorIT;
-import org.junit.runners.Parameterized.Parameters;
-
-public class ColumnEncodedImmutableNonTxStatsCollectorIT extends 
StatsCollectorIT {
-
-public ColumnEncodedImmutableNonTxStatsCollectorIT(boolean mutable, String 
transactionProvider,
-boolean userTableNamespaceMapped, boolean columnEncoded) {
-super(mutable, transactionProvider, userTableNamespaceMapped, 
columnEncoded);
-}
-
-@Parameters(name = 
"mutable={0},transactionProvider={1},isUserTableNamespaceMapped={2},columnEncoded={3}")
-public static Collection data() {
-return Arrays.asList(new Object[][] { 
-{ false, null, false, true }, { false, null, true, true }
-});
-}
-}
diff 

Build failed in Jenkins: Phoenix | Master #2280

2019-01-17 Thread Apache Jenkins Server
See 


Changes:

[tdsilva] PHOENIX-3623 Integrate Omid with Phoenix (addendum)

--
[...truncated 123.51 KB...]
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.185 s 
- in org.apache.phoenix.replication.SystemCatalogWALEntryFilterIT
[INFO] Running org.apache.phoenix.trace.PhoenixTracingEndToEndIT
[WARNING] Tests run: 1, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0 s - 
in org.apache.phoenix.trace.PhoenixTracingEndToEndIT
[INFO] Running org.apache.phoenix.tx.FlappingTransactionIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 14.572 s 
- in org.apache.phoenix.trace.PhoenixTableMetricsWriterIT
[INFO] Running org.apache.phoenix.tx.ParameterizedTransactionIT
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 64.519 s 
- in org.apache.phoenix.rpc.UpdateCacheIT
[INFO] Running org.apache.phoenix.tx.TransactionIT
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 33.622 s 
- in org.apache.phoenix.tx.FlappingTransactionIT
[INFO] Running org.apache.phoenix.tx.TxCheckpointIT
[INFO] Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 282.949 
s - in org.apache.phoenix.end2end.join.SubqueryUsingSortMergeJoinIT
[INFO] Tests run: 24, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 399.735 
s - in org.apache.phoenix.end2end.join.SubqueryIT
[INFO] Running org.apache.phoenix.util.IndexScrutinyIT
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 28.972 s 
- in org.apache.phoenix.util.IndexScrutinyIT
[INFO] Tests run: 34, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 897.863 
s - in org.apache.phoenix.end2end.join.HashJoinLocalIndexIT
[INFO] Tests run: 24, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 196.752 
s - in org.apache.phoenix.tx.TransactionIT
[INFO] Tests run: 34, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 861.086 
s - in org.apache.phoenix.end2end.join.SortMergeJoinLocalIndexIT
[INFO] Tests run: 50, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 440.309 
s - in org.apache.phoenix.tx.TxCheckpointIT
[INFO] Tests run: 78, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 767.198 
s - in org.apache.phoenix.tx.ParameterizedTransactionIT
[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   ConcurrentMutationsIT.testLockUntilMVCCAdvanced:385 Expected data 
table row count to match expected:<1> but was:<0>
[ERROR]   ConcurrentMutationsIT.testRowLockDuringPreBatchMutateWhenIndexed:329 
Expected data table row count to match expected:<1> but was:<0>
[ERROR] Errors: 
[ERROR]   
MutableIndexSplitForwardScanIT.testSplitDuringIndexScan:30->MutableIndexSplitIT.testSplitDuringIndexScan:87->MutableIndexSplitIT.splitDuringScan:152
 » StaleRegionBoundaryCache
[ERROR]   
MutableIndexSplitForwardScanIT.testSplitDuringIndexScan:30->MutableIndexSplitIT.testSplitDuringIndexScan:87->MutableIndexSplitIT.splitDuringScan:152
 » StaleRegionBoundaryCache
[ERROR]   
MutableIndexSplitReverseScanIT.testSplitDuringIndexScan:30->MutableIndexSplitIT.testSplitDuringIndexScan:87->MutableIndexSplitIT.splitDuringScan:152
 » StaleRegionBoundaryCache
[ERROR]   
MutableIndexSplitReverseScanIT.testSplitDuringIndexScan:30->MutableIndexSplitIT.testSplitDuringIndexScan:87->MutableIndexSplitIT.splitDuringScan:152
 » StaleRegionBoundaryCache
[INFO] 
[ERROR] Tests run: 3615, Failures: 2, Errors: 4, Skipped: 11
[INFO] 
[INFO] 
[INFO] --- maven-failsafe-plugin:2.20:integration-test (HBaseManagedTimeTests) 
@ phoenix-core ---
[INFO] 
[INFO] ---
[INFO]  T E S T S
[INFO] ---
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- maven-failsafe-plugin:2.20:integration-test 
(NeedTheirOwnClusterTests) @ phoenix-core ---
[INFO] 
[INFO] ---
[INFO]  T E S T S
[INFO] ---
[INFO] Running 
org.apache.hadoop.hbase.regionserver.wal.WALReplayWithIndexWritesAndCompressedWALIT
[WARNING] Tests run: 1, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.003 
s - in 
org.apache.hadoop.hbase.regionserver.wal.WALReplayWithIndexWritesAndCompressedWALIT
[INFO] Running org.apache.phoenix.end2end.ChangePermissionsIT
[INFO] Running org.apache.phoenix.end2end.ConnectionUtilIT
[INFO] Running 
org.apache.hadoop.hbase.regionserver.wal.WALRecoveryRegionPostOpenIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 11.219 s 
- in org.apache.hadoop.hbase.regionserver.wal.WALRecoveryRegionPostOpenIT
[INFO] Running 
org.apache.phoenix.end2end.ColumnEncodedImmutableNonTxStatsCollectorIT
[INFO] Running 
org.apache.phoenix.end2end.ColumnEncodedImmutableTxStatsCollectorIT
[INFO] Running 

[phoenix] branch 4.14-HBase-1.3 updated: modify index state based on client version to support old clients

2019-01-17 Thread tdsilva
This is an automated email from the ASF dual-hosted git repository.

tdsilva pushed a commit to branch 4.14-HBase-1.3
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.14-HBase-1.3 by this push:
 new ff1876a  modify index state based on client version to support old 
clients
ff1876a is described below

commit ff1876a05462f1c8326315a183200b7a688292c9
Author: Kiran Kumar Maturi 
AuthorDate: Wed Jan 16 16:04:31 2019 +0530

modify index state based on client version to support old clients
---
 .../index/InvalidIndexStateClientSideIT.java   | 143 +
 .../phoenix/coprocessor/MetaDataEndpointImpl.java  |  36 --
 2 files changed, 168 insertions(+), 11 deletions(-)

diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/InvalidIndexStateClientSideIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/InvalidIndexStateClientSideIT.java
new file mode 100644
index 000..aee9d5b
--- /dev/null
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/InvalidIndexStateClientSideIT.java
@@ -0,0 +1,143 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end.index;
+
+import static 
org.apache.phoenix.coprocessor.MetaDataProtocol.PHOENIX_MAJOR_VERSION;
+import static 
org.apache.phoenix.coprocessor.MetaDataProtocol.PHOENIX_PATCH_NUMBER;
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.util.Map;
+
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.client.HTableInterface;
+import org.apache.hadoop.hbase.client.coprocessor.Batch;
+import org.apache.hadoop.hbase.ipc.BlockingRpcCallback;
+import org.apache.hadoop.hbase.ipc.ServerRpcController;
+import org.apache.hadoop.hbase.util.ByteStringer;
+import org.apache.phoenix.coprocessor.MetaDataProtocol.MutationCode;
+import org.apache.phoenix.coprocessor.generated.MetaDataProtos.GetTableRequest;
+import 
org.apache.phoenix.coprocessor.generated.MetaDataProtos.MetaDataResponse;
+import org.apache.phoenix.coprocessor.generated.MetaDataProtos.MetaDataService;
+import org.apache.phoenix.end2end.ParallelStatsDisabledIT;
+import org.apache.phoenix.hbase.index.util.VersionUtil;
+import org.apache.phoenix.jdbc.PhoenixConnection;
+import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
+import org.apache.phoenix.query.ConnectionQueryServices;
+import org.apache.phoenix.schema.PIndexState;
+import org.apache.phoenix.schema.PName;
+import org.apache.phoenix.schema.types.PVarchar;
+import org.apache.phoenix.util.ByteUtil;
+import org.apache.phoenix.util.Closeables;
+import org.apache.phoenix.util.EnvironmentEdgeManager;
+import org.apache.phoenix.util.IndexUtil;
+import org.apache.phoenix.util.SchemaUtil;
+import org.junit.Test;
+
+import com.sun.org.apache.commons.logging.Log;
+import com.sun.org.apache.commons.logging.LogFactory;
+
+public class InvalidIndexStateClientSideIT extends ParallelStatsDisabledIT {
+private static final Log LOG = 
LogFactory.getLog(InvalidIndexStateClientSideIT.class);
+
+@Test
+public void testCachedConnections() throws Throwable {
+final String schemaName = generateUniqueName();
+final String tableName = generateUniqueName();
+final String fullTableName = SchemaUtil.getTableName(schemaName, 
tableName);
+final String indexName = generateUniqueName();
+final String fullIndexName = SchemaUtil.getTableName(schemaName, 
indexName);
+final Connection conn = DriverManager.getConnection(getUrl());
+
+// create table and indices
+String createTableSql =
+"CREATE TABLE " + fullTableName
++ "(org_id VARCHAR NOT NULL PRIMARY KEY, v1 INTEGER, 
v2 INTEGER, v3 INTEGER)";
+conn.createStatement().execute(createTableSql);
+conn.createStatement()
+.execute("CREATE INDEX " + indexName + " ON " + fullTableName 
+ "(v1)");
+conn.commit();
+PhoenixConnection phoenixConn = conn.unwrap(PhoenixConnection.class);
+ConnectionQueryServices queryServices = 

[phoenix] branch 4.14-HBase-1.4 updated: modify index state based on client version to support old clients

2019-01-17 Thread tdsilva
This is an automated email from the ASF dual-hosted git repository.

tdsilva pushed a commit to branch 4.14-HBase-1.4
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.14-HBase-1.4 by this push:
 new 4c107e0  modify index state based on client version to support old 
clients
4c107e0 is described below

commit 4c107e0ece8e873f058107bd7a5dcd79ffa5d8fd
Author: Kiran Kumar Maturi 
AuthorDate: Wed Jan 16 16:04:31 2019 +0530

modify index state based on client version to support old clients
---
 .../index/InvalidIndexStateClientSideIT.java   | 143 +
 .../phoenix/coprocessor/MetaDataEndpointImpl.java  |  36 --
 2 files changed, 168 insertions(+), 11 deletions(-)

diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/InvalidIndexStateClientSideIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/InvalidIndexStateClientSideIT.java
new file mode 100644
index 000..aee9d5b
--- /dev/null
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/InvalidIndexStateClientSideIT.java
@@ -0,0 +1,143 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end.index;
+
+import static 
org.apache.phoenix.coprocessor.MetaDataProtocol.PHOENIX_MAJOR_VERSION;
+import static 
org.apache.phoenix.coprocessor.MetaDataProtocol.PHOENIX_PATCH_NUMBER;
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.util.Map;
+
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.client.HTableInterface;
+import org.apache.hadoop.hbase.client.coprocessor.Batch;
+import org.apache.hadoop.hbase.ipc.BlockingRpcCallback;
+import org.apache.hadoop.hbase.ipc.ServerRpcController;
+import org.apache.hadoop.hbase.util.ByteStringer;
+import org.apache.phoenix.coprocessor.MetaDataProtocol.MutationCode;
+import org.apache.phoenix.coprocessor.generated.MetaDataProtos.GetTableRequest;
+import 
org.apache.phoenix.coprocessor.generated.MetaDataProtos.MetaDataResponse;
+import org.apache.phoenix.coprocessor.generated.MetaDataProtos.MetaDataService;
+import org.apache.phoenix.end2end.ParallelStatsDisabledIT;
+import org.apache.phoenix.hbase.index.util.VersionUtil;
+import org.apache.phoenix.jdbc.PhoenixConnection;
+import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
+import org.apache.phoenix.query.ConnectionQueryServices;
+import org.apache.phoenix.schema.PIndexState;
+import org.apache.phoenix.schema.PName;
+import org.apache.phoenix.schema.types.PVarchar;
+import org.apache.phoenix.util.ByteUtil;
+import org.apache.phoenix.util.Closeables;
+import org.apache.phoenix.util.EnvironmentEdgeManager;
+import org.apache.phoenix.util.IndexUtil;
+import org.apache.phoenix.util.SchemaUtil;
+import org.junit.Test;
+
+import com.sun.org.apache.commons.logging.Log;
+import com.sun.org.apache.commons.logging.LogFactory;
+
+public class InvalidIndexStateClientSideIT extends ParallelStatsDisabledIT {
+private static final Log LOG = 
LogFactory.getLog(InvalidIndexStateClientSideIT.class);
+
+@Test
+public void testCachedConnections() throws Throwable {
+final String schemaName = generateUniqueName();
+final String tableName = generateUniqueName();
+final String fullTableName = SchemaUtil.getTableName(schemaName, 
tableName);
+final String indexName = generateUniqueName();
+final String fullIndexName = SchemaUtil.getTableName(schemaName, 
indexName);
+final Connection conn = DriverManager.getConnection(getUrl());
+
+// create table and indices
+String createTableSql =
+"CREATE TABLE " + fullTableName
++ "(org_id VARCHAR NOT NULL PRIMARY KEY, v1 INTEGER, 
v2 INTEGER, v3 INTEGER)";
+conn.createStatement().execute(createTableSql);
+conn.createStatement()
+.execute("CREATE INDEX " + indexName + " ON " + fullTableName 
+ "(v1)");
+conn.commit();
+PhoenixConnection phoenixConn = conn.unwrap(PhoenixConnection.class);
+ConnectionQueryServices queryServices = 

[phoenix] branch 4.14-HBase-1.2 updated: modify index state based on client version to support old clients

2019-01-17 Thread tdsilva
This is an automated email from the ASF dual-hosted git repository.

tdsilva pushed a commit to branch 4.14-HBase-1.2
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.14-HBase-1.2 by this push:
 new b6222cb  modify index state based on client version to support old 
clients
b6222cb is described below

commit b6222cbd8850e737c11a685688df4d03a6f573bd
Author: Kiran Kumar Maturi 
AuthorDate: Wed Jan 16 16:04:31 2019 +0530

modify index state based on client version to support old clients
---
 .../index/InvalidIndexStateClientSideIT.java   | 143 +
 .../phoenix/coprocessor/MetaDataEndpointImpl.java  |  36 --
 2 files changed, 168 insertions(+), 11 deletions(-)

diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/InvalidIndexStateClientSideIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/InvalidIndexStateClientSideIT.java
new file mode 100644
index 000..aee9d5b
--- /dev/null
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/InvalidIndexStateClientSideIT.java
@@ -0,0 +1,143 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end.index;
+
+import static 
org.apache.phoenix.coprocessor.MetaDataProtocol.PHOENIX_MAJOR_VERSION;
+import static 
org.apache.phoenix.coprocessor.MetaDataProtocol.PHOENIX_PATCH_NUMBER;
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.util.Map;
+
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.client.HTableInterface;
+import org.apache.hadoop.hbase.client.coprocessor.Batch;
+import org.apache.hadoop.hbase.ipc.BlockingRpcCallback;
+import org.apache.hadoop.hbase.ipc.ServerRpcController;
+import org.apache.hadoop.hbase.util.ByteStringer;
+import org.apache.phoenix.coprocessor.MetaDataProtocol.MutationCode;
+import org.apache.phoenix.coprocessor.generated.MetaDataProtos.GetTableRequest;
+import 
org.apache.phoenix.coprocessor.generated.MetaDataProtos.MetaDataResponse;
+import org.apache.phoenix.coprocessor.generated.MetaDataProtos.MetaDataService;
+import org.apache.phoenix.end2end.ParallelStatsDisabledIT;
+import org.apache.phoenix.hbase.index.util.VersionUtil;
+import org.apache.phoenix.jdbc.PhoenixConnection;
+import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
+import org.apache.phoenix.query.ConnectionQueryServices;
+import org.apache.phoenix.schema.PIndexState;
+import org.apache.phoenix.schema.PName;
+import org.apache.phoenix.schema.types.PVarchar;
+import org.apache.phoenix.util.ByteUtil;
+import org.apache.phoenix.util.Closeables;
+import org.apache.phoenix.util.EnvironmentEdgeManager;
+import org.apache.phoenix.util.IndexUtil;
+import org.apache.phoenix.util.SchemaUtil;
+import org.junit.Test;
+
+import com.sun.org.apache.commons.logging.Log;
+import com.sun.org.apache.commons.logging.LogFactory;
+
+public class InvalidIndexStateClientSideIT extends ParallelStatsDisabledIT {
+private static final Log LOG = 
LogFactory.getLog(InvalidIndexStateClientSideIT.class);
+
+@Test
+public void testCachedConnections() throws Throwable {
+final String schemaName = generateUniqueName();
+final String tableName = generateUniqueName();
+final String fullTableName = SchemaUtil.getTableName(schemaName, 
tableName);
+final String indexName = generateUniqueName();
+final String fullIndexName = SchemaUtil.getTableName(schemaName, 
indexName);
+final Connection conn = DriverManager.getConnection(getUrl());
+
+// create table and indices
+String createTableSql =
+"CREATE TABLE " + fullTableName
++ "(org_id VARCHAR NOT NULL PRIMARY KEY, v1 INTEGER, 
v2 INTEGER, v3 INTEGER)";
+conn.createStatement().execute(createTableSql);
+conn.createStatement()
+.execute("CREATE INDEX " + indexName + " ON " + fullTableName 
+ "(v1)");
+conn.commit();
+PhoenixConnection phoenixConn = conn.unwrap(PhoenixConnection.class);
+ConnectionQueryServices queryServices =