Apache-Phoenix | origin/4.9-HBase-0.98 | Build Successful

2018-05-13 Thread Apache Jenkins Server
origin/4.9-HBase-0.98 branch build status Successful

Source repository https://git-wip-us.apache.org/repos/asf?p=phoenix.git;a=shortlog;h=refs/heads/origin/4.9-HBase-0.98

Compiled Artifacts https://builds.apache.org/job/Phoenix-4.9/lastSuccessfulBuild/artifact/

Test Report https://builds.apache.org/job/Phoenix-4.9/lastCompletedBuild/testReport/

Changes
No changes


Build times for last couple of runsLatest build time is the right most | Legend blue: normal, red: test failure, gray: timeout


[3/5] phoenix git commit: PHOENIX-4734 SQL Query with an RVC expression lexographically higher than all values in an OR clause causes query to blow up

2018-05-13 Thread pboado
PHOENIX-4734 SQL Query with an RVC expression lexographically higher than all 
values in an OR clause causes query to blow up


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

Branch: refs/heads/4.x-cdh5.14
Commit: 7856a0017f5377ab02e882e964b32e93877d5456
Parents: 670e14f
Author: Thomas D'Silva 
Authored: Fri May 11 00:30:36 2018 +0100
Committer: Pedro Boado 
Committed: Sun May 13 10:45:54 2018 +0100

--
 .../phoenix/end2end/RowValueConstructorIT.java  | 120 +++
 .../org/apache/phoenix/compile/ScanRanges.java  |   5 +
 2 files changed, 125 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/7856a001/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
index df7603a..fb04261 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
@@ -48,6 +48,7 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Timestamp;
+import java.util.List;
 import java.util.Properties;
 
 import org.apache.phoenix.util.DateUtil;
@@ -57,6 +58,9 @@ import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.SchemaUtil;
 import org.junit.Test;
 
+import com.google.common.base.Joiner;
+import com.google.common.collect.Lists;
+
 
 public class RowValueConstructorIT extends ParallelStatsDisabledIT {
 
@@ -1646,4 +1650,120 @@ public class RowValueConstructorIT extends 
ParallelStatsDisabledIT {
 assertEquals("value", rs.getString(3));
 assertFalse(rs.next());
 }
+
+@Test
+/**
+ * Verifies that a query with a RVC expression lexographically higher than 
all values in an OR
+ * clause causes query works see PHOENIX-4734
+ */
+public void testRVCWithAndClause() throws Exception {
+final int numItemsInClause = 5;
+Properties tenantProps = new Properties();
+tenantProps.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, "tenant1");
+String fullTableName = SchemaUtil.getTableName("S", "T_" + 
generateUniqueName());
+String fullViewName = SchemaUtil.getTableName("S", "V_" + 
generateUniqueName());
+try (Connection tenantConn = DriverManager.getConnection(getUrl(), 
tenantProps)) {
+tenantConn.setAutoCommit(false);
+createBaseTableAndTenantView(tenantConn, fullTableName, 
fullViewName);
+loadDataIntoTenantView(tenantConn, fullViewName);
+List objectIdsList =
+selectObjectIdsForInClause(tenantConn, fullViewName, 
numItemsInClause);
+StringBuilder querySb = generateQueryToTest(numItemsInClause, 
fullViewName);
+PreparedStatement ps = 
tenantConn.prepareStatement(querySb.toString());
+int numbBindVarsSet = 0;
+String objectId = null;
+for (int i = 0; i < numItemsInClause; i++) {
+objectId = objectIdsList.get(i);
+ps.setString((i + 1), objectId);
+numbBindVarsSet++;
+}
+assertEquals(numItemsInClause, numbBindVarsSet);
+assertEquals("v1000", objectId);
+ps.setString(numItemsInClause + 1, "z00");
+ps.setString(numItemsInClause + 2, "v1000"); // This value must 
match or be
+ // lexographically 
higher than the highest
+ // value in the IN 
clause
+// Query should execute and return 0 results
+ResultSet rs = ps.executeQuery();
+assertFalse(
+"Query should return no results as IN clause and RVC clause 
are disjoint sets",
+rs.next());
+}
+}
+
+private StringBuilder generateQueryToTest(int numItemsInClause, String 
fullViewName) {
+StringBuilder querySb =
+new StringBuilder("SELECT OBJECT_ID,OBJECT_DATA2,OBJECT_DATA 
FROM " + fullViewName);
+querySb.append(" WHERE ((");
+List orClauses = Lists.newArrayList();
+for (int i = 1; i < (numItemsInClause + 1); i++) {
+orClauses.add("OBJECT_ID = ?");
+}
+querySb.append(Joiner.on(" OR ").join(orClauses));
+querySb.append(") AND 

[2/5] phoenix git commit: Fix PhoenixMRJobSubmitter submits duplicate MR jobs for an index build from indexTool

2018-05-13 Thread pboado
Fix PhoenixMRJobSubmitter submits duplicate MR jobs for an index build from 
indexTool


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

Branch: refs/heads/4.x-cdh5.14
Commit: 670e14fc109d8580e88adf9f97b725ef32042f88
Parents: 3768da3
Author: Xu Cang 
Authored: Tue May 8 00:21:46 2018 +0100
Committer: Pedro Boado 
Committed: Sun May 13 10:45:44 2018 +0100

--
 .../phoenix/mapreduce/index/IndexTool.java  |  6 ++--
 .../index/automation/PhoenixAsyncIndex.java |  2 +-
 .../index/automation/PhoenixMRJobSubmitter.java |  2 +-
 .../index/automated/MRJobSubmitterTest.java | 30 +++-
 4 files changed, 28 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/670e14fc/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java
index 671e4cf..e3aa729 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java
@@ -123,7 +123,7 @@ public class IndexTool extends Configured implements Tool {
 private static final Option SNAPSHOT_OPTION = new Option("snap", 
"snapshot", false,
 "If specified, uses Snapshots for async index building (optional)");
 private static final Option HELP_OPTION = new Option("h", "help", false, 
"Help");
-public static final String INDEX_JOB_NAME_TEMPLATE = "PHOENIX_%s_INDX_%s";
+public static final String INDEX_JOB_NAME_TEMPLATE = 
"PHOENIX_%s.%s_INDX_%s";
 
 private Options getOptions() {
 final Options options = new Options();
@@ -373,9 +373,9 @@ public class IndexTool extends Configured implements Tool {
 PhoenixRuntime.generateColumnInfo(connection, qIndexTable, 
indexColumns);
 ColumnInfoToStringEncoderDecoder.encode(configuration, 
columnMetadataList);
 fs = outputPath.getFileSystem(configuration);
-fs.delete(outputPath, true);   
+fs.delete(outputPath, true);
  
-final String jobName = String.format(INDEX_JOB_NAME_TEMPLATE, 
pdataTable.getName().toString(), indexTable);
+final String jobName = String.format(INDEX_JOB_NAME_TEMPLATE, 
schemaName, dataTable, indexTable);
 final Job job = Job.getInstance(configuration, jobName);
 job.setJarByClass(IndexTool.class);
 job.setMapOutputKeyClass(ImmutableBytesWritable.class);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/670e14fc/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java
index 3e88cd0..a61e49a 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java
@@ -59,7 +59,7 @@ public class PhoenixAsyncIndex {
 }
 
 public String getJobName() {
-return String.format(IndexTool.INDEX_JOB_NAME_TEMPLATE, dataTableName, 
tableName);
+return String.format(IndexTool.INDEX_JOB_NAME_TEMPLATE, tableSchem, 
dataTableName, tableName);
 }
 
 @Override

http://git-wip-us.apache.org/repos/asf/phoenix/blob/670e14fc/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java
index d86802a..3e20bd2 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java
@@ -216,7 +216,7 @@ public class PhoenixMRJobSubmitter {
 
indexInfo.setTableSchem(rs.getString(PhoenixDatabaseMetaData.TABLE_SCHEM));
 
indexInfo.setTableName(rs.getString(PhoenixDatabaseMetaData.TABLE_NAME));
   

[5/5] phoenix git commit: Changes for CDH 5.14.x

2018-05-13 Thread pboado
Changes for CDH 5.14.x


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

Branch: refs/heads/4.x-cdh5.14
Commit: af16a3d77fca3c768ba80121e599b88d833de73f
Parents: 84106f4
Author: Pedro Boado 
Authored: Sat Mar 10 17:54:04 2018 +
Committer: Pedro Boado 
Committed: Sun May 13 10:53:31 2018 +0100

--
 phoenix-assembly/pom.xml|  2 +-
 phoenix-client/pom.xml  |  2 +-
 phoenix-core/pom.xml|  2 +-
 .../hadoop/hbase/ipc/PhoenixRpcScheduler.java   | 34 ++--
 phoenix-flume/pom.xml   |  2 +-
 phoenix-hive/pom.xml|  2 +-
 phoenix-kafka/pom.xml   |  2 +-
 phoenix-load-balancer/pom.xml   |  2 +-
 phoenix-parcel/pom.xml  |  2 +-
 phoenix-pherf/pom.xml   |  2 +-
 phoenix-pig/pom.xml |  2 +-
 phoenix-queryserver-client/pom.xml  |  2 +-
 phoenix-queryserver/pom.xml |  2 +-
 phoenix-server/pom.xml  |  2 +-
 phoenix-spark/pom.xml   |  2 +-
 phoenix-tracing-webapp/pom.xml  |  2 +-
 pom.xml |  4 +--
 17 files changed, 49 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/af16a3d7/phoenix-assembly/pom.xml
--
diff --git a/phoenix-assembly/pom.xml b/phoenix-assembly/pom.xml
index 7d98c25..c013cf0 100644
--- a/phoenix-assembly/pom.xml
+++ b/phoenix-assembly/pom.xml
@@ -27,7 +27,7 @@
   
 org.apache.phoenix
 phoenix
-4.14.0-cdh5.11.2
+4.14.0-cdh5.14.2-SNAPSHOT
   
   phoenix-assembly
   Phoenix Assembly

http://git-wip-us.apache.org/repos/asf/phoenix/blob/af16a3d7/phoenix-client/pom.xml
--
diff --git a/phoenix-client/pom.xml b/phoenix-client/pom.xml
index fef18c2..6de0f65 100644
--- a/phoenix-client/pom.xml
+++ b/phoenix-client/pom.xml
@@ -27,7 +27,7 @@
   
 org.apache.phoenix
 phoenix
-4.14.0-cdh5.11.2
+4.14.0-cdh5.14.2-SNAPSHOT
   
   phoenix-client
   Phoenix Client

http://git-wip-us.apache.org/repos/asf/phoenix/blob/af16a3d7/phoenix-core/pom.xml
--
diff --git a/phoenix-core/pom.xml b/phoenix-core/pom.xml
index 60c04d4..d17facf 100644
--- a/phoenix-core/pom.xml
+++ b/phoenix-core/pom.xml
@@ -4,7 +4,7 @@
   
 org.apache.phoenix
 phoenix
-4.14.0-cdh5.11.2
+4.14.0-cdh5.14.2-SNAPSHOT
   
   phoenix-core
   Phoenix Core

http://git-wip-us.apache.org/repos/asf/phoenix/blob/af16a3d7/phoenix-core/src/main/java/org/apache/hadoop/hbase/ipc/PhoenixRpcScheduler.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/hadoop/hbase/ipc/PhoenixRpcScheduler.java
 
b/phoenix-core/src/main/java/org/apache/hadoop/hbase/ipc/PhoenixRpcScheduler.java
index 4fdddf5..d1f05f8 100644
--- 
a/phoenix-core/src/main/java/org/apache/hadoop/hbase/ipc/PhoenixRpcScheduler.java
+++ 
b/phoenix-core/src/main/java/org/apache/hadoop/hbase/ipc/PhoenixRpcScheduler.java
@@ -124,6 +124,36 @@ public class PhoenixRpcScheduler extends RpcScheduler {
 public void setMetadataExecutorForTesting(RpcExecutor executor) {
 this.metadataCallExecutor = executor;
 }
-
-
+
+@Override
+public int getReadQueueLength() {
+return delegate.getReadQueueLength();
+}
+
+@Override
+public int getWriteQueueLength() {
+return delegate.getWriteQueueLength();
+}
+
+@Override
+public int getScanQueueLength() {
+return delegate.getScanQueueLength();
+}
+
+@Override
+public int getActiveReadRpcHandlerCount() {
+return delegate.getActiveReadRpcHandlerCount();
+}
+
+@Override
+public int getActiveWriteRpcHandlerCount() {
+return delegate.getActiveWriteRpcHandlerCount();
+}
+
+@Override
+public int getActiveScanRpcHandlerCount() {
+return delegate.getActiveScanRpcHandlerCount();
+}
+
+
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/af16a3d7/phoenix-flume/pom.xml
--
diff --git a/phoenix-flume/pom.xml b/phoenix-flume/pom.xml
index e400589..e0532cb 100644
--- a/phoenix-flume/pom.xml
+++ b/phoenix-flume/pom.xml
@@ -26,7 +26,7 @@
   
 org.apache.phoenix

[1/5] phoenix git commit: PHOENIX-3163 Split during global index creation may cause ERROR 201 error (Sergey Soldatov) [Forced Update!]

2018-05-13 Thread pboado
Repository: phoenix
Updated Branches:
  refs/heads/4.x-cdh5.14 995577a16 -> af16a3d77 (forced update)


PHOENIX-3163 Split during global index creation may cause ERROR 201 error 
(Sergey Soldatov)


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

Branch: refs/heads/4.x-cdh5.14
Commit: 3768da34b9bea633cc98a00ea3f3facdcdb44eb1
Parents: c892e5c
Author: James Taylor 
Authored: Thu May 10 12:31:58 2018 -0700
Committer: James Taylor 
Committed: Thu May 10 13:17:56 2018 -0700

--
 .../phoenix/compile/StatementContext.java   |  9 +++
 .../apache/phoenix/compile/UpsertCompiler.java  |  1 +
 .../phoenix/iterate/TableResultIterator.java| 71 +++-
 3 files changed, 50 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/3768da34/phoenix-core/src/main/java/org/apache/phoenix/compile/StatementContext.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/StatementContext.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/StatementContext.java
index 3e5c8f2..3ea5dd5 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/StatementContext.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/StatementContext.java
@@ -85,6 +85,7 @@ public class StatementContext {
 private final ReadMetricQueue readMetricsQueue;
 private final OverAllQueryMetrics overAllQueryMetrics;
 private QueryLogger queryLogger;
+private boolean isClientSideUpsertSelect;
 
 public StatementContext(PhoenixStatement statement) {
 this(statement, new Scan());
@@ -316,5 +317,13 @@ public class StatementContext {
 public QueryLogger getQueryLogger() {
 return queryLogger;
 }
+
+public boolean isClientSideUpsertSelect() {
+return isClientSideUpsertSelect;
+}
+
+public void setClientSideUpsertSelect(boolean isClientSideUpsertSelect) {
+this.isClientSideUpsertSelect = isClientSideUpsertSelect;
+}
 
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/3768da34/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
index 22119a3..30f0c18 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
@@ -1252,6 +1252,7 @@ public class UpsertCompiler {
 this.useServerTimestamp = useServerTimestamp;
 this.maxSize = maxSize;
 this.maxSizeBytes = maxSizeBytes;
+queryPlan.getContext().setClientSideUpsertSelect(true);
 }
 
 @Override

http://git-wip-us.apache.org/repos/asf/phoenix/blob/3768da34/phoenix-core/src/main/java/org/apache/phoenix/iterate/TableResultIterator.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/TableResultIterator.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/TableResultIterator.java
index f6902cc..8c80c28 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/TableResultIterator.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/TableResultIterator.java
@@ -41,7 +41,6 @@ import org.apache.hadoop.hbase.client.HTableInterface;
 import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.phoenix.cache.ServerCacheClient;
 import org.apache.phoenix.cache.ServerCacheClient.ServerCache;
 import org.apache.phoenix.compile.QueryPlan;
 import org.apache.phoenix.coprocessor.HashJoinCacheNotFoundException;
@@ -92,7 +91,7 @@ public class TableResultIterator implements ResultIterator {
 
 @GuardedBy("renewLeaseLock")
 private long renewLeaseTime = 0;
-
+
 private final Lock renewLeaseLock = new ReentrantLock();
 
 private int retry;
@@ -114,12 +113,12 @@ public class TableResultIterator implements 
ResultIterator {
 public static enum RenewLeaseStatus {
 RENEWED, NOT_RENEWED, CLOSED, UNINITIALIZED, THRESHOLD_NOT_REACHED, 
LOCK_NOT_ACQUIRED, NOT_SUPPORTED
 };
-
+
 public TableResultIterator(MutationState mutationState, Scan scan, 
ScanMetricsHolder scanMetricsHolder,
 long 

[4/5] phoenix git commit: PHOENIX-4685 Properly handle connection caching for Phoenix inside RegionServers-addendum(Rajeshbabu)

2018-05-13 Thread pboado
PHOENIX-4685 Properly handle connection caching for Phoenix inside 
RegionServers-addendum(Rajeshbabu)


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

Branch: refs/heads/4.x-cdh5.14
Commit: 84106f48bd084555c495ef7f55e557031c983b65
Parents: 7856a00
Author: Rajeshbabu Chintaguntla 
Authored: Fri May 11 18:51:55 2018 +0100
Committer: Pedro Boado 
Committed: Sun May 13 10:46:05 2018 +0100

--
 .../src/main/java/org/apache/phoenix/util/ServerUtil.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/84106f48/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
--
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
index 9190373..891839a 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
@@ -346,8 +346,8 @@ public class ServerUtil {
 ClusterConnection connection = null;
 if((connection = connections.get(connectionType)) == null) {
 synchronized (CoprocessorHConnectionTableFactory.class) {
-if(connections.get(connectionType) == null) {
-connection = new CoprocessorHConnection(conf, server);
+if((connection = connections.get(connectionType)) == null) 
{
+connection = new 
CoprocessorHConnection(getTypeSpecificConfiguration(connectionType, conf), 
server);
 connections.put(connectionType, connection);
 return connection;
 }
@@ -405,7 +405,7 @@ public class ServerUtil {
 }
 
 public static Configuration 
getIndexWriterConfigurationWithCustomThreads(Configuration conf) {
-Configuration clonedConfig = PropertiesUtil.cloneConfig(conf);
+Configuration clonedConfig = getIndexWriterConnection(conf);
 setHTableThreads(clonedConfig);
 return clonedConfig;
 }



[1/5] phoenix git commit: PHOENIX-3163 Split during global index creation may cause ERROR 201 error (Sergey Soldatov) [Forced Update!]

2018-05-13 Thread pboado
Repository: phoenix
Updated Branches:
  refs/heads/4.x-cdh5.12 34d7e84fd -> 112795854 (forced update)


PHOENIX-3163 Split during global index creation may cause ERROR 201 error 
(Sergey Soldatov)


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

Branch: refs/heads/4.x-cdh5.12
Commit: 3768da34b9bea633cc98a00ea3f3facdcdb44eb1
Parents: c892e5c
Author: James Taylor 
Authored: Thu May 10 12:31:58 2018 -0700
Committer: James Taylor 
Committed: Thu May 10 13:17:56 2018 -0700

--
 .../phoenix/compile/StatementContext.java   |  9 +++
 .../apache/phoenix/compile/UpsertCompiler.java  |  1 +
 .../phoenix/iterate/TableResultIterator.java| 71 +++-
 3 files changed, 50 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/3768da34/phoenix-core/src/main/java/org/apache/phoenix/compile/StatementContext.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/StatementContext.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/StatementContext.java
index 3e5c8f2..3ea5dd5 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/StatementContext.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/StatementContext.java
@@ -85,6 +85,7 @@ public class StatementContext {
 private final ReadMetricQueue readMetricsQueue;
 private final OverAllQueryMetrics overAllQueryMetrics;
 private QueryLogger queryLogger;
+private boolean isClientSideUpsertSelect;
 
 public StatementContext(PhoenixStatement statement) {
 this(statement, new Scan());
@@ -316,5 +317,13 @@ public class StatementContext {
 public QueryLogger getQueryLogger() {
 return queryLogger;
 }
+
+public boolean isClientSideUpsertSelect() {
+return isClientSideUpsertSelect;
+}
+
+public void setClientSideUpsertSelect(boolean isClientSideUpsertSelect) {
+this.isClientSideUpsertSelect = isClientSideUpsertSelect;
+}
 
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/3768da34/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
index 22119a3..30f0c18 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
@@ -1252,6 +1252,7 @@ public class UpsertCompiler {
 this.useServerTimestamp = useServerTimestamp;
 this.maxSize = maxSize;
 this.maxSizeBytes = maxSizeBytes;
+queryPlan.getContext().setClientSideUpsertSelect(true);
 }
 
 @Override

http://git-wip-us.apache.org/repos/asf/phoenix/blob/3768da34/phoenix-core/src/main/java/org/apache/phoenix/iterate/TableResultIterator.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/TableResultIterator.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/TableResultIterator.java
index f6902cc..8c80c28 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/TableResultIterator.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/TableResultIterator.java
@@ -41,7 +41,6 @@ import org.apache.hadoop.hbase.client.HTableInterface;
 import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.phoenix.cache.ServerCacheClient;
 import org.apache.phoenix.cache.ServerCacheClient.ServerCache;
 import org.apache.phoenix.compile.QueryPlan;
 import org.apache.phoenix.coprocessor.HashJoinCacheNotFoundException;
@@ -92,7 +91,7 @@ public class TableResultIterator implements ResultIterator {
 
 @GuardedBy("renewLeaseLock")
 private long renewLeaseTime = 0;
-
+
 private final Lock renewLeaseLock = new ReentrantLock();
 
 private int retry;
@@ -114,12 +113,12 @@ public class TableResultIterator implements 
ResultIterator {
 public static enum RenewLeaseStatus {
 RENEWED, NOT_RENEWED, CLOSED, UNINITIALIZED, THRESHOLD_NOT_REACHED, 
LOCK_NOT_ACQUIRED, NOT_SUPPORTED
 };
-
+
 public TableResultIterator(MutationState mutationState, Scan scan, 
ScanMetricsHolder scanMetricsHolder,
 long 

[5/5] phoenix git commit: Changes for CDH 5.12.x

2018-05-13 Thread pboado
Changes for CDH 5.12.x


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

Branch: refs/heads/4.x-cdh5.12
Commit: 112795854302700c952b2969ee01451850ce4500
Parents: 84106f4
Author: Pedro Boado 
Authored: Sat Mar 10 17:54:04 2018 +
Committer: Pedro Boado 
Committed: Sun May 13 10:49:40 2018 +0100

--
 phoenix-assembly/pom.xml|  2 +-
 phoenix-client/pom.xml  |  2 +-
 phoenix-core/pom.xml|  2 +-
 .../hadoop/hbase/ipc/PhoenixRpcScheduler.java   | 34 ++--
 phoenix-flume/pom.xml   |  2 +-
 phoenix-hive/pom.xml|  2 +-
 phoenix-kafka/pom.xml   |  2 +-
 phoenix-load-balancer/pom.xml   |  2 +-
 phoenix-parcel/pom.xml  |  2 +-
 phoenix-pherf/pom.xml   |  2 +-
 phoenix-pig/pom.xml |  2 +-
 phoenix-queryserver-client/pom.xml  |  2 +-
 phoenix-queryserver/pom.xml |  2 +-
 phoenix-server/pom.xml  |  2 +-
 phoenix-spark/pom.xml   |  2 +-
 phoenix-tracing-webapp/pom.xml  |  2 +-
 pom.xml |  4 +--
 17 files changed, 49 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/11279585/phoenix-assembly/pom.xml
--
diff --git a/phoenix-assembly/pom.xml b/phoenix-assembly/pom.xml
index 7d98c25..14225ee 100644
--- a/phoenix-assembly/pom.xml
+++ b/phoenix-assembly/pom.xml
@@ -27,7 +27,7 @@
   
 org.apache.phoenix
 phoenix
-4.14.0-cdh5.11.2
+4.14.0-cdh5.12.2-SNAPSHOT
   
   phoenix-assembly
   Phoenix Assembly

http://git-wip-us.apache.org/repos/asf/phoenix/blob/11279585/phoenix-client/pom.xml
--
diff --git a/phoenix-client/pom.xml b/phoenix-client/pom.xml
index fef18c2..e211008 100644
--- a/phoenix-client/pom.xml
+++ b/phoenix-client/pom.xml
@@ -27,7 +27,7 @@
   
 org.apache.phoenix
 phoenix
-4.14.0-cdh5.11.2
+4.14.0-cdh5.12.2-SNAPSHOT
   
   phoenix-client
   Phoenix Client

http://git-wip-us.apache.org/repos/asf/phoenix/blob/11279585/phoenix-core/pom.xml
--
diff --git a/phoenix-core/pom.xml b/phoenix-core/pom.xml
index 60c04d4..2d837a2 100644
--- a/phoenix-core/pom.xml
+++ b/phoenix-core/pom.xml
@@ -4,7 +4,7 @@
   
 org.apache.phoenix
 phoenix
-4.14.0-cdh5.11.2
+4.14.0-cdh5.12.2-SNAPSHOT
   
   phoenix-core
   Phoenix Core

http://git-wip-us.apache.org/repos/asf/phoenix/blob/11279585/phoenix-core/src/main/java/org/apache/hadoop/hbase/ipc/PhoenixRpcScheduler.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/hadoop/hbase/ipc/PhoenixRpcScheduler.java
 
b/phoenix-core/src/main/java/org/apache/hadoop/hbase/ipc/PhoenixRpcScheduler.java
index 4fdddf5..d1f05f8 100644
--- 
a/phoenix-core/src/main/java/org/apache/hadoop/hbase/ipc/PhoenixRpcScheduler.java
+++ 
b/phoenix-core/src/main/java/org/apache/hadoop/hbase/ipc/PhoenixRpcScheduler.java
@@ -124,6 +124,36 @@ public class PhoenixRpcScheduler extends RpcScheduler {
 public void setMetadataExecutorForTesting(RpcExecutor executor) {
 this.metadataCallExecutor = executor;
 }
-
-
+
+@Override
+public int getReadQueueLength() {
+return delegate.getReadQueueLength();
+}
+
+@Override
+public int getWriteQueueLength() {
+return delegate.getWriteQueueLength();
+}
+
+@Override
+public int getScanQueueLength() {
+return delegate.getScanQueueLength();
+}
+
+@Override
+public int getActiveReadRpcHandlerCount() {
+return delegate.getActiveReadRpcHandlerCount();
+}
+
+@Override
+public int getActiveWriteRpcHandlerCount() {
+return delegate.getActiveWriteRpcHandlerCount();
+}
+
+@Override
+public int getActiveScanRpcHandlerCount() {
+return delegate.getActiveScanRpcHandlerCount();
+}
+
+
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/11279585/phoenix-flume/pom.xml
--
diff --git a/phoenix-flume/pom.xml b/phoenix-flume/pom.xml
index e400589..8a78010 100644
--- a/phoenix-flume/pom.xml
+++ b/phoenix-flume/pom.xml
@@ -26,7 +26,7 @@
   
 org.apache.phoenix

[2/5] phoenix git commit: Fix PhoenixMRJobSubmitter submits duplicate MR jobs for an index build from indexTool

2018-05-13 Thread pboado
Fix PhoenixMRJobSubmitter submits duplicate MR jobs for an index build from 
indexTool


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

Branch: refs/heads/4.x-cdh5.12
Commit: 670e14fc109d8580e88adf9f97b725ef32042f88
Parents: 3768da3
Author: Xu Cang 
Authored: Tue May 8 00:21:46 2018 +0100
Committer: Pedro Boado 
Committed: Sun May 13 10:45:44 2018 +0100

--
 .../phoenix/mapreduce/index/IndexTool.java  |  6 ++--
 .../index/automation/PhoenixAsyncIndex.java |  2 +-
 .../index/automation/PhoenixMRJobSubmitter.java |  2 +-
 .../index/automated/MRJobSubmitterTest.java | 30 +++-
 4 files changed, 28 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/670e14fc/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java
index 671e4cf..e3aa729 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java
@@ -123,7 +123,7 @@ public class IndexTool extends Configured implements Tool {
 private static final Option SNAPSHOT_OPTION = new Option("snap", 
"snapshot", false,
 "If specified, uses Snapshots for async index building (optional)");
 private static final Option HELP_OPTION = new Option("h", "help", false, 
"Help");
-public static final String INDEX_JOB_NAME_TEMPLATE = "PHOENIX_%s_INDX_%s";
+public static final String INDEX_JOB_NAME_TEMPLATE = 
"PHOENIX_%s.%s_INDX_%s";
 
 private Options getOptions() {
 final Options options = new Options();
@@ -373,9 +373,9 @@ public class IndexTool extends Configured implements Tool {
 PhoenixRuntime.generateColumnInfo(connection, qIndexTable, 
indexColumns);
 ColumnInfoToStringEncoderDecoder.encode(configuration, 
columnMetadataList);
 fs = outputPath.getFileSystem(configuration);
-fs.delete(outputPath, true);   
+fs.delete(outputPath, true);
  
-final String jobName = String.format(INDEX_JOB_NAME_TEMPLATE, 
pdataTable.getName().toString(), indexTable);
+final String jobName = String.format(INDEX_JOB_NAME_TEMPLATE, 
schemaName, dataTable, indexTable);
 final Job job = Job.getInstance(configuration, jobName);
 job.setJarByClass(IndexTool.class);
 job.setMapOutputKeyClass(ImmutableBytesWritable.class);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/670e14fc/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java
index 3e88cd0..a61e49a 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java
@@ -59,7 +59,7 @@ public class PhoenixAsyncIndex {
 }
 
 public String getJobName() {
-return String.format(IndexTool.INDEX_JOB_NAME_TEMPLATE, dataTableName, 
tableName);
+return String.format(IndexTool.INDEX_JOB_NAME_TEMPLATE, tableSchem, 
dataTableName, tableName);
 }
 
 @Override

http://git-wip-us.apache.org/repos/asf/phoenix/blob/670e14fc/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java
index d86802a..3e20bd2 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java
@@ -216,7 +216,7 @@ public class PhoenixMRJobSubmitter {
 
indexInfo.setTableSchem(rs.getString(PhoenixDatabaseMetaData.TABLE_SCHEM));
 
indexInfo.setTableName(rs.getString(PhoenixDatabaseMetaData.TABLE_NAME));
   

[3/5] phoenix git commit: PHOENIX-4734 SQL Query with an RVC expression lexographically higher than all values in an OR clause causes query to blow up

2018-05-13 Thread pboado
PHOENIX-4734 SQL Query with an RVC expression lexographically higher than all 
values in an OR clause causes query to blow up


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

Branch: refs/heads/4.x-cdh5.13
Commit: 7856a0017f5377ab02e882e964b32e93877d5456
Parents: 670e14f
Author: Thomas D'Silva 
Authored: Fri May 11 00:30:36 2018 +0100
Committer: Pedro Boado 
Committed: Sun May 13 10:45:54 2018 +0100

--
 .../phoenix/end2end/RowValueConstructorIT.java  | 120 +++
 .../org/apache/phoenix/compile/ScanRanges.java  |   5 +
 2 files changed, 125 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/7856a001/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
index df7603a..fb04261 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
@@ -48,6 +48,7 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Timestamp;
+import java.util.List;
 import java.util.Properties;
 
 import org.apache.phoenix.util.DateUtil;
@@ -57,6 +58,9 @@ import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.SchemaUtil;
 import org.junit.Test;
 
+import com.google.common.base.Joiner;
+import com.google.common.collect.Lists;
+
 
 public class RowValueConstructorIT extends ParallelStatsDisabledIT {
 
@@ -1646,4 +1650,120 @@ public class RowValueConstructorIT extends 
ParallelStatsDisabledIT {
 assertEquals("value", rs.getString(3));
 assertFalse(rs.next());
 }
+
+@Test
+/**
+ * Verifies that a query with a RVC expression lexographically higher than 
all values in an OR
+ * clause causes query works see PHOENIX-4734
+ */
+public void testRVCWithAndClause() throws Exception {
+final int numItemsInClause = 5;
+Properties tenantProps = new Properties();
+tenantProps.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, "tenant1");
+String fullTableName = SchemaUtil.getTableName("S", "T_" + 
generateUniqueName());
+String fullViewName = SchemaUtil.getTableName("S", "V_" + 
generateUniqueName());
+try (Connection tenantConn = DriverManager.getConnection(getUrl(), 
tenantProps)) {
+tenantConn.setAutoCommit(false);
+createBaseTableAndTenantView(tenantConn, fullTableName, 
fullViewName);
+loadDataIntoTenantView(tenantConn, fullViewName);
+List objectIdsList =
+selectObjectIdsForInClause(tenantConn, fullViewName, 
numItemsInClause);
+StringBuilder querySb = generateQueryToTest(numItemsInClause, 
fullViewName);
+PreparedStatement ps = 
tenantConn.prepareStatement(querySb.toString());
+int numbBindVarsSet = 0;
+String objectId = null;
+for (int i = 0; i < numItemsInClause; i++) {
+objectId = objectIdsList.get(i);
+ps.setString((i + 1), objectId);
+numbBindVarsSet++;
+}
+assertEquals(numItemsInClause, numbBindVarsSet);
+assertEquals("v1000", objectId);
+ps.setString(numItemsInClause + 1, "z00");
+ps.setString(numItemsInClause + 2, "v1000"); // This value must 
match or be
+ // lexographically 
higher than the highest
+ // value in the IN 
clause
+// Query should execute and return 0 results
+ResultSet rs = ps.executeQuery();
+assertFalse(
+"Query should return no results as IN clause and RVC clause 
are disjoint sets",
+rs.next());
+}
+}
+
+private StringBuilder generateQueryToTest(int numItemsInClause, String 
fullViewName) {
+StringBuilder querySb =
+new StringBuilder("SELECT OBJECT_ID,OBJECT_DATA2,OBJECT_DATA 
FROM " + fullViewName);
+querySb.append(" WHERE ((");
+List orClauses = Lists.newArrayList();
+for (int i = 1; i < (numItemsInClause + 1); i++) {
+orClauses.add("OBJECT_ID = ?");
+}
+querySb.append(Joiner.on(" OR ").join(orClauses));
+querySb.append(") AND 

[5/5] phoenix git commit: Changes for CDH 5.13.x

2018-05-13 Thread pboado
Changes for CDH 5.13.x


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

Branch: refs/heads/4.x-cdh5.13
Commit: e63a313b166481190b57459379d98a5a6373ad88
Parents: 84106f4
Author: Pedro Boado 
Authored: Sat Mar 10 17:54:04 2018 +
Committer: Pedro Boado 
Committed: Sun May 13 10:50:03 2018 +0100

--
 phoenix-assembly/pom.xml|  2 +-
 phoenix-client/pom.xml  |  2 +-
 phoenix-core/pom.xml|  2 +-
 .../hadoop/hbase/ipc/PhoenixRpcScheduler.java   | 34 ++--
 phoenix-flume/pom.xml   |  2 +-
 phoenix-hive/pom.xml|  2 +-
 phoenix-kafka/pom.xml   |  2 +-
 phoenix-load-balancer/pom.xml   |  2 +-
 phoenix-parcel/pom.xml  |  2 +-
 phoenix-pherf/pom.xml   |  2 +-
 phoenix-pig/pom.xml |  2 +-
 phoenix-queryserver-client/pom.xml  |  2 +-
 phoenix-queryserver/pom.xml |  2 +-
 phoenix-server/pom.xml  |  2 +-
 phoenix-spark/pom.xml   |  2 +-
 phoenix-tracing-webapp/pom.xml  |  2 +-
 pom.xml |  4 +--
 17 files changed, 49 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/e63a313b/phoenix-assembly/pom.xml
--
diff --git a/phoenix-assembly/pom.xml b/phoenix-assembly/pom.xml
index 7d98c25..f0cd238 100644
--- a/phoenix-assembly/pom.xml
+++ b/phoenix-assembly/pom.xml
@@ -27,7 +27,7 @@
   
 org.apache.phoenix
 phoenix
-4.14.0-cdh5.11.2
+4.14.0-cdh5.13.2-SNAPSHOT
   
   phoenix-assembly
   Phoenix Assembly

http://git-wip-us.apache.org/repos/asf/phoenix/blob/e63a313b/phoenix-client/pom.xml
--
diff --git a/phoenix-client/pom.xml b/phoenix-client/pom.xml
index fef18c2..b4da311 100644
--- a/phoenix-client/pom.xml
+++ b/phoenix-client/pom.xml
@@ -27,7 +27,7 @@
   
 org.apache.phoenix
 phoenix
-4.14.0-cdh5.11.2
+4.14.0-cdh5.13.2-SNAPSHOT
   
   phoenix-client
   Phoenix Client

http://git-wip-us.apache.org/repos/asf/phoenix/blob/e63a313b/phoenix-core/pom.xml
--
diff --git a/phoenix-core/pom.xml b/phoenix-core/pom.xml
index 60c04d4..19ddeb5 100644
--- a/phoenix-core/pom.xml
+++ b/phoenix-core/pom.xml
@@ -4,7 +4,7 @@
   
 org.apache.phoenix
 phoenix
-4.14.0-cdh5.11.2
+4.14.0-cdh5.13.2-SNAPSHOT
   
   phoenix-core
   Phoenix Core

http://git-wip-us.apache.org/repos/asf/phoenix/blob/e63a313b/phoenix-core/src/main/java/org/apache/hadoop/hbase/ipc/PhoenixRpcScheduler.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/hadoop/hbase/ipc/PhoenixRpcScheduler.java
 
b/phoenix-core/src/main/java/org/apache/hadoop/hbase/ipc/PhoenixRpcScheduler.java
index 4fdddf5..d1f05f8 100644
--- 
a/phoenix-core/src/main/java/org/apache/hadoop/hbase/ipc/PhoenixRpcScheduler.java
+++ 
b/phoenix-core/src/main/java/org/apache/hadoop/hbase/ipc/PhoenixRpcScheduler.java
@@ -124,6 +124,36 @@ public class PhoenixRpcScheduler extends RpcScheduler {
 public void setMetadataExecutorForTesting(RpcExecutor executor) {
 this.metadataCallExecutor = executor;
 }
-
-
+
+@Override
+public int getReadQueueLength() {
+return delegate.getReadQueueLength();
+}
+
+@Override
+public int getWriteQueueLength() {
+return delegate.getWriteQueueLength();
+}
+
+@Override
+public int getScanQueueLength() {
+return delegate.getScanQueueLength();
+}
+
+@Override
+public int getActiveReadRpcHandlerCount() {
+return delegate.getActiveReadRpcHandlerCount();
+}
+
+@Override
+public int getActiveWriteRpcHandlerCount() {
+return delegate.getActiveWriteRpcHandlerCount();
+}
+
+@Override
+public int getActiveScanRpcHandlerCount() {
+return delegate.getActiveScanRpcHandlerCount();
+}
+
+
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/e63a313b/phoenix-flume/pom.xml
--
diff --git a/phoenix-flume/pom.xml b/phoenix-flume/pom.xml
index e400589..bcc037c 100644
--- a/phoenix-flume/pom.xml
+++ b/phoenix-flume/pom.xml
@@ -26,7 +26,7 @@
   
 org.apache.phoenix

[4/5] phoenix git commit: PHOENIX-4685 Properly handle connection caching for Phoenix inside RegionServers-addendum(Rajeshbabu)

2018-05-13 Thread pboado
PHOENIX-4685 Properly handle connection caching for Phoenix inside 
RegionServers-addendum(Rajeshbabu)


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

Branch: refs/heads/4.x-cdh5.12
Commit: 84106f48bd084555c495ef7f55e557031c983b65
Parents: 7856a00
Author: Rajeshbabu Chintaguntla 
Authored: Fri May 11 18:51:55 2018 +0100
Committer: Pedro Boado 
Committed: Sun May 13 10:46:05 2018 +0100

--
 .../src/main/java/org/apache/phoenix/util/ServerUtil.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/84106f48/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
--
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
index 9190373..891839a 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
@@ -346,8 +346,8 @@ public class ServerUtil {
 ClusterConnection connection = null;
 if((connection = connections.get(connectionType)) == null) {
 synchronized (CoprocessorHConnectionTableFactory.class) {
-if(connections.get(connectionType) == null) {
-connection = new CoprocessorHConnection(conf, server);
+if((connection = connections.get(connectionType)) == null) 
{
+connection = new 
CoprocessorHConnection(getTypeSpecificConfiguration(connectionType, conf), 
server);
 connections.put(connectionType, connection);
 return connection;
 }
@@ -405,7 +405,7 @@ public class ServerUtil {
 }
 
 public static Configuration 
getIndexWriterConfigurationWithCustomThreads(Configuration conf) {
-Configuration clonedConfig = PropertiesUtil.cloneConfig(conf);
+Configuration clonedConfig = getIndexWriterConnection(conf);
 setHTableThreads(clonedConfig);
 return clonedConfig;
 }



[1/5] phoenix git commit: PHOENIX-3163 Split during global index creation may cause ERROR 201 error (Sergey Soldatov) [Forced Update!]

2018-05-13 Thread pboado
Repository: phoenix
Updated Branches:
  refs/heads/4.x-cdh5.13 036adf3b8 -> e63a313b1 (forced update)


PHOENIX-3163 Split during global index creation may cause ERROR 201 error 
(Sergey Soldatov)


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

Branch: refs/heads/4.x-cdh5.13
Commit: 3768da34b9bea633cc98a00ea3f3facdcdb44eb1
Parents: c892e5c
Author: James Taylor 
Authored: Thu May 10 12:31:58 2018 -0700
Committer: James Taylor 
Committed: Thu May 10 13:17:56 2018 -0700

--
 .../phoenix/compile/StatementContext.java   |  9 +++
 .../apache/phoenix/compile/UpsertCompiler.java  |  1 +
 .../phoenix/iterate/TableResultIterator.java| 71 +++-
 3 files changed, 50 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/3768da34/phoenix-core/src/main/java/org/apache/phoenix/compile/StatementContext.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/StatementContext.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/StatementContext.java
index 3e5c8f2..3ea5dd5 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/StatementContext.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/StatementContext.java
@@ -85,6 +85,7 @@ public class StatementContext {
 private final ReadMetricQueue readMetricsQueue;
 private final OverAllQueryMetrics overAllQueryMetrics;
 private QueryLogger queryLogger;
+private boolean isClientSideUpsertSelect;
 
 public StatementContext(PhoenixStatement statement) {
 this(statement, new Scan());
@@ -316,5 +317,13 @@ public class StatementContext {
 public QueryLogger getQueryLogger() {
 return queryLogger;
 }
+
+public boolean isClientSideUpsertSelect() {
+return isClientSideUpsertSelect;
+}
+
+public void setClientSideUpsertSelect(boolean isClientSideUpsertSelect) {
+this.isClientSideUpsertSelect = isClientSideUpsertSelect;
+}
 
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/3768da34/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
index 22119a3..30f0c18 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
@@ -1252,6 +1252,7 @@ public class UpsertCompiler {
 this.useServerTimestamp = useServerTimestamp;
 this.maxSize = maxSize;
 this.maxSizeBytes = maxSizeBytes;
+queryPlan.getContext().setClientSideUpsertSelect(true);
 }
 
 @Override

http://git-wip-us.apache.org/repos/asf/phoenix/blob/3768da34/phoenix-core/src/main/java/org/apache/phoenix/iterate/TableResultIterator.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/TableResultIterator.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/TableResultIterator.java
index f6902cc..8c80c28 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/TableResultIterator.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/TableResultIterator.java
@@ -41,7 +41,6 @@ import org.apache.hadoop.hbase.client.HTableInterface;
 import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.phoenix.cache.ServerCacheClient;
 import org.apache.phoenix.cache.ServerCacheClient.ServerCache;
 import org.apache.phoenix.compile.QueryPlan;
 import org.apache.phoenix.coprocessor.HashJoinCacheNotFoundException;
@@ -92,7 +91,7 @@ public class TableResultIterator implements ResultIterator {
 
 @GuardedBy("renewLeaseLock")
 private long renewLeaseTime = 0;
-
+
 private final Lock renewLeaseLock = new ReentrantLock();
 
 private int retry;
@@ -114,12 +113,12 @@ public class TableResultIterator implements 
ResultIterator {
 public static enum RenewLeaseStatus {
 RENEWED, NOT_RENEWED, CLOSED, UNINITIALIZED, THRESHOLD_NOT_REACHED, 
LOCK_NOT_ACQUIRED, NOT_SUPPORTED
 };
-
+
 public TableResultIterator(MutationState mutationState, Scan scan, 
ScanMetricsHolder scanMetricsHolder,
 long 

[2/5] phoenix git commit: Fix PhoenixMRJobSubmitter submits duplicate MR jobs for an index build from indexTool

2018-05-13 Thread pboado
Fix PhoenixMRJobSubmitter submits duplicate MR jobs for an index build from 
indexTool


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

Branch: refs/heads/4.x-cdh5.13
Commit: 670e14fc109d8580e88adf9f97b725ef32042f88
Parents: 3768da3
Author: Xu Cang 
Authored: Tue May 8 00:21:46 2018 +0100
Committer: Pedro Boado 
Committed: Sun May 13 10:45:44 2018 +0100

--
 .../phoenix/mapreduce/index/IndexTool.java  |  6 ++--
 .../index/automation/PhoenixAsyncIndex.java |  2 +-
 .../index/automation/PhoenixMRJobSubmitter.java |  2 +-
 .../index/automated/MRJobSubmitterTest.java | 30 +++-
 4 files changed, 28 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/670e14fc/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java
index 671e4cf..e3aa729 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java
@@ -123,7 +123,7 @@ public class IndexTool extends Configured implements Tool {
 private static final Option SNAPSHOT_OPTION = new Option("snap", 
"snapshot", false,
 "If specified, uses Snapshots for async index building (optional)");
 private static final Option HELP_OPTION = new Option("h", "help", false, 
"Help");
-public static final String INDEX_JOB_NAME_TEMPLATE = "PHOENIX_%s_INDX_%s";
+public static final String INDEX_JOB_NAME_TEMPLATE = 
"PHOENIX_%s.%s_INDX_%s";
 
 private Options getOptions() {
 final Options options = new Options();
@@ -373,9 +373,9 @@ public class IndexTool extends Configured implements Tool {
 PhoenixRuntime.generateColumnInfo(connection, qIndexTable, 
indexColumns);
 ColumnInfoToStringEncoderDecoder.encode(configuration, 
columnMetadataList);
 fs = outputPath.getFileSystem(configuration);
-fs.delete(outputPath, true);   
+fs.delete(outputPath, true);
  
-final String jobName = String.format(INDEX_JOB_NAME_TEMPLATE, 
pdataTable.getName().toString(), indexTable);
+final String jobName = String.format(INDEX_JOB_NAME_TEMPLATE, 
schemaName, dataTable, indexTable);
 final Job job = Job.getInstance(configuration, jobName);
 job.setJarByClass(IndexTool.class);
 job.setMapOutputKeyClass(ImmutableBytesWritable.class);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/670e14fc/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java
index 3e88cd0..a61e49a 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java
@@ -59,7 +59,7 @@ public class PhoenixAsyncIndex {
 }
 
 public String getJobName() {
-return String.format(IndexTool.INDEX_JOB_NAME_TEMPLATE, dataTableName, 
tableName);
+return String.format(IndexTool.INDEX_JOB_NAME_TEMPLATE, tableSchem, 
dataTableName, tableName);
 }
 
 @Override

http://git-wip-us.apache.org/repos/asf/phoenix/blob/670e14fc/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java
index d86802a..3e20bd2 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java
@@ -216,7 +216,7 @@ public class PhoenixMRJobSubmitter {
 
indexInfo.setTableSchem(rs.getString(PhoenixDatabaseMetaData.TABLE_SCHEM));
 
indexInfo.setTableName(rs.getString(PhoenixDatabaseMetaData.TABLE_NAME));
   

[3/5] phoenix git commit: PHOENIX-4734 SQL Query with an RVC expression lexographically higher than all values in an OR clause causes query to blow up

2018-05-13 Thread pboado
PHOENIX-4734 SQL Query with an RVC expression lexographically higher than all 
values in an OR clause causes query to blow up


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

Branch: refs/heads/4.x-cdh5.12
Commit: 7856a0017f5377ab02e882e964b32e93877d5456
Parents: 670e14f
Author: Thomas D'Silva 
Authored: Fri May 11 00:30:36 2018 +0100
Committer: Pedro Boado 
Committed: Sun May 13 10:45:54 2018 +0100

--
 .../phoenix/end2end/RowValueConstructorIT.java  | 120 +++
 .../org/apache/phoenix/compile/ScanRanges.java  |   5 +
 2 files changed, 125 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/7856a001/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
index df7603a..fb04261 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
@@ -48,6 +48,7 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Timestamp;
+import java.util.List;
 import java.util.Properties;
 
 import org.apache.phoenix.util.DateUtil;
@@ -57,6 +58,9 @@ import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.SchemaUtil;
 import org.junit.Test;
 
+import com.google.common.base.Joiner;
+import com.google.common.collect.Lists;
+
 
 public class RowValueConstructorIT extends ParallelStatsDisabledIT {
 
@@ -1646,4 +1650,120 @@ public class RowValueConstructorIT extends 
ParallelStatsDisabledIT {
 assertEquals("value", rs.getString(3));
 assertFalse(rs.next());
 }
+
+@Test
+/**
+ * Verifies that a query with a RVC expression lexographically higher than 
all values in an OR
+ * clause causes query works see PHOENIX-4734
+ */
+public void testRVCWithAndClause() throws Exception {
+final int numItemsInClause = 5;
+Properties tenantProps = new Properties();
+tenantProps.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, "tenant1");
+String fullTableName = SchemaUtil.getTableName("S", "T_" + 
generateUniqueName());
+String fullViewName = SchemaUtil.getTableName("S", "V_" + 
generateUniqueName());
+try (Connection tenantConn = DriverManager.getConnection(getUrl(), 
tenantProps)) {
+tenantConn.setAutoCommit(false);
+createBaseTableAndTenantView(tenantConn, fullTableName, 
fullViewName);
+loadDataIntoTenantView(tenantConn, fullViewName);
+List objectIdsList =
+selectObjectIdsForInClause(tenantConn, fullViewName, 
numItemsInClause);
+StringBuilder querySb = generateQueryToTest(numItemsInClause, 
fullViewName);
+PreparedStatement ps = 
tenantConn.prepareStatement(querySb.toString());
+int numbBindVarsSet = 0;
+String objectId = null;
+for (int i = 0; i < numItemsInClause; i++) {
+objectId = objectIdsList.get(i);
+ps.setString((i + 1), objectId);
+numbBindVarsSet++;
+}
+assertEquals(numItemsInClause, numbBindVarsSet);
+assertEquals("v1000", objectId);
+ps.setString(numItemsInClause + 1, "z00");
+ps.setString(numItemsInClause + 2, "v1000"); // This value must 
match or be
+ // lexographically 
higher than the highest
+ // value in the IN 
clause
+// Query should execute and return 0 results
+ResultSet rs = ps.executeQuery();
+assertFalse(
+"Query should return no results as IN clause and RVC clause 
are disjoint sets",
+rs.next());
+}
+}
+
+private StringBuilder generateQueryToTest(int numItemsInClause, String 
fullViewName) {
+StringBuilder querySb =
+new StringBuilder("SELECT OBJECT_ID,OBJECT_DATA2,OBJECT_DATA 
FROM " + fullViewName);
+querySb.append(" WHERE ((");
+List orClauses = Lists.newArrayList();
+for (int i = 1; i < (numItemsInClause + 1); i++) {
+orClauses.add("OBJECT_ID = ?");
+}
+querySb.append(Joiner.on(" OR ").join(orClauses));
+querySb.append(") AND 

[4/5] phoenix git commit: PHOENIX-4685 Properly handle connection caching for Phoenix inside RegionServers-addendum(Rajeshbabu)

2018-05-13 Thread pboado
PHOENIX-4685 Properly handle connection caching for Phoenix inside 
RegionServers-addendum(Rajeshbabu)


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

Branch: refs/heads/4.x-cdh5.13
Commit: 84106f48bd084555c495ef7f55e557031c983b65
Parents: 7856a00
Author: Rajeshbabu Chintaguntla 
Authored: Fri May 11 18:51:55 2018 +0100
Committer: Pedro Boado 
Committed: Sun May 13 10:46:05 2018 +0100

--
 .../src/main/java/org/apache/phoenix/util/ServerUtil.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/84106f48/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
--
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
index 9190373..891839a 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
@@ -346,8 +346,8 @@ public class ServerUtil {
 ClusterConnection connection = null;
 if((connection = connections.get(connectionType)) == null) {
 synchronized (CoprocessorHConnectionTableFactory.class) {
-if(connections.get(connectionType) == null) {
-connection = new CoprocessorHConnection(conf, server);
+if((connection = connections.get(connectionType)) == null) 
{
+connection = new 
CoprocessorHConnection(getTypeSpecificConfiguration(connectionType, conf), 
server);
 connections.put(connectionType, connection);
 return connection;
 }
@@ -405,7 +405,7 @@ public class ServerUtil {
 }
 
 public static Configuration 
getIndexWriterConfigurationWithCustomThreads(Configuration conf) {
-Configuration clonedConfig = PropertiesUtil.cloneConfig(conf);
+Configuration clonedConfig = getIndexWriterConnection(conf);
 setHTableThreads(clonedConfig);
 return clonedConfig;
 }



[3/3] phoenix git commit: PHOENIX-4685 Properly handle connection caching for Phoenix inside RegionServers-addendum(Rajeshbabu)

2018-05-13 Thread pboado
PHOENIX-4685 Properly handle connection caching for Phoenix inside 
RegionServers-addendum(Rajeshbabu)


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

Branch: refs/heads/4.x-cdh5.11
Commit: 84106f48bd084555c495ef7f55e557031c983b65
Parents: 7856a00
Author: Rajeshbabu Chintaguntla 
Authored: Fri May 11 18:51:55 2018 +0100
Committer: Pedro Boado 
Committed: Sun May 13 10:46:05 2018 +0100

--
 .../src/main/java/org/apache/phoenix/util/ServerUtil.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/84106f48/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
--
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
index 9190373..891839a 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
@@ -346,8 +346,8 @@ public class ServerUtil {
 ClusterConnection connection = null;
 if((connection = connections.get(connectionType)) == null) {
 synchronized (CoprocessorHConnectionTableFactory.class) {
-if(connections.get(connectionType) == null) {
-connection = new CoprocessorHConnection(conf, server);
+if((connection = connections.get(connectionType)) == null) 
{
+connection = new 
CoprocessorHConnection(getTypeSpecificConfiguration(connectionType, conf), 
server);
 connections.put(connectionType, connection);
 return connection;
 }
@@ -405,7 +405,7 @@ public class ServerUtil {
 }
 
 public static Configuration 
getIndexWriterConfigurationWithCustomThreads(Configuration conf) {
-Configuration clonedConfig = PropertiesUtil.cloneConfig(conf);
+Configuration clonedConfig = getIndexWriterConnection(conf);
 setHTableThreads(clonedConfig);
 return clonedConfig;
 }



[1/3] phoenix git commit: Fix PhoenixMRJobSubmitter submits duplicate MR jobs for an index build from indexTool

2018-05-13 Thread pboado
Repository: phoenix
Updated Branches:
  refs/heads/4.x-cdh5.11 3768da34b -> 84106f48b


Fix PhoenixMRJobSubmitter submits duplicate MR jobs for an index build from 
indexTool


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

Branch: refs/heads/4.x-cdh5.11
Commit: 670e14fc109d8580e88adf9f97b725ef32042f88
Parents: 3768da3
Author: Xu Cang 
Authored: Tue May 8 00:21:46 2018 +0100
Committer: Pedro Boado 
Committed: Sun May 13 10:45:44 2018 +0100

--
 .../phoenix/mapreduce/index/IndexTool.java  |  6 ++--
 .../index/automation/PhoenixAsyncIndex.java |  2 +-
 .../index/automation/PhoenixMRJobSubmitter.java |  2 +-
 .../index/automated/MRJobSubmitterTest.java | 30 +++-
 4 files changed, 28 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/670e14fc/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java
index 671e4cf..e3aa729 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java
@@ -123,7 +123,7 @@ public class IndexTool extends Configured implements Tool {
 private static final Option SNAPSHOT_OPTION = new Option("snap", 
"snapshot", false,
 "If specified, uses Snapshots for async index building (optional)");
 private static final Option HELP_OPTION = new Option("h", "help", false, 
"Help");
-public static final String INDEX_JOB_NAME_TEMPLATE = "PHOENIX_%s_INDX_%s";
+public static final String INDEX_JOB_NAME_TEMPLATE = 
"PHOENIX_%s.%s_INDX_%s";
 
 private Options getOptions() {
 final Options options = new Options();
@@ -373,9 +373,9 @@ public class IndexTool extends Configured implements Tool {
 PhoenixRuntime.generateColumnInfo(connection, qIndexTable, 
indexColumns);
 ColumnInfoToStringEncoderDecoder.encode(configuration, 
columnMetadataList);
 fs = outputPath.getFileSystem(configuration);
-fs.delete(outputPath, true);   
+fs.delete(outputPath, true);
  
-final String jobName = String.format(INDEX_JOB_NAME_TEMPLATE, 
pdataTable.getName().toString(), indexTable);
+final String jobName = String.format(INDEX_JOB_NAME_TEMPLATE, 
schemaName, dataTable, indexTable);
 final Job job = Job.getInstance(configuration, jobName);
 job.setJarByClass(IndexTool.class);
 job.setMapOutputKeyClass(ImmutableBytesWritable.class);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/670e14fc/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java
index 3e88cd0..a61e49a 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixAsyncIndex.java
@@ -59,7 +59,7 @@ public class PhoenixAsyncIndex {
 }
 
 public String getJobName() {
-return String.format(IndexTool.INDEX_JOB_NAME_TEMPLATE, dataTableName, 
tableName);
+return String.format(IndexTool.INDEX_JOB_NAME_TEMPLATE, tableSchem, 
dataTableName, tableName);
 }
 
 @Override

http://git-wip-us.apache.org/repos/asf/phoenix/blob/670e14fc/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java
index d86802a..3e20bd2 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/automation/PhoenixMRJobSubmitter.java
@@ -216,7 +216,7 @@ public class PhoenixMRJobSubmitter {
 
indexInfo.setTableSchem(rs.getString(PhoenixDatabaseMetaData.TABLE_SCHEM));
   

[2/3] phoenix git commit: PHOENIX-4734 SQL Query with an RVC expression lexographically higher than all values in an OR clause causes query to blow up

2018-05-13 Thread pboado
PHOENIX-4734 SQL Query with an RVC expression lexographically higher than all 
values in an OR clause causes query to blow up


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

Branch: refs/heads/4.x-cdh5.11
Commit: 7856a0017f5377ab02e882e964b32e93877d5456
Parents: 670e14f
Author: Thomas D'Silva 
Authored: Fri May 11 00:30:36 2018 +0100
Committer: Pedro Boado 
Committed: Sun May 13 10:45:54 2018 +0100

--
 .../phoenix/end2end/RowValueConstructorIT.java  | 120 +++
 .../org/apache/phoenix/compile/ScanRanges.java  |   5 +
 2 files changed, 125 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/7856a001/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
index df7603a..fb04261 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
@@ -48,6 +48,7 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Timestamp;
+import java.util.List;
 import java.util.Properties;
 
 import org.apache.phoenix.util.DateUtil;
@@ -57,6 +58,9 @@ import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.SchemaUtil;
 import org.junit.Test;
 
+import com.google.common.base.Joiner;
+import com.google.common.collect.Lists;
+
 
 public class RowValueConstructorIT extends ParallelStatsDisabledIT {
 
@@ -1646,4 +1650,120 @@ public class RowValueConstructorIT extends 
ParallelStatsDisabledIT {
 assertEquals("value", rs.getString(3));
 assertFalse(rs.next());
 }
+
+@Test
+/**
+ * Verifies that a query with a RVC expression lexographically higher than 
all values in an OR
+ * clause causes query works see PHOENIX-4734
+ */
+public void testRVCWithAndClause() throws Exception {
+final int numItemsInClause = 5;
+Properties tenantProps = new Properties();
+tenantProps.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, "tenant1");
+String fullTableName = SchemaUtil.getTableName("S", "T_" + 
generateUniqueName());
+String fullViewName = SchemaUtil.getTableName("S", "V_" + 
generateUniqueName());
+try (Connection tenantConn = DriverManager.getConnection(getUrl(), 
tenantProps)) {
+tenantConn.setAutoCommit(false);
+createBaseTableAndTenantView(tenantConn, fullTableName, 
fullViewName);
+loadDataIntoTenantView(tenantConn, fullViewName);
+List objectIdsList =
+selectObjectIdsForInClause(tenantConn, fullViewName, 
numItemsInClause);
+StringBuilder querySb = generateQueryToTest(numItemsInClause, 
fullViewName);
+PreparedStatement ps = 
tenantConn.prepareStatement(querySb.toString());
+int numbBindVarsSet = 0;
+String objectId = null;
+for (int i = 0; i < numItemsInClause; i++) {
+objectId = objectIdsList.get(i);
+ps.setString((i + 1), objectId);
+numbBindVarsSet++;
+}
+assertEquals(numItemsInClause, numbBindVarsSet);
+assertEquals("v1000", objectId);
+ps.setString(numItemsInClause + 1, "z00");
+ps.setString(numItemsInClause + 2, "v1000"); // This value must 
match or be
+ // lexographically 
higher than the highest
+ // value in the IN 
clause
+// Query should execute and return 0 results
+ResultSet rs = ps.executeQuery();
+assertFalse(
+"Query should return no results as IN clause and RVC clause 
are disjoint sets",
+rs.next());
+}
+}
+
+private StringBuilder generateQueryToTest(int numItemsInClause, String 
fullViewName) {
+StringBuilder querySb =
+new StringBuilder("SELECT OBJECT_ID,OBJECT_DATA2,OBJECT_DATA 
FROM " + fullViewName);
+querySb.append(" WHERE ((");
+List orClauses = Lists.newArrayList();
+for (int i = 1; i < (numItemsInClause + 1); i++) {
+orClauses.add("OBJECT_ID = ?");
+}
+querySb.append(Joiner.on(" OR ").join(orClauses));
+querySb.append(") AND 

Build failed in Jenkins: Phoenix Compile Compatibility with HBase #635

2018-05-13 Thread Apache Jenkins Server
See 


--
[...truncated 37.15 KB...]
  symbol:   class HBaseRpcController
  location: class 
org.apache.hadoop.hbase.ipc.controller.ClientRpcControllerFactory
[ERROR] 
:[52,9]
 cannot find symbol
  symbol:   class HBaseRpcController
  location: class 
org.apache.hadoop.hbase.ipc.controller.ClientRpcControllerFactory
[ERROR] 
:[180,14]
 cannot find symbol
  symbol: class MetricRegistry
[ERROR] 
:[179,7]
 method does not override or implement a method from a supertype
[ERROR] 
:[454,78]
 cannot find symbol
  symbol: class HBaseRpcController
[ERROR] 
:[432,17]
 cannot find symbol
  symbol: class HBaseRpcController
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on 
project phoenix-core: Compilation failure: Compilation failure: 
[ERROR] 
:[34,39]
 cannot find symbol
[ERROR]   symbol:   class MetricRegistry
[ERROR]   location: package org.apache.hadoop.hbase.metrics
[ERROR] 
:[144,16]
 cannot find symbol
[ERROR]   symbol:   class MetricRegistry
[ERROR]   location: class 
org.apache.phoenix.coprocessor.PhoenixMetaDataCoprocessorHost.PhoenixMetaDataControllerEnvironment
[ERROR] 
:[24,35]
 cannot find symbol
[ERROR]   symbol:   class DelegatingHBaseRpcController
[ERROR]   location: package org.apache.hadoop.hbase.ipc
[ERROR] 
:[25,35]
 cannot find symbol
[ERROR]   symbol:   class HBaseRpcController
[ERROR]   location: package org.apache.hadoop.hbase.ipc
[ERROR] 
:[37,37]
 cannot find symbol
[ERROR]   symbol: class DelegatingHBaseRpcController
[ERROR] 
:[56,38]
 cannot find symbol
[ERROR]   symbol:   class HBaseRpcController
[ERROR]   location: class 
org.apache.hadoop.hbase.ipc.controller.MetadataRpcController
[ERROR] 
:[26,35]
 cannot find symbol
[ERROR]   symbol:   class HBaseRpcController
[ERROR]   location: package org.apache.hadoop.hbase.ipc
[ERROR] 
:[40,12]
 cannot find symbol
[ERROR]   symbol:   class HBaseRpcController
[ERROR]   location: class 
org.apache.hadoop.hbase.ipc.controller.InterRegionServerMetadataRpcControllerFactory
[ERROR] 
:[46,12]
 cannot find symbol
[ERROR]   symbol:   class HBaseRpcController
[ERROR]   location: class 
org.apache.hadoop.hbase.ipc.controller.InterRegionServerMetadataRpcControllerFactory
[ERROR]