Build failed in Jenkins: Phoenix | Master #2016

2018-05-09 Thread Apache Jenkins Server
See 


Changes:

[jtaylor] PHOENIX-4732 Improve config defaults for async secondary index MR jobs

[jtaylor] PHOENIX-3856 StatementContext class constructor not honouring supplied

[jtaylor] PHOENIX-3270 Remove @Ignore tag for

[jtaylor] PHOENIX-4727 Parameterize transaction tests with TRANSACTION_PROVIDER

[jtaylor] PHOENIX-4623 Inconsistent physical view index name

[jtaylor] PHOENIX-4678 ndexScrutinyTool generates malformed query due to 
incorrect

[jtaylor] PHOENIX-4646 The data exceeds the max capacity for the data type error

--
[...truncated 75.09 KB...]
[INFO] Running org.apache.phoenix.end2end.AbsFunctionEnd2EndIT
[INFO] Running org.apache.phoenix.end2end.AggregateIT
[INFO] Running org.apache.phoenix.end2end.AlterTableWithViewsIT
[INFO] Running org.apache.phoenix.end2end.AlterMultiTenantTableWithViewsIT
[INFO] Running org.apache.phoenix.end2end.AlterTableIT
[INFO] Running org.apache.phoenix.end2end.AppendOnlySchemaIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.767 s 
- in org.apache.phoenix.end2end.AbsFunctionEnd2EndIT
[INFO] Running org.apache.phoenix.end2end.ArithmeticQueryIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 9.305 s 
- in org.apache.phoenix.end2end.AlterSessionIT
[INFO] Running org.apache.phoenix.end2end.Array1IT
[INFO] Running org.apache.phoenix.end2end.AggregateQueryIT
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 51.31 s 
- in org.apache.phoenix.end2end.AppendOnlySchemaIT
[INFO] Running org.apache.phoenix.end2end.Array2IT
[INFO] Tests run: 26, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 125.311 
s - in org.apache.phoenix.end2end.ArithmeticQueryIT
[INFO] Running org.apache.phoenix.end2end.Array3IT
[INFO] Tests run: 27, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 134.054 
s - in org.apache.phoenix.end2end.Array1IT
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 145.896 
s - in org.apache.phoenix.end2end.AlterMultiTenantTableWithViewsIT
[INFO] Running org.apache.phoenix.end2end.ArrayConcatFunctionIT
[ERROR] Tests run: 22, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 
152.422 s <<< FAILURE! - in org.apache.phoenix.end2end.AggregateIT
[ERROR] 
testAvgGroupByOrderPreservingWithStats(org.apache.phoenix.end2end.AggregateIT)  
Time elapsed: 13.252 s  <<< FAILURE!
java.lang.AssertionError: expected:<13> but was:<8>
at 
org.apache.phoenix.end2end.AggregateIT.testAvgGroupByOrderPreservingWithStats(AggregateIT.java:456)

[INFO] Tests run: 27, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 111.321 
s - in org.apache.phoenix.end2end.Array2IT
[INFO] Running org.apache.phoenix.end2end.ArrayAppendFunctionIT
[INFO] Running org.apache.phoenix.end2end.ArrayFillFunctionIT
[INFO] Running org.apache.phoenix.end2end.ArrayPrependFunctionIT
[INFO] Tests run: 26, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 114.949 
s - in org.apache.phoenix.end2end.Array3IT
[INFO] Tests run: 31, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 143.675 
s - in org.apache.phoenix.end2end.ArrayConcatFunctionIT
[INFO] Running org.apache.phoenix.end2end.ArrayRemoveFunctionIT
[INFO] Running org.apache.phoenix.end2end.ArrayToStringFunctionIT
[INFO] Tests run: 35, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 161.69 
s - in org.apache.phoenix.end2end.ArrayAppendFunctionIT
[INFO] Tests run: 26, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 146.451 
s - in org.apache.phoenix.end2end.ArrayFillFunctionIT
[INFO] Tests run: 34, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 159.883 
s - in org.apache.phoenix.end2end.ArrayPrependFunctionIT
[INFO] Running org.apache.phoenix.end2end.ArraysWithNullsIT
[INFO] Running org.apache.phoenix.end2end.AutoCommitIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.425 s 
- in org.apache.phoenix.end2end.AutoCommitIT
[INFO] Running org.apache.phoenix.end2end.BinaryRowKeyIT
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 13.138 s 
- in org.apache.phoenix.end2end.BinaryRowKeyIT
[INFO] Running org.apache.phoenix.end2end.CSVCommonsLoaderIT
[INFO] Running org.apache.phoenix.end2end.AutoPartitionViewsIT
[INFO] Tests run: 42, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 422.382 
s - in org.apache.phoenix.end2end.AggregateQueryIT
[INFO] Tests run: 28, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 143.138 
s - in org.apache.phoenix.end2end.ArrayRemoveFunctionIT
[INFO] Tests run: 16, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 70.675 
s - in org.apache.phoenix.end2end.ArraysWithNullsIT
[INFO] Running org.apache.phoenix.end2end.CbrtFunctionEnd2EndIT
[INFO] Tests run: 16, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 66.706 
s - in org.apache.phoenix.end2end.CSVCommonsLoaderIT
[INFO] Running org.apache.phoenix.end2end.CoalesceFunctionIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skippe

[12/13] phoenix git commit: PHOENIX-4733 NPE while running sql through file using psql

2018-05-09 Thread pboado
PHOENIX-4733 NPE while running sql through file using psql


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

Branch: refs/heads/4.x-cdh5.12
Commit: c892e5c7d7ac5a705452060857aceb686cb57d23
Parents: 810ed4e
Author: Ankit Singhal 
Authored: Wed May 9 22:11:58 2018 +0100
Committer: Pedro Boado 
Committed: Wed May 9 23:44:45 2018 +0100

--
 .../org/apache/phoenix/log/QueryLoggerUtil.java | 24 ++--
 1 file changed, 17 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/c892e5c7/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
index 2f22931..d5c4878 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
@@ -30,10 +30,14 @@ import com.google.common.collect.ImmutableMap.Builder;
 
 public class QueryLoggerUtil {
 
-public static void logInitialDetails(QueryLogger queryLogger, PName 
tenantId,
-ConnectionQueryServices queryServices, String query, long 
startTime, List bindParameters) {
-queryLogger.log(QueryLogState.STARTED,
-getInitialDetails(tenantId, queryServices, query, startTime, 
bindParameters));
+public static void logInitialDetails(QueryLogger queryLogger, PName 
tenantId, ConnectionQueryServices queryServices,
+String query, long startTime, List bindParameters) {
+try {
+queryLogger.log(QueryLogState.STARTED,
+getInitialDetails(tenantId, queryServices, query, 
startTime, bindParameters));
+} catch (Exception e) {
+// Ignore for now
+}
 
 }
 
@@ -46,15 +50,21 @@ public class QueryLoggerUtil {
 } catch (UnknownHostException e) {
 clientIP = "UnknownHost";
 }
-queryLogBuilder.put(QueryLogInfo.CLIENT_IP_I, clientIP);
-queryLogBuilder.put(QueryLogInfo.QUERY_I, query);
+
+if (clientIP != null) {
+queryLogBuilder.put(QueryLogInfo.CLIENT_IP_I, clientIP);
+}
+if (query != null) {
+queryLogBuilder.put(QueryLogInfo.QUERY_I, query);
+}
 queryLogBuilder.put(QueryLogInfo.START_TIME_I, startTime);
 if (bindParameters != null) {
-queryLogBuilder.put(QueryLogInfo.BIND_PARAMETERS_I, 
StringUtils.join(bindParameters,","));
+queryLogBuilder.put(QueryLogInfo.BIND_PARAMETERS_I, 
StringUtils.join(bindParameters, ","));
 }
 if (tenantId != null) {
 queryLogBuilder.put(QueryLogInfo.TENANT_ID_I, 
tenantId.getString());
 }
+
 queryLogBuilder.put(QueryLogInfo.USER_I, queryServices.getUserName() 
!= null ? queryServices.getUserName()
 : queryServices.getUser().getShortName());
 return queryLogBuilder.build();



[11/13] phoenix git commit: PHOENIX-4646 The data exceeds the max capacity for the data type error for valid scenarios (Sergey Soldatov)

2018-05-09 Thread pboado
PHOENIX-4646 The data exceeds the max capacity for the data type error for 
valid scenarios (Sergey Soldatov)


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

Branch: refs/heads/4.x-cdh5.12
Commit: 810ed4e37a24cc281c46ece4ed958e45ab458ba2
Parents: f1230c0
Author: James Taylor 
Authored: Wed May 9 13:12:26 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:40 2018 -0700

--
 .../apache/phoenix/end2end/UpsertSelectIT.java   | 19 +++
 .../apache/phoenix/schema/types/PVarchar.java| 10 ++
 2 files changed, 25 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/810ed4e3/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
index 99cbe47..5db1fdd 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
@@ -1488,6 +1488,25 @@ public class UpsertSelectIT extends 
ParallelStatsDisabledIT {
 }
 }
 
+@Test // See https://issues.apache.org/jira/browse/PHOENIX-4646
+public void testLengthLimitedVarchar() throws Exception {
+String tableName1 = generateUniqueName();
+String tableName2 = generateUniqueName();
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+conn.setAutoCommit(true);
+conn.createStatement().execute("create table " + tableName1 + 
"(name varchar(160) primary key, id varchar(120), address varchar(160))"); 
+conn.createStatement().execute("create table " + tableName2 + 
"(name varchar(160) primary key, id varchar(10), address  varchar(10))");
+conn.createStatement().execute("upsert into " + tableName1 + " 
values('test','test','test')");
+conn.createStatement().execute("upsert into " + tableName2 + " 
select * from " + tableName1);
+ResultSet rs = conn.createStatement().executeQuery("select * from 
" + tableName2);
+assertTrue(rs.next());
+assertEquals("test", rs.getString(1));
+assertEquals("test", rs.getString(2));
+assertEquals("test", rs.getString(2));
+assertFalse(rs.next());
+}
+}
+
 private static Connection getTenantConnection(String tenantId) throws 
Exception {
 Properties props = PropertiesUtil.deepCopy(TestUtil.TEST_PROPERTIES);
 props.setProperty(TENANT_ID_ATTRIB, tenantId);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/810ed4e3/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
index fb5a045..a99925c 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
@@ -102,15 +102,17 @@ public class PVarchar extends PDataType {
 SortOrder sortOrder, Integer maxLength, Integer scale,
 Integer desiredMaxLength, Integer desiredScale) {
 if (ptr.getLength() != 0 && desiredMaxLength != null) {
-if (maxLength == null) {
+if (maxLength == null || maxLength > desiredMaxLength) {
 if (value != null) { // Use value if provided
 maxLength = value.toString().length();
 } else {
-coerceBytes(ptr, value, srcType, maxLength, scale, 
sortOrder, desiredMaxLength, desiredScale, sortOrder, true);
-maxLength = StringUtil.calculateUTF8Length(ptr.get(), 
ptr.getOffset(), ptr.getLength(), sortOrder);
+coerceBytes(ptr, value, srcType, maxLength, scale, 
sortOrder, desiredMaxLength,
+desiredScale, sortOrder, true);
+maxLength = StringUtil
+.calculateUTF8Length(ptr.get(), ptr.getOffset(), 
ptr.getLength(), sortOrder);
 }
+return maxLength <= desiredMaxLength;
 }
-return maxLength <= desiredMaxLength;
 }
 return true;
 }



[08/13] phoenix git commit: PHOENIX-4727 Parameterize transaction tests with TRANSACTION_PROVIDER

2018-05-09 Thread pboado
PHOENIX-4727 Parameterize transaction tests with TRANSACTION_PROVIDER


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

Branch: refs/heads/4.x-cdh5.14
Commit: de4c348b04a344537893dcef865895409d6b61e7
Parents: 59aa56e
Author: James Taylor 
Authored: Mon May 7 18:23:03 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:40 2018 -0700

--
 .../phoenix/end2end/index/MutableIndexIT.java   | 21 +++---
 .../org/apache/phoenix/tx/TransactionIT.java| 75 +++-
 .../java/org/apache/phoenix/util/TestUtil.java  |  6 +-
 3 files changed, 74 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/de4c348b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
index 631f97f..e968e99 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
@@ -81,11 +81,11 @@ public class MutableIndexIT extends ParallelStatsDisabledIT 
{
 protected final boolean localIndex;
 private final String tableDDLOptions;

-public MutableIndexIT(boolean localIndex, boolean transactional, boolean 
columnEncoded) {
+public MutableIndexIT(Boolean localIndex, String txProvider, Boolean 
columnEncoded) {
this.localIndex = localIndex;
StringBuilder optionBuilder = new StringBuilder();
-   if (transactional) {
-   optionBuilder.append("TRANSACTIONAL=true");
+   if (txProvider != null) {
+   optionBuilder.append("TRANSACTIONAL=true," + 
PhoenixDatabaseMetaData.TRANSACTION_PROVIDER + "='" + txProvider + "'");
}
if (!columnEncoded) {
 if (optionBuilder.length()!=0)
@@ -107,12 +107,15 @@ public class MutableIndexIT extends 
ParallelStatsDisabledIT {
 }
 

@Parameters(name="MutableIndexIT_localIndex={0},transactional={1},columnEncoded={2}")
 // name is used by failsafe as file name in reports
-public static Collection data() {
-return Arrays.asList(new Boolean[][] { 
-{ false, false, false }, { false, false, true },
-{ false, true, false }, { false, true, true },
-{ true, false, false }, { true, false, true },
-{ true, true, false }, { true, true, true } });
+public static Collection data() {
+return Arrays.asList(new Object[][] { 
+{ false, null, false }, { false, null, true },
+{ false, "TEPHRA", false }, { false, "TEPHRA", true },
+//{ false, "OMID", false }, { false, "OMID", true },
+{ true, null, false }, { true, null, true },
+{ true, "TEPHRA", false }, { true, "TEPHRA", true },
+//{ true, "OMID", false }, { true, "OMID", true },
+});
 }
 
 @Test

http://git-wip-us.apache.org/repos/asf/phoenix/blob/de4c348b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
index f1344e0..c0ec6b8 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
@@ -32,6 +32,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
+import java.util.Arrays;
+import java.util.Collection;
 import java.util.Properties;
 
 import org.apache.hadoop.hbase.HColumnDescriptor;
@@ -43,6 +45,7 @@ import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.query.QueryConstants;
 import org.apache.phoenix.query.QueryServicesOptions;
+import org.apache.phoenix.schema.PTable;
 import org.apache.phoenix.schema.PTableKey;
 import org.apache.phoenix.transaction.PhoenixTransactionContext;
 import org.apache.phoenix.transaction.TransactionFactory;
@@ -52,16 +55,33 @@ import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.StringUtil;
 import org.apache.phoenix.util.TestUtil;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.

[05/13] phoenix git commit: PHOENIX-4732 Improve config defaults for async secondary index MR jobs

2018-05-09 Thread pboado
PHOENIX-4732 Improve config defaults for async secondary index MR jobs


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

Branch: refs/heads/4.x-cdh5.14
Commit: 197692686b83f45ce622f806acf3fad968e8c238
Parents: 5ee89b4
Author: James Taylor 
Authored: Tue May 8 15:26:44 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:37 2018 -0700

--
 .../index/automation/PhoenixMRJobSubmitter.java | 48 ++--
 .../apache/phoenix/util/PhoenixMRJobUtil.java   | 18 +++-
 2 files changed, 52 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/19769268/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 9c447e8..d86802a 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
@@ -45,6 +45,7 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
+import org.apache.hadoop.mapreduce.MRJobConfig;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.mapreduce.index.IndexTool;
@@ -53,8 +54,8 @@ import org.apache.phoenix.schema.PTable.IndexType;
 import org.apache.phoenix.schema.PTableType;
 import org.apache.phoenix.schema.types.PDate;
 import org.apache.phoenix.util.PhoenixMRJobUtil;
-import org.apache.phoenix.util.UpgradeUtil;
 import org.apache.phoenix.util.PhoenixMRJobUtil.MR_SCHEDULER_TYPE;
+import org.apache.phoenix.util.UpgradeUtil;
 import org.apache.phoenix.util.ZKBasedMasterElectionUtil;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONObject;
@@ -69,8 +70,28 @@ public class PhoenixMRJobSubmitter {
 // Lock to elect a master node that submits the Phoenix Secondary Index MR 
Jobs
 private static final String PHOENIX_LOCKS_PARENT =
 "/phoenix/automated-mr-index-build-leader-election";
+public static final String PHOENIX_MR_CLIENT_SCANNER_TIMEOUT_PERIOD =
+"phoenix.mr.client.scanner.timeout.period";
+public static final String PHOENIX_MR_RPC_TIMEOUT =
+"phoenix.mr.rpc.timeout";
+public static final String PHOENIX_MR_TASK_TIMEOUT =
+"phoenix.mr.task.timeout";
+public static final String PHOENIX_MR_CLIENT_RETRIES_NUMBER =
+"phoenix.mr.client.retries.number";
+public static final String PHOENIX_MR_CLIENT_PAUSE =
+"phoenix.mr.client.retries.number";
+public static final String PHOENIX_MR_ZK_RECOVERY_RETRY =
+"phoenix.mr.zk.recovery.retry";
 private static final String AUTO_INDEX_BUILD_LOCK_NAME = 
"ActiveStandbyElectorLock";
-
+private static final int DEFAULT_TIMEOUT_IN_MILLIS = 60;
+public static final int DEFAULT_MR_CLIENT_SCANNER_TIMEOUT_PERIOD = 
DEFAULT_TIMEOUT_IN_MILLIS;
+public static final int DEFAULT_MR_RPC_TIMEOUT = DEFAULT_TIMEOUT_IN_MILLIS;
+public static final int DEFAULT_MR_TASK_TIMEOUT = 
DEFAULT_TIMEOUT_IN_MILLIS;
+// Reduced HBase/Zookeeper Client Retries
+public static final int DEFAULT_MR_CLIENT_RETRIES_NUMBER = 10;
+public static final int DEFAULT_MR_CLIENT_PAUSE = 1000;
+public static final int DEFAULT_MR_ZK_RECOVERY_RETRY = 1;
+
 public static final String CANDIDATE_INDEX_INFO_QUERY = "SELECT "
 + PhoenixDatabaseMetaData.INDEX_TYPE + ","
 + PhoenixDatabaseMetaData.DATA_TABLE_NAME + ", "
@@ -103,7 +124,28 @@ public class PhoenixMRJobSubmitter {
 }
 this.conf = conf;
 
-PhoenixMRJobUtil.updateTimeoutsToFailFast(conf);
+// Have Phoenix specific properties for defaults to enable potential 
override
+conf.setLong(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD, 
+conf.getLong(PHOENIX_MR_CLIENT_SCANNER_TIMEOUT_PERIOD,
+DEFAULT_MR_CLIENT_SCANNER_TIMEOUT_PERIOD));
+conf.setLong(HConstants.HBASE_RPC_TIMEOUT_KEY, 
+conf.getLong(PHOENIX_MR_RPC_TIMEOUT,
+DEFAULT_MR_RPC_TIMEOUT));
+conf.setLong(MRJobConfig.TASK_TIMEOUT, 
+ 

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

2018-05-09 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/995577a1
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/995577a1
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/995577a1

Branch: refs/heads/4.x-cdh5.14
Commit: 995577a1661eb6bdffe87159a464280d9659b096
Parents: c892e5c
Author: Pedro Boado 
Authored: Sat Mar 10 17:54:04 2018 +
Committer: Pedro Boado 
Committed: Thu May 10 00:00:09 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/995577a1/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/995577a1/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/995577a1/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/995577a1/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/995577a1/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
 phoenix
-4.14.0-cdh5.11.2
+4.

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

2018-05-09 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/5ee89b44
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/5ee89b44
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/5ee89b44

Branch: refs/heads/4.x-cdh5.14
Commit: 5ee89b440e4394b043674a2a0379339ef14789c6
Parents: 90dc5ef
Author: Rajeshbabu Chintaguntla 
Authored: Wed May 9 18:13:38 2018 +0530
Committer: James Taylor 
Committed: Wed May 9 13:27:36 2018 -0700

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


http://git-wip-us.apache.org/repos/asf/phoenix/blob/5ee89b44/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 d80b6fc..9190373 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
@@ -26,6 +26,7 @@ import java.io.IOException;
 import java.sql.SQLException;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutorService;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -66,8 +67,6 @@ import org.apache.phoenix.hbase.index.write.IndexWriterUtils;
 import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.query.QueryServicesOptions;
 import org.apache.phoenix.schema.StaleRegionBoundaryCacheException;
-import org.jboss.netty.util.internal.ConcurrentHashMap;
-
 
 @SuppressWarnings("deprecation")
 public class ServerUtil {



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

2018-05-09 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/90dc5ef4
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/90dc5ef4
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/90dc5ef4

Branch: refs/heads/4.x-cdh5.14
Commit: 90dc5ef487d467d169551ce7410ec8a6bc8c7dbd
Parents: dde1054
Author: Rajeshbabu Chintaguntla 
Authored: Tue May 8 20:37:50 2018 +0530
Committer: James Taylor 
Committed: Wed May 9 13:27:36 2018 -0700

--
 phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/90dc5ef4/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 2dab076..d80b6fc 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
@@ -27,7 +27,6 @@ import java.sql.SQLException;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutorService;
-import java.util.function.Function;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 



[07/13] phoenix git commit: PHOENIX-3270 Remove @Ignore tag for TransactionIT.testNonTxToTxTableFailure()

2018-05-09 Thread pboado
PHOENIX-3270 Remove @Ignore tag for TransactionIT.testNonTxToTxTableFailure()


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

Branch: refs/heads/4.x-cdh5.14
Commit: 59aa56ea3f34592a25f141fdafc03d2da5b905ab
Parents: d23239f
Author: James Taylor 
Authored: Thu May 3 09:52:57 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:40 2018 -0700

--
 .../it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java  | 2 --
 1 file changed, 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/59aa56ea/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
index 580f055..ec1cf3a 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
@@ -57,7 +57,6 @@ import 
org.apache.phoenix.transaction.PhoenixTransactionContext;
 import org.apache.phoenix.util.ByteUtil;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.TestUtil;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -323,7 +322,6 @@ public class ParameterizedTransactionIT extends 
ParallelStatsDisabledIT {
 assertFalse(rs.next());
 }
 
-@Ignore
 @Test
 public void testNonTxToTxTableFailure() throws Exception {
 String nonTxTableName = generateUniqueName();



[10/13] phoenix git commit: PHOENIX-4678 ndexScrutinyTool generates malformed query due to incorrect table name(s) (Josh Elser)

2018-05-09 Thread pboado
PHOENIX-4678 ndexScrutinyTool generates malformed query due to incorrect table 
name(s) (Josh Elser)


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

Branch: refs/heads/4.x-cdh5.14
Commit: f1230c0a04e215230ec0312fe62a34841eec6eaa
Parents: 034d986
Author: James Taylor 
Authored: Wed May 9 12:50:22 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:40 2018 -0700

--
 phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f1230c0a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
--
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
index b43f54e..92a2cde 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
@@ -1132,7 +1132,7 @@ public class SchemaUtil {
  * @return the byte representation of the HTable
  */
 public static String getQualifiedTableName(String schemaName, String 
tableName) {
-if (schemaName != null) {
+if (schemaName != null && !schemaName.isEmpty()) {
 return String.format("%s.%s", normalizeIdentifier(schemaName),
 normalizeIdentifier(tableName));
 } else {



[11/13] phoenix git commit: PHOENIX-4646 The data exceeds the max capacity for the data type error for valid scenarios (Sergey Soldatov)

2018-05-09 Thread pboado
PHOENIX-4646 The data exceeds the max capacity for the data type error for 
valid scenarios (Sergey Soldatov)


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

Branch: refs/heads/4.x-cdh5.14
Commit: 810ed4e37a24cc281c46ece4ed958e45ab458ba2
Parents: f1230c0
Author: James Taylor 
Authored: Wed May 9 13:12:26 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:40 2018 -0700

--
 .../apache/phoenix/end2end/UpsertSelectIT.java   | 19 +++
 .../apache/phoenix/schema/types/PVarchar.java| 10 ++
 2 files changed, 25 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/810ed4e3/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
index 99cbe47..5db1fdd 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
@@ -1488,6 +1488,25 @@ public class UpsertSelectIT extends 
ParallelStatsDisabledIT {
 }
 }
 
+@Test // See https://issues.apache.org/jira/browse/PHOENIX-4646
+public void testLengthLimitedVarchar() throws Exception {
+String tableName1 = generateUniqueName();
+String tableName2 = generateUniqueName();
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+conn.setAutoCommit(true);
+conn.createStatement().execute("create table " + tableName1 + 
"(name varchar(160) primary key, id varchar(120), address varchar(160))"); 
+conn.createStatement().execute("create table " + tableName2 + 
"(name varchar(160) primary key, id varchar(10), address  varchar(10))");
+conn.createStatement().execute("upsert into " + tableName1 + " 
values('test','test','test')");
+conn.createStatement().execute("upsert into " + tableName2 + " 
select * from " + tableName1);
+ResultSet rs = conn.createStatement().executeQuery("select * from 
" + tableName2);
+assertTrue(rs.next());
+assertEquals("test", rs.getString(1));
+assertEquals("test", rs.getString(2));
+assertEquals("test", rs.getString(2));
+assertFalse(rs.next());
+}
+}
+
 private static Connection getTenantConnection(String tenantId) throws 
Exception {
 Properties props = PropertiesUtil.deepCopy(TestUtil.TEST_PROPERTIES);
 props.setProperty(TENANT_ID_ATTRIB, tenantId);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/810ed4e3/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
index fb5a045..a99925c 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
@@ -102,15 +102,17 @@ public class PVarchar extends PDataType {
 SortOrder sortOrder, Integer maxLength, Integer scale,
 Integer desiredMaxLength, Integer desiredScale) {
 if (ptr.getLength() != 0 && desiredMaxLength != null) {
-if (maxLength == null) {
+if (maxLength == null || maxLength > desiredMaxLength) {
 if (value != null) { // Use value if provided
 maxLength = value.toString().length();
 } else {
-coerceBytes(ptr, value, srcType, maxLength, scale, 
sortOrder, desiredMaxLength, desiredScale, sortOrder, true);
-maxLength = StringUtil.calculateUTF8Length(ptr.get(), 
ptr.getOffset(), ptr.getLength(), sortOrder);
+coerceBytes(ptr, value, srcType, maxLength, scale, 
sortOrder, desiredMaxLength,
+desiredScale, sortOrder, true);
+maxLength = StringUtil
+.calculateUTF8Length(ptr.get(), ptr.getOffset(), 
ptr.getLength(), sortOrder);
 }
+return maxLength <= desiredMaxLength;
 }
-return maxLength <= desiredMaxLength;
 }
 return true;
 }



[06/13] phoenix git commit: PHOENIX-3856 StatementContext class constructor not honouring supplied scan object (Sukumar Maddineni)

2018-05-09 Thread pboado
PHOENIX-3856 StatementContext class constructor not honouring supplied scan 
object (Sukumar Maddineni)


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

Branch: refs/heads/4.x-cdh5.14
Commit: d23239fd0acd4613c565c179f4880621300f3405
Parents: 1976926
Author: James Taylor 
Authored: Thu May 3 09:32:57 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:39 2018 -0700

--
 .../src/main/java/org/apache/phoenix/compile/StatementContext.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d23239fd/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 c105046..3e5c8f2 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
@@ -98,7 +98,7 @@ public class StatementContext {
 }
 
 public StatementContext(PhoenixStatement statement, Scan scan) {
-this(statement, FromCompiler.EMPTY_TABLE_RESOLVER, new Scan(), new 
SequenceManager(statement));
+this(statement, FromCompiler.EMPTY_TABLE_RESOLVER, scan, new 
SequenceManager(statement));
 }
 
 public StatementContext(PhoenixStatement statement, ColumnResolver 
resolver) {



[01/13] phoenix git commit: Set version to v4.14.0-cdh5.11 for release [Forced Update!]

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


Set version to v4.14.0-cdh5.11 for release


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

Branch: refs/heads/4.x-cdh5.14
Commit: 8ed7eb0f5878202d744dd3d7a08235a45adfd3bc
Parents: cf4ee4b
Author: Pedro Boado 
Authored: Wed May 2 19:07:40 2018 +0100
Committer: Pedro Boado 
Committed: Thu May 3 08:06:58 2018 +0100

--
 dev/make_rc.sh |  2 +-
 phoenix-assembly/pom.xml   |  2 +-
 phoenix-client/pom.xml |  2 +-
 phoenix-core/pom.xml   |  2 +-
 .../end2end/index/MutableIndexRebuilderIT.java | 17 +
 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|  2 +-
 18 files changed, 34 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/8ed7eb0f/dev/make_rc.sh
--
diff --git a/dev/make_rc.sh b/dev/make_rc.sh
index c5e5012..9bff7d1 100755
--- a/dev/make_rc.sh
+++ b/dev/make_rc.sh
@@ -75,7 +75,7 @@ mkdir $DIR_PYTHON;
 mv $REL_SRC.tar.gz $DIR_REL_SRC_TAR_PATH;
 
 # Copy common jars
-mvn clean apache-rat:check package -DskipTests -Dcheckstyle.skip=true -q;
+mvn clean  package -DskipTests -Dcheckstyle.skip=true -q;
 rm -rf $(find . -type d -name archive-tmp);
 
 # Copy all phoenix-*.jars to release dir

http://git-wip-us.apache.org/repos/asf/phoenix/blob/8ed7eb0f/phoenix-assembly/pom.xml
--
diff --git a/phoenix-assembly/pom.xml b/phoenix-assembly/pom.xml
index 55a9a6e..7d98c25 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-SNAPSHOT
+4.14.0-cdh5.11.2
   
   phoenix-assembly
   Phoenix Assembly

http://git-wip-us.apache.org/repos/asf/phoenix/blob/8ed7eb0f/phoenix-client/pom.xml
--
diff --git a/phoenix-client/pom.xml b/phoenix-client/pom.xml
index 2454de6..fef18c2 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-SNAPSHOT
+4.14.0-cdh5.11.2
   
   phoenix-client
   Phoenix Client

http://git-wip-us.apache.org/repos/asf/phoenix/blob/8ed7eb0f/phoenix-core/pom.xml
--
diff --git a/phoenix-core/pom.xml b/phoenix-core/pom.xml
index e1f8e2a..60c04d4 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-SNAPSHOT
+4.14.0-cdh5.11.2
   
   phoenix-core
   Phoenix Core

http://git-wip-us.apache.org/repos/asf/phoenix/blob/8ed7eb0f/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexRebuilderIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexRebuilderIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexRebuilderIT.java
index 8420f16..bb00824 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexRebuilderIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexRebuilderIT.java
@@ -1,3 +1,20 @@
+/*
+ * 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

[09/13] phoenix git commit: PHOENIX-4623 Inconsistent physical view index name

2018-05-09 Thread pboado
PHOENIX-4623 Inconsistent physical view index name


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

Branch: refs/heads/4.x-cdh5.14
Commit: 034d9867ad0a2dd1c94b26d9108f39aba1dbc024
Parents: de4c348
Author: James Taylor 
Authored: Tue May 8 16:29:41 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:40 2018 -0700

--
 .../org/apache/phoenix/end2end/BaseViewIT.java|  7 +++
 .../java/org/apache/phoenix/end2end/ViewIT.java   |  2 +-
 .../phoenix/schema/stats/StatsCollectorIT.java|  3 +--
 .../org/apache/phoenix/util/MetaDataUtil.java | 18 +-
 .../java/org/apache/phoenix/util/UpgradeUtil.java |  2 +-
 5 files changed, 11 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/034d9867/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
index 478b234..5728a20 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
@@ -46,7 +46,6 @@ import org.apache.phoenix.util.MetaDataUtil;
 import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.SchemaUtil;
-import org.apache.phoenix.util.TestUtil;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
@@ -66,7 +65,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
if (transactional) {
optionBuilder.append(" TRANSACTIONAL=true ");
}
-   this.schemaName = TestUtil.DEFAULT_SCHEMA_NAME;
+   this.schemaName = "S_" + generateUniqueName();
this.tableDDLOptions = optionBuilder.toString();
this.tableName = "T_" + generateUniqueName();
 this.fullTableName = SchemaUtil.getTableName(schemaName, tableName);
@@ -166,7 +165,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 ResultSet rs;
 Connection conn = DriverManager.getConnection(getUrl());
 String viewIndexName1 = "I_" + generateUniqueName();
-String viewIndexPhysicalName = 
MetaDataUtil.getViewIndexName(schemaName, tableName);
+String viewIndexPhysicalName = 
MetaDataUtil.getViewIndexPhysicalName(fullTableName);
 if (localIndex) {
 conn.createStatement().execute("CREATE LOCAL INDEX " + 
viewIndexName1 + " on " + viewName + "(k3)");
 } else {
@@ -231,7 +230,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 rs = conn.createStatement().executeQuery("EXPLAIN " + query);
 String physicalTableName;
 if (localIndex) {
-physicalTableName = tableName;
+physicalTableName = fullTableName;
 assertEquals("CLIENT PARALLEL "+ (saltBuckets == null ? 1 : 
saltBuckets)  +"-WAY RANGE SCAN OVER " + fullTableName +" [" + (2) + ",'foo']\n"
 + "SERVER FILTER BY FIRST KEY ONLY\n"
 + "CLIENT MERGE SORT",QueryUtil.getExplainPlan(rs));

http://git-wip-us.apache.org/repos/asf/phoenix/blob/034d9867/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
index 279bbd7..34292ba 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
@@ -69,7 +69,7 @@ public class ViewIT extends BaseViewIT {
 String ddl = "CREATE TABLE " + fullTableName + " (k INTEGER NOT NULL 
PRIMARY KEY, v1 DATE) "+ tableDDLOptions;
 conn.createStatement().execute(ddl);
 String fullParentViewName = "V_" + generateUniqueName();
-ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * 
FROM " + tableName + " WHERE k > 5";
+ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * 
FROM " + fullTableName + " WHERE k > 5";
 conn.createStatement().execute(ddl);
 try {
 conn.createStatement().execute("UPSERT INTO " + fullParentViewName 
+ " VALUES(1)");

http://git-wip-us.apache.org/repos/asf/phoenix/blob/034d9867/phoenix-core/src/it/java/org/apache/phoenix/schema

[12/13] phoenix git commit: PHOENIX-4733 NPE while running sql through file using psql

2018-05-09 Thread pboado
PHOENIX-4733 NPE while running sql through file using psql


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

Branch: refs/heads/4.x-cdh5.14
Commit: c892e5c7d7ac5a705452060857aceb686cb57d23
Parents: 810ed4e
Author: Ankit Singhal 
Authored: Wed May 9 22:11:58 2018 +0100
Committer: Pedro Boado 
Committed: Wed May 9 23:44:45 2018 +0100

--
 .../org/apache/phoenix/log/QueryLoggerUtil.java | 24 ++--
 1 file changed, 17 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/c892e5c7/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
index 2f22931..d5c4878 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
@@ -30,10 +30,14 @@ import com.google.common.collect.ImmutableMap.Builder;
 
 public class QueryLoggerUtil {
 
-public static void logInitialDetails(QueryLogger queryLogger, PName 
tenantId,
-ConnectionQueryServices queryServices, String query, long 
startTime, List bindParameters) {
-queryLogger.log(QueryLogState.STARTED,
-getInitialDetails(tenantId, queryServices, query, startTime, 
bindParameters));
+public static void logInitialDetails(QueryLogger queryLogger, PName 
tenantId, ConnectionQueryServices queryServices,
+String query, long startTime, List bindParameters) {
+try {
+queryLogger.log(QueryLogState.STARTED,
+getInitialDetails(tenantId, queryServices, query, 
startTime, bindParameters));
+} catch (Exception e) {
+// Ignore for now
+}
 
 }
 
@@ -46,15 +50,21 @@ public class QueryLoggerUtil {
 } catch (UnknownHostException e) {
 clientIP = "UnknownHost";
 }
-queryLogBuilder.put(QueryLogInfo.CLIENT_IP_I, clientIP);
-queryLogBuilder.put(QueryLogInfo.QUERY_I, query);
+
+if (clientIP != null) {
+queryLogBuilder.put(QueryLogInfo.CLIENT_IP_I, clientIP);
+}
+if (query != null) {
+queryLogBuilder.put(QueryLogInfo.QUERY_I, query);
+}
 queryLogBuilder.put(QueryLogInfo.START_TIME_I, startTime);
 if (bindParameters != null) {
-queryLogBuilder.put(QueryLogInfo.BIND_PARAMETERS_I, 
StringUtils.join(bindParameters,","));
+queryLogBuilder.put(QueryLogInfo.BIND_PARAMETERS_I, 
StringUtils.join(bindParameters, ","));
 }
 if (tenantId != null) {
 queryLogBuilder.put(QueryLogInfo.TENANT_ID_I, 
tenantId.getString());
 }
+
 queryLogBuilder.put(QueryLogInfo.USER_I, queryServices.getUserName() 
!= null ? queryServices.getUserName()
 : queryServices.getUser().getShortName());
 return queryLogBuilder.build();



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

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


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

Branch: refs/heads/4.x-cdh5.14
Commit: dde1054f34fe1784447307600d0949f35e6f475a
Parents: 8ed7eb0
Author: Rajeshbabu Chintaguntla 
Authored: Tue May 8 09:26:41 2018 +0530
Committer: James Taylor 
Committed: Wed May 9 13:27:36 2018 -0700

--
 .../DelegateRegionCoprocessorEnvironment.java   |   7 +-
 .../UngroupedAggregateRegionObserver.java   |  14 +-
 .../org/apache/phoenix/hbase/index/Indexer.java |  19 +--
 .../hbase/index/write/IndexWriterUtils.java |  27 +---
 .../index/PhoenixTransactionalIndexer.java  |  18 +--
 .../org/apache/phoenix/util/ServerUtil.java | 141 ---
 6 files changed, 142 insertions(+), 84 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/dde1054f/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionCoprocessorEnvironment.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionCoprocessorEnvironment.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionCoprocessorEnvironment.java
index 284d53c..a791f4a 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionCoprocessorEnvironment.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionCoprocessorEnvironment.java
@@ -32,6 +32,7 @@ import 
org.apache.hadoop.hbase.regionserver.RegionServerServices;
 import org.apache.phoenix.hbase.index.table.HTableFactory;
 import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr;
 import org.apache.phoenix.util.ServerUtil;
+import org.apache.phoenix.util.ServerUtil.ConnectionType;
 
 /**
  * Class to encapsulate {@link RegionCoprocessorEnvironment} for phoenix 
coprocessors. Often we
@@ -44,10 +45,10 @@ public class DelegateRegionCoprocessorEnvironment 
implements RegionCoprocessorEn
 private RegionCoprocessorEnvironment delegate;
 private HTableFactory tableFactory;
 
-public DelegateRegionCoprocessorEnvironment(Configuration config, 
RegionCoprocessorEnvironment delegate) {
-this.config = config;
+public DelegateRegionCoprocessorEnvironment(RegionCoprocessorEnvironment 
delegate, ConnectionType connectionType) {
+this.config = 
ServerUtil.ConnectionFactory.getTypeSpecificConfiguration(connectionType, 
delegate.getConfiguration());
 this.delegate = delegate;
-this.tableFactory = ServerUtil.getDelegateHTableFactory(this, config);
+this.tableFactory = ServerUtil.getDelegateHTableFactory(this, 
connectionType);
 }
 
 @Override

http://git-wip-us.apache.org/repos/asf/phoenix/blob/dde1054f/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
index 6bee65c..14213f4 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
@@ -144,6 +144,7 @@ import org.apache.phoenix.util.ReadOnlyProps;
 import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.SchemaUtil;
 import org.apache.phoenix.util.ServerUtil;
+import org.apache.phoenix.util.ServerUtil.ConnectionType;
 import org.apache.phoenix.util.StringUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -225,14 +226,7 @@ public class UngroupedAggregateRegionObserver extends 
BaseScannerRegionObserver
 
upsertSelectConfig.setClass(RpcControllerFactory.CUSTOM_CONTROLLER_CONF_KEY,
 InterRegionServerIndexRpcControllerFactory.class, 
RpcControllerFactory.class);
 
-compactionConfig = PropertiesUtil.cloneConfig(e.getConfiguration());
-// lower the number of rpc retries, so we don't hang the compaction
-compactionConfig.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER,
-
e.getConfiguration().getInt(QueryServices.METADATA_WRITE_RETRIES_NUMBER,
-QueryServicesOptions.DEFAULT_METADATA_WRITE_RETRIES_NUMBER));
-compactionConfig.setInt(HConstants.HBASE_CLIENT_PAUSE,
-
e.getConfiguration().getInt(QueryServices.METADATA_WRITE_RETRY_PAUSE,
-QueryServicesOptions.DEFAUL

[06/13] phoenix git commit: PHOENIX-3856 StatementContext class constructor not honouring supplied scan object (Sukumar Maddineni)

2018-05-09 Thread pboado
PHOENIX-3856 StatementContext class constructor not honouring supplied scan 
object (Sukumar Maddineni)


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

Branch: refs/heads/4.x-cdh5.13
Commit: d23239fd0acd4613c565c179f4880621300f3405
Parents: 1976926
Author: James Taylor 
Authored: Thu May 3 09:32:57 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:39 2018 -0700

--
 .../src/main/java/org/apache/phoenix/compile/StatementContext.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d23239fd/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 c105046..3e5c8f2 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
@@ -98,7 +98,7 @@ public class StatementContext {
 }
 
 public StatementContext(PhoenixStatement statement, Scan scan) {
-this(statement, FromCompiler.EMPTY_TABLE_RESOLVER, new Scan(), new 
SequenceManager(statement));
+this(statement, FromCompiler.EMPTY_TABLE_RESOLVER, scan, new 
SequenceManager(statement));
 }
 
 public StatementContext(PhoenixStatement statement, ColumnResolver 
resolver) {



[08/13] phoenix git commit: PHOENIX-4727 Parameterize transaction tests with TRANSACTION_PROVIDER

2018-05-09 Thread pboado
PHOENIX-4727 Parameterize transaction tests with TRANSACTION_PROVIDER


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

Branch: refs/heads/4.x-cdh5.13
Commit: de4c348b04a344537893dcef865895409d6b61e7
Parents: 59aa56e
Author: James Taylor 
Authored: Mon May 7 18:23:03 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:40 2018 -0700

--
 .../phoenix/end2end/index/MutableIndexIT.java   | 21 +++---
 .../org/apache/phoenix/tx/TransactionIT.java| 75 +++-
 .../java/org/apache/phoenix/util/TestUtil.java  |  6 +-
 3 files changed, 74 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/de4c348b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
index 631f97f..e968e99 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
@@ -81,11 +81,11 @@ public class MutableIndexIT extends ParallelStatsDisabledIT 
{
 protected final boolean localIndex;
 private final String tableDDLOptions;

-public MutableIndexIT(boolean localIndex, boolean transactional, boolean 
columnEncoded) {
+public MutableIndexIT(Boolean localIndex, String txProvider, Boolean 
columnEncoded) {
this.localIndex = localIndex;
StringBuilder optionBuilder = new StringBuilder();
-   if (transactional) {
-   optionBuilder.append("TRANSACTIONAL=true");
+   if (txProvider != null) {
+   optionBuilder.append("TRANSACTIONAL=true," + 
PhoenixDatabaseMetaData.TRANSACTION_PROVIDER + "='" + txProvider + "'");
}
if (!columnEncoded) {
 if (optionBuilder.length()!=0)
@@ -107,12 +107,15 @@ public class MutableIndexIT extends 
ParallelStatsDisabledIT {
 }
 

@Parameters(name="MutableIndexIT_localIndex={0},transactional={1},columnEncoded={2}")
 // name is used by failsafe as file name in reports
-public static Collection data() {
-return Arrays.asList(new Boolean[][] { 
-{ false, false, false }, { false, false, true },
-{ false, true, false }, { false, true, true },
-{ true, false, false }, { true, false, true },
-{ true, true, false }, { true, true, true } });
+public static Collection data() {
+return Arrays.asList(new Object[][] { 
+{ false, null, false }, { false, null, true },
+{ false, "TEPHRA", false }, { false, "TEPHRA", true },
+//{ false, "OMID", false }, { false, "OMID", true },
+{ true, null, false }, { true, null, true },
+{ true, "TEPHRA", false }, { true, "TEPHRA", true },
+//{ true, "OMID", false }, { true, "OMID", true },
+});
 }
 
 @Test

http://git-wip-us.apache.org/repos/asf/phoenix/blob/de4c348b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
index f1344e0..c0ec6b8 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
@@ -32,6 +32,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
+import java.util.Arrays;
+import java.util.Collection;
 import java.util.Properties;
 
 import org.apache.hadoop.hbase.HColumnDescriptor;
@@ -43,6 +45,7 @@ import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.query.QueryConstants;
 import org.apache.phoenix.query.QueryServicesOptions;
+import org.apache.phoenix.schema.PTable;
 import org.apache.phoenix.schema.PTableKey;
 import org.apache.phoenix.transaction.PhoenixTransactionContext;
 import org.apache.phoenix.transaction.TransactionFactory;
@@ -52,16 +55,33 @@ import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.StringUtil;
 import org.apache.phoenix.util.TestUtil;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.

[11/13] phoenix git commit: PHOENIX-4646 The data exceeds the max capacity for the data type error for valid scenarios (Sergey Soldatov)

2018-05-09 Thread pboado
PHOENIX-4646 The data exceeds the max capacity for the data type error for 
valid scenarios (Sergey Soldatov)


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

Branch: refs/heads/4.x-cdh5.13
Commit: 810ed4e37a24cc281c46ece4ed958e45ab458ba2
Parents: f1230c0
Author: James Taylor 
Authored: Wed May 9 13:12:26 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:40 2018 -0700

--
 .../apache/phoenix/end2end/UpsertSelectIT.java   | 19 +++
 .../apache/phoenix/schema/types/PVarchar.java| 10 ++
 2 files changed, 25 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/810ed4e3/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
index 99cbe47..5db1fdd 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
@@ -1488,6 +1488,25 @@ public class UpsertSelectIT extends 
ParallelStatsDisabledIT {
 }
 }
 
+@Test // See https://issues.apache.org/jira/browse/PHOENIX-4646
+public void testLengthLimitedVarchar() throws Exception {
+String tableName1 = generateUniqueName();
+String tableName2 = generateUniqueName();
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+conn.setAutoCommit(true);
+conn.createStatement().execute("create table " + tableName1 + 
"(name varchar(160) primary key, id varchar(120), address varchar(160))"); 
+conn.createStatement().execute("create table " + tableName2 + 
"(name varchar(160) primary key, id varchar(10), address  varchar(10))");
+conn.createStatement().execute("upsert into " + tableName1 + " 
values('test','test','test')");
+conn.createStatement().execute("upsert into " + tableName2 + " 
select * from " + tableName1);
+ResultSet rs = conn.createStatement().executeQuery("select * from 
" + tableName2);
+assertTrue(rs.next());
+assertEquals("test", rs.getString(1));
+assertEquals("test", rs.getString(2));
+assertEquals("test", rs.getString(2));
+assertFalse(rs.next());
+}
+}
+
 private static Connection getTenantConnection(String tenantId) throws 
Exception {
 Properties props = PropertiesUtil.deepCopy(TestUtil.TEST_PROPERTIES);
 props.setProperty(TENANT_ID_ATTRIB, tenantId);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/810ed4e3/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
index fb5a045..a99925c 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
@@ -102,15 +102,17 @@ public class PVarchar extends PDataType {
 SortOrder sortOrder, Integer maxLength, Integer scale,
 Integer desiredMaxLength, Integer desiredScale) {
 if (ptr.getLength() != 0 && desiredMaxLength != null) {
-if (maxLength == null) {
+if (maxLength == null || maxLength > desiredMaxLength) {
 if (value != null) { // Use value if provided
 maxLength = value.toString().length();
 } else {
-coerceBytes(ptr, value, srcType, maxLength, scale, 
sortOrder, desiredMaxLength, desiredScale, sortOrder, true);
-maxLength = StringUtil.calculateUTF8Length(ptr.get(), 
ptr.getOffset(), ptr.getLength(), sortOrder);
+coerceBytes(ptr, value, srcType, maxLength, scale, 
sortOrder, desiredMaxLength,
+desiredScale, sortOrder, true);
+maxLength = StringUtil
+.calculateUTF8Length(ptr.get(), ptr.getOffset(), 
ptr.getLength(), sortOrder);
 }
+return maxLength <= desiredMaxLength;
 }
-return maxLength <= desiredMaxLength;
 }
 return true;
 }



[09/13] phoenix git commit: PHOENIX-4623 Inconsistent physical view index name

2018-05-09 Thread pboado
PHOENIX-4623 Inconsistent physical view index name


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

Branch: refs/heads/4.x-cdh5.13
Commit: 034d9867ad0a2dd1c94b26d9108f39aba1dbc024
Parents: de4c348
Author: James Taylor 
Authored: Tue May 8 16:29:41 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:40 2018 -0700

--
 .../org/apache/phoenix/end2end/BaseViewIT.java|  7 +++
 .../java/org/apache/phoenix/end2end/ViewIT.java   |  2 +-
 .../phoenix/schema/stats/StatsCollectorIT.java|  3 +--
 .../org/apache/phoenix/util/MetaDataUtil.java | 18 +-
 .../java/org/apache/phoenix/util/UpgradeUtil.java |  2 +-
 5 files changed, 11 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/034d9867/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
index 478b234..5728a20 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
@@ -46,7 +46,6 @@ import org.apache.phoenix.util.MetaDataUtil;
 import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.SchemaUtil;
-import org.apache.phoenix.util.TestUtil;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
@@ -66,7 +65,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
if (transactional) {
optionBuilder.append(" TRANSACTIONAL=true ");
}
-   this.schemaName = TestUtil.DEFAULT_SCHEMA_NAME;
+   this.schemaName = "S_" + generateUniqueName();
this.tableDDLOptions = optionBuilder.toString();
this.tableName = "T_" + generateUniqueName();
 this.fullTableName = SchemaUtil.getTableName(schemaName, tableName);
@@ -166,7 +165,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 ResultSet rs;
 Connection conn = DriverManager.getConnection(getUrl());
 String viewIndexName1 = "I_" + generateUniqueName();
-String viewIndexPhysicalName = 
MetaDataUtil.getViewIndexName(schemaName, tableName);
+String viewIndexPhysicalName = 
MetaDataUtil.getViewIndexPhysicalName(fullTableName);
 if (localIndex) {
 conn.createStatement().execute("CREATE LOCAL INDEX " + 
viewIndexName1 + " on " + viewName + "(k3)");
 } else {
@@ -231,7 +230,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 rs = conn.createStatement().executeQuery("EXPLAIN " + query);
 String physicalTableName;
 if (localIndex) {
-physicalTableName = tableName;
+physicalTableName = fullTableName;
 assertEquals("CLIENT PARALLEL "+ (saltBuckets == null ? 1 : 
saltBuckets)  +"-WAY RANGE SCAN OVER " + fullTableName +" [" + (2) + ",'foo']\n"
 + "SERVER FILTER BY FIRST KEY ONLY\n"
 + "CLIENT MERGE SORT",QueryUtil.getExplainPlan(rs));

http://git-wip-us.apache.org/repos/asf/phoenix/blob/034d9867/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
index 279bbd7..34292ba 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
@@ -69,7 +69,7 @@ public class ViewIT extends BaseViewIT {
 String ddl = "CREATE TABLE " + fullTableName + " (k INTEGER NOT NULL 
PRIMARY KEY, v1 DATE) "+ tableDDLOptions;
 conn.createStatement().execute(ddl);
 String fullParentViewName = "V_" + generateUniqueName();
-ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * 
FROM " + tableName + " WHERE k > 5";
+ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * 
FROM " + fullTableName + " WHERE k > 5";
 conn.createStatement().execute(ddl);
 try {
 conn.createStatement().execute("UPSERT INTO " + fullParentViewName 
+ " VALUES(1)");

http://git-wip-us.apache.org/repos/asf/phoenix/blob/034d9867/phoenix-core/src/it/java/org/apache/phoenix/schema

[10/13] phoenix git commit: PHOENIX-4678 ndexScrutinyTool generates malformed query due to incorrect table name(s) (Josh Elser)

2018-05-09 Thread pboado
PHOENIX-4678 ndexScrutinyTool generates malformed query due to incorrect table 
name(s) (Josh Elser)


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

Branch: refs/heads/4.x-cdh5.13
Commit: f1230c0a04e215230ec0312fe62a34841eec6eaa
Parents: 034d986
Author: James Taylor 
Authored: Wed May 9 12:50:22 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:40 2018 -0700

--
 phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f1230c0a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
--
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
index b43f54e..92a2cde 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
@@ -1132,7 +1132,7 @@ public class SchemaUtil {
  * @return the byte representation of the HTable
  */
 public static String getQualifiedTableName(String schemaName, String 
tableName) {
-if (schemaName != null) {
+if (schemaName != null && !schemaName.isEmpty()) {
 return String.format("%s.%s", normalizeIdentifier(schemaName),
 normalizeIdentifier(tableName));
 } else {



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

2018-05-09 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/90dc5ef4
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/90dc5ef4
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/90dc5ef4

Branch: refs/heads/4.x-cdh5.13
Commit: 90dc5ef487d467d169551ce7410ec8a6bc8c7dbd
Parents: dde1054
Author: Rajeshbabu Chintaguntla 
Authored: Tue May 8 20:37:50 2018 +0530
Committer: James Taylor 
Committed: Wed May 9 13:27:36 2018 -0700

--
 phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/90dc5ef4/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 2dab076..d80b6fc 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
@@ -27,7 +27,6 @@ import java.sql.SQLException;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutorService;
-import java.util.function.Function;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 



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

2018-05-09 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/036adf3b
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/036adf3b
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/036adf3b

Branch: refs/heads/4.x-cdh5.13
Commit: 036adf3b8bd2a060776f5ae188c026c68d915878
Parents: c892e5c
Author: Pedro Boado 
Authored: Sat Mar 10 17:54:04 2018 +
Committer: Pedro Boado 
Committed: Wed May 9 23:58:25 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/036adf3b/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/036adf3b/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/036adf3b/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/036adf3b/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/036adf3b/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
 phoenix
-4.14.0-cdh5.11.2
+4.1

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

2018-05-09 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/5ee89b44
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/5ee89b44
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/5ee89b44

Branch: refs/heads/4.x-cdh5.13
Commit: 5ee89b440e4394b043674a2a0379339ef14789c6
Parents: 90dc5ef
Author: Rajeshbabu Chintaguntla 
Authored: Wed May 9 18:13:38 2018 +0530
Committer: James Taylor 
Committed: Wed May 9 13:27:36 2018 -0700

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


http://git-wip-us.apache.org/repos/asf/phoenix/blob/5ee89b44/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 d80b6fc..9190373 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
@@ -26,6 +26,7 @@ import java.io.IOException;
 import java.sql.SQLException;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutorService;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -66,8 +67,6 @@ import org.apache.phoenix.hbase.index.write.IndexWriterUtils;
 import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.query.QueryServicesOptions;
 import org.apache.phoenix.schema.StaleRegionBoundaryCacheException;
-import org.jboss.netty.util.internal.ConcurrentHashMap;
-
 
 @SuppressWarnings("deprecation")
 public class ServerUtil {



[01/13] phoenix git commit: Set version to v4.14.0-cdh5.11 for release [Forced Update!]

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


Set version to v4.14.0-cdh5.11 for release


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

Branch: refs/heads/4.x-cdh5.13
Commit: 8ed7eb0f5878202d744dd3d7a08235a45adfd3bc
Parents: cf4ee4b
Author: Pedro Boado 
Authored: Wed May 2 19:07:40 2018 +0100
Committer: Pedro Boado 
Committed: Thu May 3 08:06:58 2018 +0100

--
 dev/make_rc.sh |  2 +-
 phoenix-assembly/pom.xml   |  2 +-
 phoenix-client/pom.xml |  2 +-
 phoenix-core/pom.xml   |  2 +-
 .../end2end/index/MutableIndexRebuilderIT.java | 17 +
 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|  2 +-
 18 files changed, 34 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/8ed7eb0f/dev/make_rc.sh
--
diff --git a/dev/make_rc.sh b/dev/make_rc.sh
index c5e5012..9bff7d1 100755
--- a/dev/make_rc.sh
+++ b/dev/make_rc.sh
@@ -75,7 +75,7 @@ mkdir $DIR_PYTHON;
 mv $REL_SRC.tar.gz $DIR_REL_SRC_TAR_PATH;
 
 # Copy common jars
-mvn clean apache-rat:check package -DskipTests -Dcheckstyle.skip=true -q;
+mvn clean  package -DskipTests -Dcheckstyle.skip=true -q;
 rm -rf $(find . -type d -name archive-tmp);
 
 # Copy all phoenix-*.jars to release dir

http://git-wip-us.apache.org/repos/asf/phoenix/blob/8ed7eb0f/phoenix-assembly/pom.xml
--
diff --git a/phoenix-assembly/pom.xml b/phoenix-assembly/pom.xml
index 55a9a6e..7d98c25 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-SNAPSHOT
+4.14.0-cdh5.11.2
   
   phoenix-assembly
   Phoenix Assembly

http://git-wip-us.apache.org/repos/asf/phoenix/blob/8ed7eb0f/phoenix-client/pom.xml
--
diff --git a/phoenix-client/pom.xml b/phoenix-client/pom.xml
index 2454de6..fef18c2 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-SNAPSHOT
+4.14.0-cdh5.11.2
   
   phoenix-client
   Phoenix Client

http://git-wip-us.apache.org/repos/asf/phoenix/blob/8ed7eb0f/phoenix-core/pom.xml
--
diff --git a/phoenix-core/pom.xml b/phoenix-core/pom.xml
index e1f8e2a..60c04d4 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-SNAPSHOT
+4.14.0-cdh5.11.2
   
   phoenix-core
   Phoenix Core

http://git-wip-us.apache.org/repos/asf/phoenix/blob/8ed7eb0f/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexRebuilderIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexRebuilderIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexRebuilderIT.java
index 8420f16..bb00824 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexRebuilderIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexRebuilderIT.java
@@ -1,3 +1,20 @@
+/*
+ * 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

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

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


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

Branch: refs/heads/4.x-cdh5.13
Commit: dde1054f34fe1784447307600d0949f35e6f475a
Parents: 8ed7eb0
Author: Rajeshbabu Chintaguntla 
Authored: Tue May 8 09:26:41 2018 +0530
Committer: James Taylor 
Committed: Wed May 9 13:27:36 2018 -0700

--
 .../DelegateRegionCoprocessorEnvironment.java   |   7 +-
 .../UngroupedAggregateRegionObserver.java   |  14 +-
 .../org/apache/phoenix/hbase/index/Indexer.java |  19 +--
 .../hbase/index/write/IndexWriterUtils.java |  27 +---
 .../index/PhoenixTransactionalIndexer.java  |  18 +--
 .../org/apache/phoenix/util/ServerUtil.java | 141 ---
 6 files changed, 142 insertions(+), 84 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/dde1054f/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionCoprocessorEnvironment.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionCoprocessorEnvironment.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionCoprocessorEnvironment.java
index 284d53c..a791f4a 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionCoprocessorEnvironment.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionCoprocessorEnvironment.java
@@ -32,6 +32,7 @@ import 
org.apache.hadoop.hbase.regionserver.RegionServerServices;
 import org.apache.phoenix.hbase.index.table.HTableFactory;
 import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr;
 import org.apache.phoenix.util.ServerUtil;
+import org.apache.phoenix.util.ServerUtil.ConnectionType;
 
 /**
  * Class to encapsulate {@link RegionCoprocessorEnvironment} for phoenix 
coprocessors. Often we
@@ -44,10 +45,10 @@ public class DelegateRegionCoprocessorEnvironment 
implements RegionCoprocessorEn
 private RegionCoprocessorEnvironment delegate;
 private HTableFactory tableFactory;
 
-public DelegateRegionCoprocessorEnvironment(Configuration config, 
RegionCoprocessorEnvironment delegate) {
-this.config = config;
+public DelegateRegionCoprocessorEnvironment(RegionCoprocessorEnvironment 
delegate, ConnectionType connectionType) {
+this.config = 
ServerUtil.ConnectionFactory.getTypeSpecificConfiguration(connectionType, 
delegate.getConfiguration());
 this.delegate = delegate;
-this.tableFactory = ServerUtil.getDelegateHTableFactory(this, config);
+this.tableFactory = ServerUtil.getDelegateHTableFactory(this, 
connectionType);
 }
 
 @Override

http://git-wip-us.apache.org/repos/asf/phoenix/blob/dde1054f/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
index 6bee65c..14213f4 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
@@ -144,6 +144,7 @@ import org.apache.phoenix.util.ReadOnlyProps;
 import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.SchemaUtil;
 import org.apache.phoenix.util.ServerUtil;
+import org.apache.phoenix.util.ServerUtil.ConnectionType;
 import org.apache.phoenix.util.StringUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -225,14 +226,7 @@ public class UngroupedAggregateRegionObserver extends 
BaseScannerRegionObserver
 
upsertSelectConfig.setClass(RpcControllerFactory.CUSTOM_CONTROLLER_CONF_KEY,
 InterRegionServerIndexRpcControllerFactory.class, 
RpcControllerFactory.class);
 
-compactionConfig = PropertiesUtil.cloneConfig(e.getConfiguration());
-// lower the number of rpc retries, so we don't hang the compaction
-compactionConfig.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER,
-
e.getConfiguration().getInt(QueryServices.METADATA_WRITE_RETRIES_NUMBER,
-QueryServicesOptions.DEFAULT_METADATA_WRITE_RETRIES_NUMBER));
-compactionConfig.setInt(HConstants.HBASE_CLIENT_PAUSE,
-
e.getConfiguration().getInt(QueryServices.METADATA_WRITE_RETRY_PAUSE,
-QueryServicesOptions.DEFAUL

[12/13] phoenix git commit: PHOENIX-4733 NPE while running sql through file using psql

2018-05-09 Thread pboado
PHOENIX-4733 NPE while running sql through file using psql


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

Branch: refs/heads/4.x-cdh5.13
Commit: c892e5c7d7ac5a705452060857aceb686cb57d23
Parents: 810ed4e
Author: Ankit Singhal 
Authored: Wed May 9 22:11:58 2018 +0100
Committer: Pedro Boado 
Committed: Wed May 9 23:44:45 2018 +0100

--
 .../org/apache/phoenix/log/QueryLoggerUtil.java | 24 ++--
 1 file changed, 17 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/c892e5c7/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
index 2f22931..d5c4878 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
@@ -30,10 +30,14 @@ import com.google.common.collect.ImmutableMap.Builder;
 
 public class QueryLoggerUtil {
 
-public static void logInitialDetails(QueryLogger queryLogger, PName 
tenantId,
-ConnectionQueryServices queryServices, String query, long 
startTime, List bindParameters) {
-queryLogger.log(QueryLogState.STARTED,
-getInitialDetails(tenantId, queryServices, query, startTime, 
bindParameters));
+public static void logInitialDetails(QueryLogger queryLogger, PName 
tenantId, ConnectionQueryServices queryServices,
+String query, long startTime, List bindParameters) {
+try {
+queryLogger.log(QueryLogState.STARTED,
+getInitialDetails(tenantId, queryServices, query, 
startTime, bindParameters));
+} catch (Exception e) {
+// Ignore for now
+}
 
 }
 
@@ -46,15 +50,21 @@ public class QueryLoggerUtil {
 } catch (UnknownHostException e) {
 clientIP = "UnknownHost";
 }
-queryLogBuilder.put(QueryLogInfo.CLIENT_IP_I, clientIP);
-queryLogBuilder.put(QueryLogInfo.QUERY_I, query);
+
+if (clientIP != null) {
+queryLogBuilder.put(QueryLogInfo.CLIENT_IP_I, clientIP);
+}
+if (query != null) {
+queryLogBuilder.put(QueryLogInfo.QUERY_I, query);
+}
 queryLogBuilder.put(QueryLogInfo.START_TIME_I, startTime);
 if (bindParameters != null) {
-queryLogBuilder.put(QueryLogInfo.BIND_PARAMETERS_I, 
StringUtils.join(bindParameters,","));
+queryLogBuilder.put(QueryLogInfo.BIND_PARAMETERS_I, 
StringUtils.join(bindParameters, ","));
 }
 if (tenantId != null) {
 queryLogBuilder.put(QueryLogInfo.TENANT_ID_I, 
tenantId.getString());
 }
+
 queryLogBuilder.put(QueryLogInfo.USER_I, queryServices.getUserName() 
!= null ? queryServices.getUserName()
 : queryServices.getUser().getShortName());
 return queryLogBuilder.build();



[05/13] phoenix git commit: PHOENIX-4732 Improve config defaults for async secondary index MR jobs

2018-05-09 Thread pboado
PHOENIX-4732 Improve config defaults for async secondary index MR jobs


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

Branch: refs/heads/4.x-cdh5.13
Commit: 197692686b83f45ce622f806acf3fad968e8c238
Parents: 5ee89b4
Author: James Taylor 
Authored: Tue May 8 15:26:44 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:37 2018 -0700

--
 .../index/automation/PhoenixMRJobSubmitter.java | 48 ++--
 .../apache/phoenix/util/PhoenixMRJobUtil.java   | 18 +++-
 2 files changed, 52 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/19769268/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 9c447e8..d86802a 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
@@ -45,6 +45,7 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
+import org.apache.hadoop.mapreduce.MRJobConfig;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.mapreduce.index.IndexTool;
@@ -53,8 +54,8 @@ import org.apache.phoenix.schema.PTable.IndexType;
 import org.apache.phoenix.schema.PTableType;
 import org.apache.phoenix.schema.types.PDate;
 import org.apache.phoenix.util.PhoenixMRJobUtil;
-import org.apache.phoenix.util.UpgradeUtil;
 import org.apache.phoenix.util.PhoenixMRJobUtil.MR_SCHEDULER_TYPE;
+import org.apache.phoenix.util.UpgradeUtil;
 import org.apache.phoenix.util.ZKBasedMasterElectionUtil;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONObject;
@@ -69,8 +70,28 @@ public class PhoenixMRJobSubmitter {
 // Lock to elect a master node that submits the Phoenix Secondary Index MR 
Jobs
 private static final String PHOENIX_LOCKS_PARENT =
 "/phoenix/automated-mr-index-build-leader-election";
+public static final String PHOENIX_MR_CLIENT_SCANNER_TIMEOUT_PERIOD =
+"phoenix.mr.client.scanner.timeout.period";
+public static final String PHOENIX_MR_RPC_TIMEOUT =
+"phoenix.mr.rpc.timeout";
+public static final String PHOENIX_MR_TASK_TIMEOUT =
+"phoenix.mr.task.timeout";
+public static final String PHOENIX_MR_CLIENT_RETRIES_NUMBER =
+"phoenix.mr.client.retries.number";
+public static final String PHOENIX_MR_CLIENT_PAUSE =
+"phoenix.mr.client.retries.number";
+public static final String PHOENIX_MR_ZK_RECOVERY_RETRY =
+"phoenix.mr.zk.recovery.retry";
 private static final String AUTO_INDEX_BUILD_LOCK_NAME = 
"ActiveStandbyElectorLock";
-
+private static final int DEFAULT_TIMEOUT_IN_MILLIS = 60;
+public static final int DEFAULT_MR_CLIENT_SCANNER_TIMEOUT_PERIOD = 
DEFAULT_TIMEOUT_IN_MILLIS;
+public static final int DEFAULT_MR_RPC_TIMEOUT = DEFAULT_TIMEOUT_IN_MILLIS;
+public static final int DEFAULT_MR_TASK_TIMEOUT = 
DEFAULT_TIMEOUT_IN_MILLIS;
+// Reduced HBase/Zookeeper Client Retries
+public static final int DEFAULT_MR_CLIENT_RETRIES_NUMBER = 10;
+public static final int DEFAULT_MR_CLIENT_PAUSE = 1000;
+public static final int DEFAULT_MR_ZK_RECOVERY_RETRY = 1;
+
 public static final String CANDIDATE_INDEX_INFO_QUERY = "SELECT "
 + PhoenixDatabaseMetaData.INDEX_TYPE + ","
 + PhoenixDatabaseMetaData.DATA_TABLE_NAME + ", "
@@ -103,7 +124,28 @@ public class PhoenixMRJobSubmitter {
 }
 this.conf = conf;
 
-PhoenixMRJobUtil.updateTimeoutsToFailFast(conf);
+// Have Phoenix specific properties for defaults to enable potential 
override
+conf.setLong(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD, 
+conf.getLong(PHOENIX_MR_CLIENT_SCANNER_TIMEOUT_PERIOD,
+DEFAULT_MR_CLIENT_SCANNER_TIMEOUT_PERIOD));
+conf.setLong(HConstants.HBASE_RPC_TIMEOUT_KEY, 
+conf.getLong(PHOENIX_MR_RPC_TIMEOUT,
+DEFAULT_MR_RPC_TIMEOUT));
+conf.setLong(MRJobConfig.TASK_TIMEOUT, 
+ 

[07/13] phoenix git commit: PHOENIX-3270 Remove @Ignore tag for TransactionIT.testNonTxToTxTableFailure()

2018-05-09 Thread pboado
PHOENIX-3270 Remove @Ignore tag for TransactionIT.testNonTxToTxTableFailure()


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

Branch: refs/heads/4.x-cdh5.13
Commit: 59aa56ea3f34592a25f141fdafc03d2da5b905ab
Parents: d23239f
Author: James Taylor 
Authored: Thu May 3 09:52:57 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:40 2018 -0700

--
 .../it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java  | 2 --
 1 file changed, 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/59aa56ea/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
index 580f055..ec1cf3a 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
@@ -57,7 +57,6 @@ import 
org.apache.phoenix.transaction.PhoenixTransactionContext;
 import org.apache.phoenix.util.ByteUtil;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.TestUtil;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -323,7 +322,6 @@ public class ParameterizedTransactionIT extends 
ParallelStatsDisabledIT {
 assertFalse(rs.next());
 }
 
-@Ignore
 @Test
 public void testNonTxToTxTableFailure() throws Exception {
 String nonTxTableName = generateUniqueName();



[05/13] phoenix git commit: PHOENIX-4732 Improve config defaults for async secondary index MR jobs

2018-05-09 Thread pboado
PHOENIX-4732 Improve config defaults for async secondary index MR jobs


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

Branch: refs/heads/4.x-cdh5.12
Commit: 197692686b83f45ce622f806acf3fad968e8c238
Parents: 5ee89b4
Author: James Taylor 
Authored: Tue May 8 15:26:44 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:37 2018 -0700

--
 .../index/automation/PhoenixMRJobSubmitter.java | 48 ++--
 .../apache/phoenix/util/PhoenixMRJobUtil.java   | 18 +++-
 2 files changed, 52 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/19769268/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 9c447e8..d86802a 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
@@ -45,6 +45,7 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
+import org.apache.hadoop.mapreduce.MRJobConfig;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.mapreduce.index.IndexTool;
@@ -53,8 +54,8 @@ import org.apache.phoenix.schema.PTable.IndexType;
 import org.apache.phoenix.schema.PTableType;
 import org.apache.phoenix.schema.types.PDate;
 import org.apache.phoenix.util.PhoenixMRJobUtil;
-import org.apache.phoenix.util.UpgradeUtil;
 import org.apache.phoenix.util.PhoenixMRJobUtil.MR_SCHEDULER_TYPE;
+import org.apache.phoenix.util.UpgradeUtil;
 import org.apache.phoenix.util.ZKBasedMasterElectionUtil;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONObject;
@@ -69,8 +70,28 @@ public class PhoenixMRJobSubmitter {
 // Lock to elect a master node that submits the Phoenix Secondary Index MR 
Jobs
 private static final String PHOENIX_LOCKS_PARENT =
 "/phoenix/automated-mr-index-build-leader-election";
+public static final String PHOENIX_MR_CLIENT_SCANNER_TIMEOUT_PERIOD =
+"phoenix.mr.client.scanner.timeout.period";
+public static final String PHOENIX_MR_RPC_TIMEOUT =
+"phoenix.mr.rpc.timeout";
+public static final String PHOENIX_MR_TASK_TIMEOUT =
+"phoenix.mr.task.timeout";
+public static final String PHOENIX_MR_CLIENT_RETRIES_NUMBER =
+"phoenix.mr.client.retries.number";
+public static final String PHOENIX_MR_CLIENT_PAUSE =
+"phoenix.mr.client.retries.number";
+public static final String PHOENIX_MR_ZK_RECOVERY_RETRY =
+"phoenix.mr.zk.recovery.retry";
 private static final String AUTO_INDEX_BUILD_LOCK_NAME = 
"ActiveStandbyElectorLock";
-
+private static final int DEFAULT_TIMEOUT_IN_MILLIS = 60;
+public static final int DEFAULT_MR_CLIENT_SCANNER_TIMEOUT_PERIOD = 
DEFAULT_TIMEOUT_IN_MILLIS;
+public static final int DEFAULT_MR_RPC_TIMEOUT = DEFAULT_TIMEOUT_IN_MILLIS;
+public static final int DEFAULT_MR_TASK_TIMEOUT = 
DEFAULT_TIMEOUT_IN_MILLIS;
+// Reduced HBase/Zookeeper Client Retries
+public static final int DEFAULT_MR_CLIENT_RETRIES_NUMBER = 10;
+public static final int DEFAULT_MR_CLIENT_PAUSE = 1000;
+public static final int DEFAULT_MR_ZK_RECOVERY_RETRY = 1;
+
 public static final String CANDIDATE_INDEX_INFO_QUERY = "SELECT "
 + PhoenixDatabaseMetaData.INDEX_TYPE + ","
 + PhoenixDatabaseMetaData.DATA_TABLE_NAME + ", "
@@ -103,7 +124,28 @@ public class PhoenixMRJobSubmitter {
 }
 this.conf = conf;
 
-PhoenixMRJobUtil.updateTimeoutsToFailFast(conf);
+// Have Phoenix specific properties for defaults to enable potential 
override
+conf.setLong(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD, 
+conf.getLong(PHOENIX_MR_CLIENT_SCANNER_TIMEOUT_PERIOD,
+DEFAULT_MR_CLIENT_SCANNER_TIMEOUT_PERIOD));
+conf.setLong(HConstants.HBASE_RPC_TIMEOUT_KEY, 
+conf.getLong(PHOENIX_MR_RPC_TIMEOUT,
+DEFAULT_MR_RPC_TIMEOUT));
+conf.setLong(MRJobConfig.TASK_TIMEOUT, 
+ 

[01/13] phoenix git commit: Set version to v4.14.0-cdh5.11 for release [Forced Update!]

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


Set version to v4.14.0-cdh5.11 for release


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

Branch: refs/heads/4.x-cdh5.12
Commit: 8ed7eb0f5878202d744dd3d7a08235a45adfd3bc
Parents: cf4ee4b
Author: Pedro Boado 
Authored: Wed May 2 19:07:40 2018 +0100
Committer: Pedro Boado 
Committed: Thu May 3 08:06:58 2018 +0100

--
 dev/make_rc.sh |  2 +-
 phoenix-assembly/pom.xml   |  2 +-
 phoenix-client/pom.xml |  2 +-
 phoenix-core/pom.xml   |  2 +-
 .../end2end/index/MutableIndexRebuilderIT.java | 17 +
 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|  2 +-
 18 files changed, 34 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/8ed7eb0f/dev/make_rc.sh
--
diff --git a/dev/make_rc.sh b/dev/make_rc.sh
index c5e5012..9bff7d1 100755
--- a/dev/make_rc.sh
+++ b/dev/make_rc.sh
@@ -75,7 +75,7 @@ mkdir $DIR_PYTHON;
 mv $REL_SRC.tar.gz $DIR_REL_SRC_TAR_PATH;
 
 # Copy common jars
-mvn clean apache-rat:check package -DskipTests -Dcheckstyle.skip=true -q;
+mvn clean  package -DskipTests -Dcheckstyle.skip=true -q;
 rm -rf $(find . -type d -name archive-tmp);
 
 # Copy all phoenix-*.jars to release dir

http://git-wip-us.apache.org/repos/asf/phoenix/blob/8ed7eb0f/phoenix-assembly/pom.xml
--
diff --git a/phoenix-assembly/pom.xml b/phoenix-assembly/pom.xml
index 55a9a6e..7d98c25 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-SNAPSHOT
+4.14.0-cdh5.11.2
   
   phoenix-assembly
   Phoenix Assembly

http://git-wip-us.apache.org/repos/asf/phoenix/blob/8ed7eb0f/phoenix-client/pom.xml
--
diff --git a/phoenix-client/pom.xml b/phoenix-client/pom.xml
index 2454de6..fef18c2 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-SNAPSHOT
+4.14.0-cdh5.11.2
   
   phoenix-client
   Phoenix Client

http://git-wip-us.apache.org/repos/asf/phoenix/blob/8ed7eb0f/phoenix-core/pom.xml
--
diff --git a/phoenix-core/pom.xml b/phoenix-core/pom.xml
index e1f8e2a..60c04d4 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-SNAPSHOT
+4.14.0-cdh5.11.2
   
   phoenix-core
   Phoenix Core

http://git-wip-us.apache.org/repos/asf/phoenix/blob/8ed7eb0f/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexRebuilderIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexRebuilderIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexRebuilderIT.java
index 8420f16..bb00824 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexRebuilderIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexRebuilderIT.java
@@ -1,3 +1,20 @@
+/*
+ * 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

[07/13] phoenix git commit: PHOENIX-3270 Remove @Ignore tag for TransactionIT.testNonTxToTxTableFailure()

2018-05-09 Thread pboado
PHOENIX-3270 Remove @Ignore tag for TransactionIT.testNonTxToTxTableFailure()


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

Branch: refs/heads/4.x-cdh5.12
Commit: 59aa56ea3f34592a25f141fdafc03d2da5b905ab
Parents: d23239f
Author: James Taylor 
Authored: Thu May 3 09:52:57 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:40 2018 -0700

--
 .../it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java  | 2 --
 1 file changed, 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/59aa56ea/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
index 580f055..ec1cf3a 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
@@ -57,7 +57,6 @@ import 
org.apache.phoenix.transaction.PhoenixTransactionContext;
 import org.apache.phoenix.util.ByteUtil;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.TestUtil;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -323,7 +322,6 @@ public class ParameterizedTransactionIT extends 
ParallelStatsDisabledIT {
 assertFalse(rs.next());
 }
 
-@Ignore
 @Test
 public void testNonTxToTxTableFailure() throws Exception {
 String nonTxTableName = generateUniqueName();



[06/13] phoenix git commit: PHOENIX-3856 StatementContext class constructor not honouring supplied scan object (Sukumar Maddineni)

2018-05-09 Thread pboado
PHOENIX-3856 StatementContext class constructor not honouring supplied scan 
object (Sukumar Maddineni)


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

Branch: refs/heads/4.x-cdh5.12
Commit: d23239fd0acd4613c565c179f4880621300f3405
Parents: 1976926
Author: James Taylor 
Authored: Thu May 3 09:32:57 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:39 2018 -0700

--
 .../src/main/java/org/apache/phoenix/compile/StatementContext.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d23239fd/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 c105046..3e5c8f2 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
@@ -98,7 +98,7 @@ public class StatementContext {
 }
 
 public StatementContext(PhoenixStatement statement, Scan scan) {
-this(statement, FromCompiler.EMPTY_TABLE_RESOLVER, new Scan(), new 
SequenceManager(statement));
+this(statement, FromCompiler.EMPTY_TABLE_RESOLVER, scan, new 
SequenceManager(statement));
 }
 
 public StatementContext(PhoenixStatement statement, ColumnResolver 
resolver) {



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

2018-05-09 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/90dc5ef4
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/90dc5ef4
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/90dc5ef4

Branch: refs/heads/4.x-cdh5.12
Commit: 90dc5ef487d467d169551ce7410ec8a6bc8c7dbd
Parents: dde1054
Author: Rajeshbabu Chintaguntla 
Authored: Tue May 8 20:37:50 2018 +0530
Committer: James Taylor 
Committed: Wed May 9 13:27:36 2018 -0700

--
 phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/90dc5ef4/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 2dab076..d80b6fc 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
@@ -27,7 +27,6 @@ import java.sql.SQLException;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutorService;
-import java.util.function.Function;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 



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

2018-05-09 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/5ee89b44
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/5ee89b44
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/5ee89b44

Branch: refs/heads/4.x-cdh5.12
Commit: 5ee89b440e4394b043674a2a0379339ef14789c6
Parents: 90dc5ef
Author: Rajeshbabu Chintaguntla 
Authored: Wed May 9 18:13:38 2018 +0530
Committer: James Taylor 
Committed: Wed May 9 13:27:36 2018 -0700

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


http://git-wip-us.apache.org/repos/asf/phoenix/blob/5ee89b44/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 d80b6fc..9190373 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
@@ -26,6 +26,7 @@ import java.io.IOException;
 import java.sql.SQLException;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutorService;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -66,8 +67,6 @@ import org.apache.phoenix.hbase.index.write.IndexWriterUtils;
 import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.query.QueryServicesOptions;
 import org.apache.phoenix.schema.StaleRegionBoundaryCacheException;
-import org.jboss.netty.util.internal.ConcurrentHashMap;
-
 
 @SuppressWarnings("deprecation")
 public class ServerUtil {



[08/13] phoenix git commit: PHOENIX-4727 Parameterize transaction tests with TRANSACTION_PROVIDER

2018-05-09 Thread pboado
PHOENIX-4727 Parameterize transaction tests with TRANSACTION_PROVIDER


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

Branch: refs/heads/4.x-cdh5.12
Commit: de4c348b04a344537893dcef865895409d6b61e7
Parents: 59aa56e
Author: James Taylor 
Authored: Mon May 7 18:23:03 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:40 2018 -0700

--
 .../phoenix/end2end/index/MutableIndexIT.java   | 21 +++---
 .../org/apache/phoenix/tx/TransactionIT.java| 75 +++-
 .../java/org/apache/phoenix/util/TestUtil.java  |  6 +-
 3 files changed, 74 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/de4c348b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
index 631f97f..e968e99 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
@@ -81,11 +81,11 @@ public class MutableIndexIT extends ParallelStatsDisabledIT 
{
 protected final boolean localIndex;
 private final String tableDDLOptions;

-public MutableIndexIT(boolean localIndex, boolean transactional, boolean 
columnEncoded) {
+public MutableIndexIT(Boolean localIndex, String txProvider, Boolean 
columnEncoded) {
this.localIndex = localIndex;
StringBuilder optionBuilder = new StringBuilder();
-   if (transactional) {
-   optionBuilder.append("TRANSACTIONAL=true");
+   if (txProvider != null) {
+   optionBuilder.append("TRANSACTIONAL=true," + 
PhoenixDatabaseMetaData.TRANSACTION_PROVIDER + "='" + txProvider + "'");
}
if (!columnEncoded) {
 if (optionBuilder.length()!=0)
@@ -107,12 +107,15 @@ public class MutableIndexIT extends 
ParallelStatsDisabledIT {
 }
 

@Parameters(name="MutableIndexIT_localIndex={0},transactional={1},columnEncoded={2}")
 // name is used by failsafe as file name in reports
-public static Collection data() {
-return Arrays.asList(new Boolean[][] { 
-{ false, false, false }, { false, false, true },
-{ false, true, false }, { false, true, true },
-{ true, false, false }, { true, false, true },
-{ true, true, false }, { true, true, true } });
+public static Collection data() {
+return Arrays.asList(new Object[][] { 
+{ false, null, false }, { false, null, true },
+{ false, "TEPHRA", false }, { false, "TEPHRA", true },
+//{ false, "OMID", false }, { false, "OMID", true },
+{ true, null, false }, { true, null, true },
+{ true, "TEPHRA", false }, { true, "TEPHRA", true },
+//{ true, "OMID", false }, { true, "OMID", true },
+});
 }
 
 @Test

http://git-wip-us.apache.org/repos/asf/phoenix/blob/de4c348b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
index f1344e0..c0ec6b8 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
@@ -32,6 +32,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
+import java.util.Arrays;
+import java.util.Collection;
 import java.util.Properties;
 
 import org.apache.hadoop.hbase.HColumnDescriptor;
@@ -43,6 +45,7 @@ import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.query.QueryConstants;
 import org.apache.phoenix.query.QueryServicesOptions;
+import org.apache.phoenix.schema.PTable;
 import org.apache.phoenix.schema.PTableKey;
 import org.apache.phoenix.transaction.PhoenixTransactionContext;
 import org.apache.phoenix.transaction.TransactionFactory;
@@ -52,16 +55,33 @@ import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.StringUtil;
 import org.apache.phoenix.util.TestUtil;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.

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

2018-05-09 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/34d7e84f
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/34d7e84f
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/34d7e84f

Branch: refs/heads/4.x-cdh5.12
Commit: 34d7e84fdaab3aeac11b62fad51b41529f78e012
Parents: c892e5c
Author: Pedro Boado 
Authored: Sat Mar 10 17:54:04 2018 +
Committer: Pedro Boado 
Committed: Wed May 9 23:56:37 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/34d7e84f/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/34d7e84f/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/34d7e84f/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/34d7e84f/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/34d7e84f/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
 phoenix
-4.14.0-cdh5.11.2
+4.1

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

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


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

Branch: refs/heads/4.x-cdh5.12
Commit: dde1054f34fe1784447307600d0949f35e6f475a
Parents: 8ed7eb0
Author: Rajeshbabu Chintaguntla 
Authored: Tue May 8 09:26:41 2018 +0530
Committer: James Taylor 
Committed: Wed May 9 13:27:36 2018 -0700

--
 .../DelegateRegionCoprocessorEnvironment.java   |   7 +-
 .../UngroupedAggregateRegionObserver.java   |  14 +-
 .../org/apache/phoenix/hbase/index/Indexer.java |  19 +--
 .../hbase/index/write/IndexWriterUtils.java |  27 +---
 .../index/PhoenixTransactionalIndexer.java  |  18 +--
 .../org/apache/phoenix/util/ServerUtil.java | 141 ---
 6 files changed, 142 insertions(+), 84 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/dde1054f/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionCoprocessorEnvironment.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionCoprocessorEnvironment.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionCoprocessorEnvironment.java
index 284d53c..a791f4a 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionCoprocessorEnvironment.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionCoprocessorEnvironment.java
@@ -32,6 +32,7 @@ import 
org.apache.hadoop.hbase.regionserver.RegionServerServices;
 import org.apache.phoenix.hbase.index.table.HTableFactory;
 import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr;
 import org.apache.phoenix.util.ServerUtil;
+import org.apache.phoenix.util.ServerUtil.ConnectionType;
 
 /**
  * Class to encapsulate {@link RegionCoprocessorEnvironment} for phoenix 
coprocessors. Often we
@@ -44,10 +45,10 @@ public class DelegateRegionCoprocessorEnvironment 
implements RegionCoprocessorEn
 private RegionCoprocessorEnvironment delegate;
 private HTableFactory tableFactory;
 
-public DelegateRegionCoprocessorEnvironment(Configuration config, 
RegionCoprocessorEnvironment delegate) {
-this.config = config;
+public DelegateRegionCoprocessorEnvironment(RegionCoprocessorEnvironment 
delegate, ConnectionType connectionType) {
+this.config = 
ServerUtil.ConnectionFactory.getTypeSpecificConfiguration(connectionType, 
delegate.getConfiguration());
 this.delegate = delegate;
-this.tableFactory = ServerUtil.getDelegateHTableFactory(this, config);
+this.tableFactory = ServerUtil.getDelegateHTableFactory(this, 
connectionType);
 }
 
 @Override

http://git-wip-us.apache.org/repos/asf/phoenix/blob/dde1054f/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
index 6bee65c..14213f4 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
@@ -144,6 +144,7 @@ import org.apache.phoenix.util.ReadOnlyProps;
 import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.SchemaUtil;
 import org.apache.phoenix.util.ServerUtil;
+import org.apache.phoenix.util.ServerUtil.ConnectionType;
 import org.apache.phoenix.util.StringUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -225,14 +226,7 @@ public class UngroupedAggregateRegionObserver extends 
BaseScannerRegionObserver
 
upsertSelectConfig.setClass(RpcControllerFactory.CUSTOM_CONTROLLER_CONF_KEY,
 InterRegionServerIndexRpcControllerFactory.class, 
RpcControllerFactory.class);
 
-compactionConfig = PropertiesUtil.cloneConfig(e.getConfiguration());
-// lower the number of rpc retries, so we don't hang the compaction
-compactionConfig.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER,
-
e.getConfiguration().getInt(QueryServices.METADATA_WRITE_RETRIES_NUMBER,
-QueryServicesOptions.DEFAULT_METADATA_WRITE_RETRIES_NUMBER));
-compactionConfig.setInt(HConstants.HBASE_CLIENT_PAUSE,
-
e.getConfiguration().getInt(QueryServices.METADATA_WRITE_RETRY_PAUSE,
-QueryServicesOptions.DEFAUL

[09/13] phoenix git commit: PHOENIX-4623 Inconsistent physical view index name

2018-05-09 Thread pboado
PHOENIX-4623 Inconsistent physical view index name


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

Branch: refs/heads/4.x-cdh5.12
Commit: 034d9867ad0a2dd1c94b26d9108f39aba1dbc024
Parents: de4c348
Author: James Taylor 
Authored: Tue May 8 16:29:41 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:40 2018 -0700

--
 .../org/apache/phoenix/end2end/BaseViewIT.java|  7 +++
 .../java/org/apache/phoenix/end2end/ViewIT.java   |  2 +-
 .../phoenix/schema/stats/StatsCollectorIT.java|  3 +--
 .../org/apache/phoenix/util/MetaDataUtil.java | 18 +-
 .../java/org/apache/phoenix/util/UpgradeUtil.java |  2 +-
 5 files changed, 11 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/034d9867/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
index 478b234..5728a20 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
@@ -46,7 +46,6 @@ import org.apache.phoenix.util.MetaDataUtil;
 import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.SchemaUtil;
-import org.apache.phoenix.util.TestUtil;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
@@ -66,7 +65,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
if (transactional) {
optionBuilder.append(" TRANSACTIONAL=true ");
}
-   this.schemaName = TestUtil.DEFAULT_SCHEMA_NAME;
+   this.schemaName = "S_" + generateUniqueName();
this.tableDDLOptions = optionBuilder.toString();
this.tableName = "T_" + generateUniqueName();
 this.fullTableName = SchemaUtil.getTableName(schemaName, tableName);
@@ -166,7 +165,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 ResultSet rs;
 Connection conn = DriverManager.getConnection(getUrl());
 String viewIndexName1 = "I_" + generateUniqueName();
-String viewIndexPhysicalName = 
MetaDataUtil.getViewIndexName(schemaName, tableName);
+String viewIndexPhysicalName = 
MetaDataUtil.getViewIndexPhysicalName(fullTableName);
 if (localIndex) {
 conn.createStatement().execute("CREATE LOCAL INDEX " + 
viewIndexName1 + " on " + viewName + "(k3)");
 } else {
@@ -231,7 +230,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 rs = conn.createStatement().executeQuery("EXPLAIN " + query);
 String physicalTableName;
 if (localIndex) {
-physicalTableName = tableName;
+physicalTableName = fullTableName;
 assertEquals("CLIENT PARALLEL "+ (saltBuckets == null ? 1 : 
saltBuckets)  +"-WAY RANGE SCAN OVER " + fullTableName +" [" + (2) + ",'foo']\n"
 + "SERVER FILTER BY FIRST KEY ONLY\n"
 + "CLIENT MERGE SORT",QueryUtil.getExplainPlan(rs));

http://git-wip-us.apache.org/repos/asf/phoenix/blob/034d9867/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
index 279bbd7..34292ba 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
@@ -69,7 +69,7 @@ public class ViewIT extends BaseViewIT {
 String ddl = "CREATE TABLE " + fullTableName + " (k INTEGER NOT NULL 
PRIMARY KEY, v1 DATE) "+ tableDDLOptions;
 conn.createStatement().execute(ddl);
 String fullParentViewName = "V_" + generateUniqueName();
-ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * 
FROM " + tableName + " WHERE k > 5";
+ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * 
FROM " + fullTableName + " WHERE k > 5";
 conn.createStatement().execute(ddl);
 try {
 conn.createStatement().execute("UPSERT INTO " + fullParentViewName 
+ " VALUES(1)");

http://git-wip-us.apache.org/repos/asf/phoenix/blob/034d9867/phoenix-core/src/it/java/org/apache/phoenix/schema

[10/13] phoenix git commit: PHOENIX-4678 ndexScrutinyTool generates malformed query due to incorrect table name(s) (Josh Elser)

2018-05-09 Thread pboado
PHOENIX-4678 ndexScrutinyTool generates malformed query due to incorrect table 
name(s) (Josh Elser)


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

Branch: refs/heads/4.x-cdh5.12
Commit: f1230c0a04e215230ec0312fe62a34841eec6eaa
Parents: 034d986
Author: James Taylor 
Authored: Wed May 9 12:50:22 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:40 2018 -0700

--
 phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f1230c0a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
--
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
index b43f54e..92a2cde 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
@@ -1132,7 +1132,7 @@ public class SchemaUtil {
  * @return the byte representation of the HTable
  */
 public static String getQualifiedTableName(String schemaName, String 
tableName) {
-if (schemaName != null) {
+if (schemaName != null && !schemaName.isEmpty()) {
 return String.format("%s.%s", normalizeIdentifier(schemaName),
 normalizeIdentifier(tableName));
 } else {



phoenix git commit: PHOENIX-4733 NPE while running sql through file using psql

2018-05-09 Thread pboado
Repository: phoenix
Updated Branches:
  refs/heads/4.x-cdh5.11 810ed4e37 -> c892e5c7d


PHOENIX-4733 NPE while running sql through file using psql


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

Branch: refs/heads/4.x-cdh5.11
Commit: c892e5c7d7ac5a705452060857aceb686cb57d23
Parents: 810ed4e
Author: Ankit Singhal 
Authored: Wed May 9 22:11:58 2018 +0100
Committer: Pedro Boado 
Committed: Wed May 9 23:44:45 2018 +0100

--
 .../org/apache/phoenix/log/QueryLoggerUtil.java | 24 ++--
 1 file changed, 17 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/c892e5c7/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
index 2f22931..d5c4878 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
@@ -30,10 +30,14 @@ import com.google.common.collect.ImmutableMap.Builder;
 
 public class QueryLoggerUtil {
 
-public static void logInitialDetails(QueryLogger queryLogger, PName 
tenantId,
-ConnectionQueryServices queryServices, String query, long 
startTime, List bindParameters) {
-queryLogger.log(QueryLogState.STARTED,
-getInitialDetails(tenantId, queryServices, query, startTime, 
bindParameters));
+public static void logInitialDetails(QueryLogger queryLogger, PName 
tenantId, ConnectionQueryServices queryServices,
+String query, long startTime, List bindParameters) {
+try {
+queryLogger.log(QueryLogState.STARTED,
+getInitialDetails(tenantId, queryServices, query, 
startTime, bindParameters));
+} catch (Exception e) {
+// Ignore for now
+}
 
 }
 
@@ -46,15 +50,21 @@ public class QueryLoggerUtil {
 } catch (UnknownHostException e) {
 clientIP = "UnknownHost";
 }
-queryLogBuilder.put(QueryLogInfo.CLIENT_IP_I, clientIP);
-queryLogBuilder.put(QueryLogInfo.QUERY_I, query);
+
+if (clientIP != null) {
+queryLogBuilder.put(QueryLogInfo.CLIENT_IP_I, clientIP);
+}
+if (query != null) {
+queryLogBuilder.put(QueryLogInfo.QUERY_I, query);
+}
 queryLogBuilder.put(QueryLogInfo.START_TIME_I, startTime);
 if (bindParameters != null) {
-queryLogBuilder.put(QueryLogInfo.BIND_PARAMETERS_I, 
StringUtils.join(bindParameters,","));
+queryLogBuilder.put(QueryLogInfo.BIND_PARAMETERS_I, 
StringUtils.join(bindParameters, ","));
 }
 if (tenantId != null) {
 queryLogBuilder.put(QueryLogInfo.TENANT_ID_I, 
tenantId.getString());
 }
+
 queryLogBuilder.put(QueryLogInfo.USER_I, queryServices.getUserName() 
!= null ? queryServices.getUserName()
 : queryServices.getUser().getShortName());
 return queryLogBuilder.build();



[2/2] phoenix git commit: PHOENIX-4733 NPE while running sql through file using psql

2018-05-09 Thread ankit
PHOENIX-4733 NPE while running sql through file using psql


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

Branch: refs/heads/5.x-HBase-2.0
Commit: d9308c56b53d4008ba791cf87d3111c21accc422
Parents: 0a554fc
Author: Ankit Singhal 
Authored: Wed May 9 14:16:25 2018 -0700
Committer: Ankit Singhal 
Committed: Wed May 9 14:16:25 2018 -0700

--
 .../org/apache/phoenix/log/QueryLoggerUtil.java | 24 ++--
 1 file changed, 17 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d9308c56/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
index 2f22931..d5c4878 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
@@ -30,10 +30,14 @@ import com.google.common.collect.ImmutableMap.Builder;
 
 public class QueryLoggerUtil {
 
-public static void logInitialDetails(QueryLogger queryLogger, PName 
tenantId,
-ConnectionQueryServices queryServices, String query, long 
startTime, List bindParameters) {
-queryLogger.log(QueryLogState.STARTED,
-getInitialDetails(tenantId, queryServices, query, startTime, 
bindParameters));
+public static void logInitialDetails(QueryLogger queryLogger, PName 
tenantId, ConnectionQueryServices queryServices,
+String query, long startTime, List bindParameters) {
+try {
+queryLogger.log(QueryLogState.STARTED,
+getInitialDetails(tenantId, queryServices, query, 
startTime, bindParameters));
+} catch (Exception e) {
+// Ignore for now
+}
 
 }
 
@@ -46,15 +50,21 @@ public class QueryLoggerUtil {
 } catch (UnknownHostException e) {
 clientIP = "UnknownHost";
 }
-queryLogBuilder.put(QueryLogInfo.CLIENT_IP_I, clientIP);
-queryLogBuilder.put(QueryLogInfo.QUERY_I, query);
+
+if (clientIP != null) {
+queryLogBuilder.put(QueryLogInfo.CLIENT_IP_I, clientIP);
+}
+if (query != null) {
+queryLogBuilder.put(QueryLogInfo.QUERY_I, query);
+}
 queryLogBuilder.put(QueryLogInfo.START_TIME_I, startTime);
 if (bindParameters != null) {
-queryLogBuilder.put(QueryLogInfo.BIND_PARAMETERS_I, 
StringUtils.join(bindParameters,","));
+queryLogBuilder.put(QueryLogInfo.BIND_PARAMETERS_I, 
StringUtils.join(bindParameters, ","));
 }
 if (tenantId != null) {
 queryLogBuilder.put(QueryLogInfo.TENANT_ID_I, 
tenantId.getString());
 }
+
 queryLogBuilder.put(QueryLogInfo.USER_I, queryServices.getUserName() 
!= null ? queryServices.getUserName()
 : queryServices.getUser().getShortName());
 return queryLogBuilder.build();



[1/2] phoenix git commit: Revert "NPE while running sql through file using psql"

2018-05-09 Thread ankit
Repository: phoenix
Updated Branches:
  refs/heads/5.x-HBase-2.0 a83afc4a6 -> d9308c56b


Revert "NPE while running sql through file using psql"

Needs a JIRA number
This reverts commit a83afc4a6dc1500400890c263ceaae896fe04f55.


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

Branch: refs/heads/5.x-HBase-2.0
Commit: 0a554fcfb6a181f681a1d9d3c221b4d1f62ad850
Parents: a83afc4
Author: Ankit Singhal 
Authored: Wed May 9 14:15:40 2018 -0700
Committer: Ankit Singhal 
Committed: Wed May 9 14:15:40 2018 -0700

--
 .../org/apache/phoenix/log/QueryLoggerUtil.java | 24 ++--
 1 file changed, 7 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/0a554fcf/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
index d5c4878..2f22931 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
@@ -30,14 +30,10 @@ import com.google.common.collect.ImmutableMap.Builder;
 
 public class QueryLoggerUtil {
 
-public static void logInitialDetails(QueryLogger queryLogger, PName 
tenantId, ConnectionQueryServices queryServices,
-String query, long startTime, List bindParameters) {
-try {
-queryLogger.log(QueryLogState.STARTED,
-getInitialDetails(tenantId, queryServices, query, 
startTime, bindParameters));
-} catch (Exception e) {
-// Ignore for now
-}
+public static void logInitialDetails(QueryLogger queryLogger, PName 
tenantId,
+ConnectionQueryServices queryServices, String query, long 
startTime, List bindParameters) {
+queryLogger.log(QueryLogState.STARTED,
+getInitialDetails(tenantId, queryServices, query, startTime, 
bindParameters));
 
 }
 
@@ -50,21 +46,15 @@ public class QueryLoggerUtil {
 } catch (UnknownHostException e) {
 clientIP = "UnknownHost";
 }
-
-if (clientIP != null) {
-queryLogBuilder.put(QueryLogInfo.CLIENT_IP_I, clientIP);
-}
-if (query != null) {
-queryLogBuilder.put(QueryLogInfo.QUERY_I, query);
-}
+queryLogBuilder.put(QueryLogInfo.CLIENT_IP_I, clientIP);
+queryLogBuilder.put(QueryLogInfo.QUERY_I, query);
 queryLogBuilder.put(QueryLogInfo.START_TIME_I, startTime);
 if (bindParameters != null) {
-queryLogBuilder.put(QueryLogInfo.BIND_PARAMETERS_I, 
StringUtils.join(bindParameters, ","));
+queryLogBuilder.put(QueryLogInfo.BIND_PARAMETERS_I, 
StringUtils.join(bindParameters,","));
 }
 if (tenantId != null) {
 queryLogBuilder.put(QueryLogInfo.TENANT_ID_I, 
tenantId.getString());
 }
-
 queryLogBuilder.put(QueryLogInfo.USER_I, queryServices.getUserName() 
!= null ? queryServices.getUserName()
 : queryServices.getUser().getShortName());
 return queryLogBuilder.build();



phoenix git commit: PHOENIX-4733 NPE while running sql through file using psql

2018-05-09 Thread ankit
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 68938b856 -> d06bbdcf8


PHOENIX-4733 NPE while running sql through file using psql


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

Branch: refs/heads/4.x-HBase-0.98
Commit: d06bbdcf8793e1fc65410e7b3a59ef299517ac41
Parents: 68938b8
Author: Ankit Singhal 
Authored: Wed May 9 14:12:55 2018 -0700
Committer: Ankit Singhal 
Committed: Wed May 9 14:12:55 2018 -0700

--
 .../org/apache/phoenix/log/QueryLoggerUtil.java | 24 ++--
 1 file changed, 17 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d06bbdcf/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
index 2f22931..d5c4878 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
@@ -30,10 +30,14 @@ import com.google.common.collect.ImmutableMap.Builder;
 
 public class QueryLoggerUtil {
 
-public static void logInitialDetails(QueryLogger queryLogger, PName 
tenantId,
-ConnectionQueryServices queryServices, String query, long 
startTime, List bindParameters) {
-queryLogger.log(QueryLogState.STARTED,
-getInitialDetails(tenantId, queryServices, query, startTime, 
bindParameters));
+public static void logInitialDetails(QueryLogger queryLogger, PName 
tenantId, ConnectionQueryServices queryServices,
+String query, long startTime, List bindParameters) {
+try {
+queryLogger.log(QueryLogState.STARTED,
+getInitialDetails(tenantId, queryServices, query, 
startTime, bindParameters));
+} catch (Exception e) {
+// Ignore for now
+}
 
 }
 
@@ -46,15 +50,21 @@ public class QueryLoggerUtil {
 } catch (UnknownHostException e) {
 clientIP = "UnknownHost";
 }
-queryLogBuilder.put(QueryLogInfo.CLIENT_IP_I, clientIP);
-queryLogBuilder.put(QueryLogInfo.QUERY_I, query);
+
+if (clientIP != null) {
+queryLogBuilder.put(QueryLogInfo.CLIENT_IP_I, clientIP);
+}
+if (query != null) {
+queryLogBuilder.put(QueryLogInfo.QUERY_I, query);
+}
 queryLogBuilder.put(QueryLogInfo.START_TIME_I, startTime);
 if (bindParameters != null) {
-queryLogBuilder.put(QueryLogInfo.BIND_PARAMETERS_I, 
StringUtils.join(bindParameters,","));
+queryLogBuilder.put(QueryLogInfo.BIND_PARAMETERS_I, 
StringUtils.join(bindParameters, ","));
 }
 if (tenantId != null) {
 queryLogBuilder.put(QueryLogInfo.TENANT_ID_I, 
tenantId.getString());
 }
+
 queryLogBuilder.put(QueryLogInfo.USER_I, queryServices.getUserName() 
!= null ? queryServices.getUserName()
 : queryServices.getUser().getShortName());
 return queryLogBuilder.build();



phoenix git commit: PHOENIX-4733 NPE while running sql through file using psql

2018-05-09 Thread ankit
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.1 79838c0d5 -> e5afd4e5d


PHOENIX-4733 NPE while running sql through file using psql


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

Branch: refs/heads/4.x-HBase-1.1
Commit: e5afd4e5d6f5651675e95d12a7cb199ffc83ddca
Parents: 79838c0
Author: Ankit Singhal 
Authored: Wed May 9 14:12:23 2018 -0700
Committer: Ankit Singhal 
Committed: Wed May 9 14:12:23 2018 -0700

--
 .../org/apache/phoenix/log/QueryLoggerUtil.java | 24 ++--
 1 file changed, 17 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/e5afd4e5/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
index 2f22931..d5c4878 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
@@ -30,10 +30,14 @@ import com.google.common.collect.ImmutableMap.Builder;
 
 public class QueryLoggerUtil {
 
-public static void logInitialDetails(QueryLogger queryLogger, PName 
tenantId,
-ConnectionQueryServices queryServices, String query, long 
startTime, List bindParameters) {
-queryLogger.log(QueryLogState.STARTED,
-getInitialDetails(tenantId, queryServices, query, startTime, 
bindParameters));
+public static void logInitialDetails(QueryLogger queryLogger, PName 
tenantId, ConnectionQueryServices queryServices,
+String query, long startTime, List bindParameters) {
+try {
+queryLogger.log(QueryLogState.STARTED,
+getInitialDetails(tenantId, queryServices, query, 
startTime, bindParameters));
+} catch (Exception e) {
+// Ignore for now
+}
 
 }
 
@@ -46,15 +50,21 @@ public class QueryLoggerUtil {
 } catch (UnknownHostException e) {
 clientIP = "UnknownHost";
 }
-queryLogBuilder.put(QueryLogInfo.CLIENT_IP_I, clientIP);
-queryLogBuilder.put(QueryLogInfo.QUERY_I, query);
+
+if (clientIP != null) {
+queryLogBuilder.put(QueryLogInfo.CLIENT_IP_I, clientIP);
+}
+if (query != null) {
+queryLogBuilder.put(QueryLogInfo.QUERY_I, query);
+}
 queryLogBuilder.put(QueryLogInfo.START_TIME_I, startTime);
 if (bindParameters != null) {
-queryLogBuilder.put(QueryLogInfo.BIND_PARAMETERS_I, 
StringUtils.join(bindParameters,","));
+queryLogBuilder.put(QueryLogInfo.BIND_PARAMETERS_I, 
StringUtils.join(bindParameters, ","));
 }
 if (tenantId != null) {
 queryLogBuilder.put(QueryLogInfo.TENANT_ID_I, 
tenantId.getString());
 }
+
 queryLogBuilder.put(QueryLogInfo.USER_I, queryServices.getUserName() 
!= null ? queryServices.getUserName()
 : queryServices.getUser().getShortName());
 return queryLogBuilder.build();



phoenix git commit: PHOENIX-4733 NPE while running sql through file using psql

2018-05-09 Thread ankit
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.2 766355614 -> dfd66e14b


PHOENIX-4733 NPE while running sql through file using psql


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

Branch: refs/heads/4.x-HBase-1.2
Commit: dfd66e14b5888cfe2800f66ac1e6f4447ca29bde
Parents: 7663556
Author: Ankit Singhal 
Authored: Wed May 9 14:11:58 2018 -0700
Committer: Ankit Singhal 
Committed: Wed May 9 14:11:58 2018 -0700

--
 .../org/apache/phoenix/log/QueryLoggerUtil.java | 24 ++--
 1 file changed, 17 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/dfd66e14/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
index 2f22931..d5c4878 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
@@ -30,10 +30,14 @@ import com.google.common.collect.ImmutableMap.Builder;
 
 public class QueryLoggerUtil {
 
-public static void logInitialDetails(QueryLogger queryLogger, PName 
tenantId,
-ConnectionQueryServices queryServices, String query, long 
startTime, List bindParameters) {
-queryLogger.log(QueryLogState.STARTED,
-getInitialDetails(tenantId, queryServices, query, startTime, 
bindParameters));
+public static void logInitialDetails(QueryLogger queryLogger, PName 
tenantId, ConnectionQueryServices queryServices,
+String query, long startTime, List bindParameters) {
+try {
+queryLogger.log(QueryLogState.STARTED,
+getInitialDetails(tenantId, queryServices, query, 
startTime, bindParameters));
+} catch (Exception e) {
+// Ignore for now
+}
 
 }
 
@@ -46,15 +50,21 @@ public class QueryLoggerUtil {
 } catch (UnknownHostException e) {
 clientIP = "UnknownHost";
 }
-queryLogBuilder.put(QueryLogInfo.CLIENT_IP_I, clientIP);
-queryLogBuilder.put(QueryLogInfo.QUERY_I, query);
+
+if (clientIP != null) {
+queryLogBuilder.put(QueryLogInfo.CLIENT_IP_I, clientIP);
+}
+if (query != null) {
+queryLogBuilder.put(QueryLogInfo.QUERY_I, query);
+}
 queryLogBuilder.put(QueryLogInfo.START_TIME_I, startTime);
 if (bindParameters != null) {
-queryLogBuilder.put(QueryLogInfo.BIND_PARAMETERS_I, 
StringUtils.join(bindParameters,","));
+queryLogBuilder.put(QueryLogInfo.BIND_PARAMETERS_I, 
StringUtils.join(bindParameters, ","));
 }
 if (tenantId != null) {
 queryLogBuilder.put(QueryLogInfo.TENANT_ID_I, 
tenantId.getString());
 }
+
 queryLogBuilder.put(QueryLogInfo.USER_I, queryServices.getUserName() 
!= null ? queryServices.getUserName()
 : queryServices.getUser().getShortName());
 return queryLogBuilder.build();



phoenix git commit: PHOENIX-4733 NPE while running sql through file using psql

2018-05-09 Thread ankit
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.3 cc0de5d27 -> 7f9166522


PHOENIX-4733 NPE while running sql through file using psql


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

Branch: refs/heads/4.x-HBase-1.3
Commit: 7f916652298da0a7e4bca9c29a96f01000636e57
Parents: cc0de5d
Author: Ankit Singhal 
Authored: Wed May 9 14:11:29 2018 -0700
Committer: Ankit Singhal 
Committed: Wed May 9 14:11:29 2018 -0700

--
 .../org/apache/phoenix/log/QueryLoggerUtil.java | 24 ++--
 1 file changed, 17 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/7f916652/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
index 2f22931..d5c4878 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
@@ -30,10 +30,14 @@ import com.google.common.collect.ImmutableMap.Builder;
 
 public class QueryLoggerUtil {
 
-public static void logInitialDetails(QueryLogger queryLogger, PName 
tenantId,
-ConnectionQueryServices queryServices, String query, long 
startTime, List bindParameters) {
-queryLogger.log(QueryLogState.STARTED,
-getInitialDetails(tenantId, queryServices, query, startTime, 
bindParameters));
+public static void logInitialDetails(QueryLogger queryLogger, PName 
tenantId, ConnectionQueryServices queryServices,
+String query, long startTime, List bindParameters) {
+try {
+queryLogger.log(QueryLogState.STARTED,
+getInitialDetails(tenantId, queryServices, query, 
startTime, bindParameters));
+} catch (Exception e) {
+// Ignore for now
+}
 
 }
 
@@ -46,15 +50,21 @@ public class QueryLoggerUtil {
 } catch (UnknownHostException e) {
 clientIP = "UnknownHost";
 }
-queryLogBuilder.put(QueryLogInfo.CLIENT_IP_I, clientIP);
-queryLogBuilder.put(QueryLogInfo.QUERY_I, query);
+
+if (clientIP != null) {
+queryLogBuilder.put(QueryLogInfo.CLIENT_IP_I, clientIP);
+}
+if (query != null) {
+queryLogBuilder.put(QueryLogInfo.QUERY_I, query);
+}
 queryLogBuilder.put(QueryLogInfo.START_TIME_I, startTime);
 if (bindParameters != null) {
-queryLogBuilder.put(QueryLogInfo.BIND_PARAMETERS_I, 
StringUtils.join(bindParameters,","));
+queryLogBuilder.put(QueryLogInfo.BIND_PARAMETERS_I, 
StringUtils.join(bindParameters, ","));
 }
 if (tenantId != null) {
 queryLogBuilder.put(QueryLogInfo.TENANT_ID_I, 
tenantId.getString());
 }
+
 queryLogBuilder.put(QueryLogInfo.USER_I, queryServices.getUserName() 
!= null ? queryServices.getUserName()
 : queryServices.getUser().getShortName());
 return queryLogBuilder.build();



phoenix git commit: NPE while running sql through file using psql

2018-05-09 Thread ankit
Repository: phoenix
Updated Branches:
  refs/heads/5.x-HBase-2.0 ff0b8089d -> a83afc4a6


NPE while running sql through file using psql


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

Branch: refs/heads/5.x-HBase-2.0
Commit: a83afc4a6dc1500400890c263ceaae896fe04f55
Parents: ff0b808
Author: Ankit Singhal 
Authored: Wed May 9 13:52:31 2018 -0700
Committer: Ankit Singhal 
Committed: Wed May 9 13:52:31 2018 -0700

--
 .../org/apache/phoenix/log/QueryLoggerUtil.java | 24 ++--
 1 file changed, 17 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/a83afc4a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
index 2f22931..d5c4878 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/log/QueryLoggerUtil.java
@@ -30,10 +30,14 @@ import com.google.common.collect.ImmutableMap.Builder;
 
 public class QueryLoggerUtil {
 
-public static void logInitialDetails(QueryLogger queryLogger, PName 
tenantId,
-ConnectionQueryServices queryServices, String query, long 
startTime, List bindParameters) {
-queryLogger.log(QueryLogState.STARTED,
-getInitialDetails(tenantId, queryServices, query, startTime, 
bindParameters));
+public static void logInitialDetails(QueryLogger queryLogger, PName 
tenantId, ConnectionQueryServices queryServices,
+String query, long startTime, List bindParameters) {
+try {
+queryLogger.log(QueryLogState.STARTED,
+getInitialDetails(tenantId, queryServices, query, 
startTime, bindParameters));
+} catch (Exception e) {
+// Ignore for now
+}
 
 }
 
@@ -46,15 +50,21 @@ public class QueryLoggerUtil {
 } catch (UnknownHostException e) {
 clientIP = "UnknownHost";
 }
-queryLogBuilder.put(QueryLogInfo.CLIENT_IP_I, clientIP);
-queryLogBuilder.put(QueryLogInfo.QUERY_I, query);
+
+if (clientIP != null) {
+queryLogBuilder.put(QueryLogInfo.CLIENT_IP_I, clientIP);
+}
+if (query != null) {
+queryLogBuilder.put(QueryLogInfo.QUERY_I, query);
+}
 queryLogBuilder.put(QueryLogInfo.START_TIME_I, startTime);
 if (bindParameters != null) {
-queryLogBuilder.put(QueryLogInfo.BIND_PARAMETERS_I, 
StringUtils.join(bindParameters,","));
+queryLogBuilder.put(QueryLogInfo.BIND_PARAMETERS_I, 
StringUtils.join(bindParameters, ","));
 }
 if (tenantId != null) {
 queryLogBuilder.put(QueryLogInfo.TENANT_ID_I, 
tenantId.getString());
 }
+
 queryLogBuilder.put(QueryLogInfo.USER_I, queryServices.getUserName() 
!= null ? queryServices.getUserName()
 : queryServices.getUser().getShortName());
 return queryLogBuilder.build();



[4/7] phoenix git commit: PHOENIX-4727 Parameterize transaction tests with TRANSACTION_PROVIDER

2018-05-09 Thread jamestaylor
PHOENIX-4727 Parameterize transaction tests with TRANSACTION_PROVIDER


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

Branch: refs/heads/5.x-HBase-2.0
Commit: 33a6d9d86d61485393d245ec4c9d1ad39c82cb4f
Parents: 294ff58
Author: James Taylor 
Authored: Mon May 7 18:23:03 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:49:34 2018 -0700

--
 .../phoenix/end2end/index/MutableIndexIT.java   | 22 +++---
 .../phoenix/tx/ParameterizedTransactionIT.java  |  1 +
 .../org/apache/phoenix/tx/TransactionIT.java| 75 +++-
 .../java/org/apache/phoenix/util/TestUtil.java  |  6 +-
 4 files changed, 75 insertions(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/33a6d9d8/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
index d69a4a5..a934fb6 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
@@ -81,11 +81,11 @@ public class MutableIndexIT extends ParallelStatsDisabledIT 
{
 protected final boolean localIndex;
 private final String tableDDLOptions;

-public MutableIndexIT(boolean localIndex, boolean transactional, boolean 
columnEncoded) {
+public MutableIndexIT(Boolean localIndex, String txProvider, Boolean 
columnEncoded) {
this.localIndex = localIndex;
StringBuilder optionBuilder = new StringBuilder();
-   if (transactional) {
-   optionBuilder.append("TRANSACTIONAL=true");
+   if (txProvider != null) {
+   optionBuilder.append("TRANSACTIONAL=true," + 
PhoenixDatabaseMetaData.TRANSACTION_PROVIDER + "='" + txProvider + "'");
}
if (!columnEncoded) {
 if (optionBuilder.length()!=0)
@@ -107,13 +107,15 @@ public class MutableIndexIT extends 
ParallelStatsDisabledIT {
 }
 

@Parameters(name="MutableIndexIT_localIndex={0},transactional={1},columnEncoded={2}")
 // name is used by failsafe as file name in reports
-public static Collection data() {
-// Temporarily disable transactional tests
-return Arrays.asList(new Boolean[][] { 
-{ false, false, false }, { false, false, true },
-//{ false, true, false }, { false, true, true },
-{ true, false, false }, { true, false, true } });
-//{ true, true, false }, { true, true, true } });
+public static Collection data() {
+return Arrays.asList(new Object[][] { 
+{ false, null, false }, { false, null, true },
+//{ false, "TEPHRA", false }, { false, "TEPHRA", true },
+//{ false, "OMID", false }, { false, "OMID", true },
+{ true, null, false }, { true, null, true },
+//{ true, "TEPHRA", false }, { true, "TEPHRA", true },
+//{ true, "OMID", false }, { true, "OMID", true },
+});
 }
 
 @Test

http://git-wip-us.apache.org/repos/asf/phoenix/blob/33a6d9d8/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
index 099808c..749b056 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
@@ -58,6 +58,7 @@ import 
org.apache.phoenix.transaction.PhoenixTransactionContext;
 import org.apache.phoenix.util.ByteUtil;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.TestUtil;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/33a6d9d8/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
index 88fba47..baaac8d 100644
--- a/phoenix-core/src/it/java/org/

[2/7] phoenix git commit: PHOENIX-3270 Remove @Ignore tag for TransactionIT.testNonTxToTxTableFailure()

2018-05-09 Thread jamestaylor
PHOENIX-3270 Remove @Ignore tag for TransactionIT.testNonTxToTxTableFailure()


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

Branch: refs/heads/5.x-HBase-2.0
Commit: 294ff5898b4e1b5c0de4aa6b261cc83fdfd349ee
Parents: 23b0faa
Author: James Taylor 
Authored: Thu May 3 09:52:57 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:44:22 2018 -0700

--
 .../it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java  | 2 --
 1 file changed, 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/294ff589/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
index ee3a600..099808c 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
@@ -58,7 +58,6 @@ import 
org.apache.phoenix.transaction.PhoenixTransactionContext;
 import org.apache.phoenix.util.ByteUtil;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.TestUtil;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -325,7 +324,6 @@ public class ParameterizedTransactionIT extends 
ParallelStatsDisabledIT {
 assertFalse(rs.next());
 }
 
-@Ignore
 @Test
 public void testNonTxToTxTableFailure() throws Exception {
 String nonTxTableName = generateUniqueName();



[5/7] phoenix git commit: PHOENIX-4623 Inconsistent physical view index name

2018-05-09 Thread jamestaylor
PHOENIX-4623 Inconsistent physical view index name


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

Branch: refs/heads/5.x-HBase-2.0
Commit: 5d53215696912bf2557867cd1ac334f84b6492fd
Parents: 33a6d9d
Author: James Taylor 
Authored: Tue May 8 16:29:41 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:49:36 2018 -0700

--
 .../org/apache/phoenix/end2end/BaseViewIT.java|  7 +++
 .../java/org/apache/phoenix/end2end/ViewIT.java   |  2 +-
 .../phoenix/schema/stats/StatsCollectorIT.java|  2 +-
 .../org/apache/phoenix/util/MetaDataUtil.java | 18 +-
 .../java/org/apache/phoenix/util/UpgradeUtil.java |  2 +-
 5 files changed, 11 insertions(+), 20 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/5d532156/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
index 92966f1..b606fc6 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
@@ -46,7 +46,6 @@ import org.apache.phoenix.util.MetaDataUtil;
 import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.SchemaUtil;
-import org.apache.phoenix.util.TestUtil;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
@@ -66,7 +65,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
if (transactional) {
optionBuilder.append(" TRANSACTIONAL=true ");
}
-   this.schemaName = TestUtil.DEFAULT_SCHEMA_NAME;
+   this.schemaName = "S_" + generateUniqueName();
this.tableDDLOptions = optionBuilder.toString();
this.tableName = "T_" + generateUniqueName();
 this.fullTableName = SchemaUtil.getTableName(schemaName, tableName);
@@ -167,7 +166,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 ResultSet rs;
 Connection conn = DriverManager.getConnection(getUrl());
 String viewIndexName1 = "I_" + generateUniqueName();
-String viewIndexPhysicalName = 
MetaDataUtil.getViewIndexName(schemaName, tableName);
+String viewIndexPhysicalName = 
MetaDataUtil.getViewIndexPhysicalName(fullTableName);
 if (localIndex) {
 conn.createStatement().execute("CREATE LOCAL INDEX " + 
viewIndexName1 + " on " + viewName + "(k3)");
 } else {
@@ -232,7 +231,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 rs = conn.createStatement().executeQuery("EXPLAIN " + query);
 String physicalTableName;
 if (localIndex) {
-physicalTableName = tableName;
+physicalTableName = fullTableName;
 assertEquals("CLIENT PARALLEL "+ (saltBuckets == null ? 1 : 
saltBuckets)  +"-WAY RANGE SCAN OVER " + fullTableName +" [" + (2) + ",'foo']\n"
 + "SERVER FILTER BY FIRST KEY ONLY\n"
 + "CLIENT MERGE SORT",QueryUtil.getExplainPlan(rs));

http://git-wip-us.apache.org/repos/asf/phoenix/blob/5d532156/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
index e277c18..72dd26f 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
@@ -69,7 +69,7 @@ public class ViewIT extends BaseViewIT {
 String ddl = "CREATE TABLE " + fullTableName + " (k INTEGER NOT NULL 
PRIMARY KEY, v1 DATE) "+ tableDDLOptions;
 conn.createStatement().execute(ddl);
 String fullParentViewName = "V_" + generateUniqueName();
-ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * 
FROM " + tableName + " WHERE k > 5";
+ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * 
FROM " + fullTableName + " WHERE k > 5";
 conn.createStatement().execute(ddl);
 try {
 conn.createStatement().execute("UPSERT INTO " + fullParentViewName 
+ " VALUES(1)");

http://git-wip-us.apache.org/repos/asf/phoenix/blob/5d532156/phoenix-core/src/it/java/org/apache/phoenix/schem

[1/7] phoenix git commit: PHOENIX-4732 Improve config defaults for async secondary index MR jobs

2018-05-09 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/5.x-HBase-2.0 254c0a2ae -> ff0b8089d


PHOENIX-4732 Improve config defaults for async secondary index MR jobs


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

Branch: refs/heads/5.x-HBase-2.0
Commit: 933ef6aaeeccc98c9a62c49c01c4cf71547c614f
Parents: 254c0a2
Author: James Taylor 
Authored: Tue May 8 15:26:44 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:44:20 2018 -0700

--
 .../index/automation/PhoenixMRJobSubmitter.java | 46 +++-
 .../apache/phoenix/util/PhoenixMRJobUtil.java   | 18 +++-
 2 files changed, 51 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/933ef6aa/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 662f0c9..59ced6c 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
@@ -45,6 +45,7 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.zookeeper.ZKWatcher;
+import org.apache.hadoop.mapreduce.MRJobConfig;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.mapreduce.index.IndexTool;
@@ -69,8 +70,28 @@ public class PhoenixMRJobSubmitter {
 // Lock to elect a master node that submits the Phoenix Secondary Index MR 
Jobs
 private static final String PHOENIX_LOCKS_PARENT =
 "/phoenix/automated-mr-index-build-leader-election";
+public static final String PHOENIX_MR_CLIENT_SCANNER_TIMEOUT_PERIOD =
+"phoenix.mr.client.scanner.timeout.period";
+public static final String PHOENIX_MR_RPC_TIMEOUT =
+"phoenix.mr.rpc.timeout";
+public static final String PHOENIX_MR_TASK_TIMEOUT =
+"phoenix.mr.task.timeout";
+public static final String PHOENIX_MR_CLIENT_RETRIES_NUMBER =
+"phoenix.mr.client.retries.number";
+public static final String PHOENIX_MR_CLIENT_PAUSE =
+"phoenix.mr.client.retries.number";
+public static final String PHOENIX_MR_ZK_RECOVERY_RETRY =
+"phoenix.mr.zk.recovery.retry";
 private static final String AUTO_INDEX_BUILD_LOCK_NAME = 
"ActiveStandbyElectorLock";
-
+private static final int DEFAULT_TIMEOUT_IN_MILLIS = 60;
+public static final int DEFAULT_MR_CLIENT_SCANNER_TIMEOUT_PERIOD = 
DEFAULT_TIMEOUT_IN_MILLIS;
+public static final int DEFAULT_MR_RPC_TIMEOUT = DEFAULT_TIMEOUT_IN_MILLIS;
+public static final int DEFAULT_MR_TASK_TIMEOUT = 
DEFAULT_TIMEOUT_IN_MILLIS;
+// Reduced HBase/Zookeeper Client Retries
+public static final int DEFAULT_MR_CLIENT_RETRIES_NUMBER = 10;
+public static final int DEFAULT_MR_CLIENT_PAUSE = 1000;
+public static final int DEFAULT_MR_ZK_RECOVERY_RETRY = 1;
+
 public static final String CANDIDATE_INDEX_INFO_QUERY = "SELECT "
 + PhoenixDatabaseMetaData.INDEX_TYPE + ","
 + PhoenixDatabaseMetaData.DATA_TABLE_NAME + ", "
@@ -103,7 +124,28 @@ public class PhoenixMRJobSubmitter {
 }
 this.conf = conf;
 
-PhoenixMRJobUtil.updateTimeoutsToFailFast(conf);
+// Have Phoenix specific properties for defaults to enable potential 
override
+conf.setLong(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD, 
+conf.getLong(PHOENIX_MR_CLIENT_SCANNER_TIMEOUT_PERIOD,
+DEFAULT_MR_CLIENT_SCANNER_TIMEOUT_PERIOD));
+conf.setLong(HConstants.HBASE_RPC_TIMEOUT_KEY, 
+conf.getLong(PHOENIX_MR_RPC_TIMEOUT,
+DEFAULT_MR_RPC_TIMEOUT));
+conf.setLong(MRJobConfig.TASK_TIMEOUT, 
+conf.getLong(PHOENIX_MR_TASK_TIMEOUT,
+DEFAULT_MR_TASK_TIMEOUT));
+
+// Reduced HBase Client Retries
+conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 
+conf.getInt(PHOENIX_MR_CLIENT_RETRIES_NUMBER,
+DEFAULT_MR_CLIENT_RETRIES_NUMBER));
+conf.setInt(HConstants.HBASE_CLIENT_PAUSE, 
+conf.getInt(PHOENIX_MR_CLIENT_PAU

[3/7] phoenix git commit: PHOENIX-3856 StatementContext class constructor not honouring supplied scan object (Sukumar Maddineni)

2018-05-09 Thread jamestaylor
PHOENIX-3856 StatementContext class constructor not honouring supplied scan 
object (Sukumar Maddineni)


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

Branch: refs/heads/5.x-HBase-2.0
Commit: 23b0faa87333040d5634903c5c1d4c8405d75c41
Parents: 933ef6a
Author: James Taylor 
Authored: Thu May 3 09:32:57 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:44:22 2018 -0700

--
 .../src/main/java/org/apache/phoenix/compile/StatementContext.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/23b0faa8/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 c105046..3e5c8f2 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
@@ -98,7 +98,7 @@ public class StatementContext {
 }
 
 public StatementContext(PhoenixStatement statement, Scan scan) {
-this(statement, FromCompiler.EMPTY_TABLE_RESOLVER, new Scan(), new 
SequenceManager(statement));
+this(statement, FromCompiler.EMPTY_TABLE_RESOLVER, scan, new 
SequenceManager(statement));
 }
 
 public StatementContext(PhoenixStatement statement, ColumnResolver 
resolver) {



[7/7] phoenix git commit: PHOENIX-4646 The data exceeds the max capacity for the data type error for valid scenarios (Sergey Soldatov)

2018-05-09 Thread jamestaylor
PHOENIX-4646 The data exceeds the max capacity for the data type error for 
valid scenarios (Sergey Soldatov)


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

Branch: refs/heads/5.x-HBase-2.0
Commit: ff0b8089d8c15154cbe875a535c33a62d72fe26a
Parents: 9516b14
Author: James Taylor 
Authored: Wed May 9 13:12:26 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:49:36 2018 -0700

--
 .../apache/phoenix/end2end/UpsertSelectIT.java   | 19 +++
 .../apache/phoenix/schema/types/PVarchar.java| 10 ++
 2 files changed, 25 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/ff0b8089/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
index 275d72d..e6feea6 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
@@ -1486,6 +1486,25 @@ public class UpsertSelectIT extends 
ParallelStatsDisabledIT {
 }
 }
 
+@Test // See https://issues.apache.org/jira/browse/PHOENIX-4646
+public void testLengthLimitedVarchar() throws Exception {
+String tableName1 = generateUniqueName();
+String tableName2 = generateUniqueName();
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+conn.setAutoCommit(true);
+conn.createStatement().execute("create table " + tableName1 + 
"(name varchar(160) primary key, id varchar(120), address varchar(160))"); 
+conn.createStatement().execute("create table " + tableName2 + 
"(name varchar(160) primary key, id varchar(10), address  varchar(10))");
+conn.createStatement().execute("upsert into " + tableName1 + " 
values('test','test','test')");
+conn.createStatement().execute("upsert into " + tableName2 + " 
select * from " + tableName1);
+ResultSet rs = conn.createStatement().executeQuery("select * from 
" + tableName2);
+assertTrue(rs.next());
+assertEquals("test", rs.getString(1));
+assertEquals("test", rs.getString(2));
+assertEquals("test", rs.getString(2));
+assertFalse(rs.next());
+}
+}
+
 private static Connection getTenantConnection(String tenantId) throws 
Exception {
 Properties props = PropertiesUtil.deepCopy(TestUtil.TEST_PROPERTIES);
 props.setProperty(TENANT_ID_ATTRIB, tenantId);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/ff0b8089/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
index fb5a045..a99925c 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
@@ -102,15 +102,17 @@ public class PVarchar extends PDataType {
 SortOrder sortOrder, Integer maxLength, Integer scale,
 Integer desiredMaxLength, Integer desiredScale) {
 if (ptr.getLength() != 0 && desiredMaxLength != null) {
-if (maxLength == null) {
+if (maxLength == null || maxLength > desiredMaxLength) {
 if (value != null) { // Use value if provided
 maxLength = value.toString().length();
 } else {
-coerceBytes(ptr, value, srcType, maxLength, scale, 
sortOrder, desiredMaxLength, desiredScale, sortOrder, true);
-maxLength = StringUtil.calculateUTF8Length(ptr.get(), 
ptr.getOffset(), ptr.getLength(), sortOrder);
+coerceBytes(ptr, value, srcType, maxLength, scale, 
sortOrder, desiredMaxLength,
+desiredScale, sortOrder, true);
+maxLength = StringUtil
+.calculateUTF8Length(ptr.get(), ptr.getOffset(), 
ptr.getLength(), sortOrder);
 }
+return maxLength <= desiredMaxLength;
 }
-return maxLength <= desiredMaxLength;
 }
 return true;
 }



[6/7] phoenix git commit: PHOENIX-4678 ndexScrutinyTool generates malformed query due to incorrect table name(s) (Josh Elser)

2018-05-09 Thread jamestaylor
PHOENIX-4678 ndexScrutinyTool generates malformed query due to incorrect table 
name(s) (Josh Elser)


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

Branch: refs/heads/5.x-HBase-2.0
Commit: 9516b14ab3103c387bd06f1938bdd33f45e893f1
Parents: 5d53215
Author: James Taylor 
Authored: Wed May 9 12:50:22 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:49:36 2018 -0700

--
 phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/9516b14a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
--
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
index 0168bee..51d583c 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
@@ -1132,7 +1132,7 @@ public class SchemaUtil {
  * @return the byte representation of the HTable
  */
 public static String getQualifiedTableName(String schemaName, String 
tableName) {
-if (schemaName != null) {
+if (schemaName != null && !schemaName.isEmpty()) {
 return String.format("%s.%s", normalizeIdentifier(schemaName),
 normalizeIdentifier(tableName));
 } else {



[4/7] phoenix git commit: PHOENIX-4732 Improve config defaults for async secondary index MR jobs

2018-05-09 Thread jamestaylor
PHOENIX-4732 Improve config defaults for async secondary index MR jobs


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

Branch: refs/heads/master
Commit: 48e5f433fd040d5edd54fa606f1cfced5104ff5c
Parents: 637cedb
Author: James Taylor 
Authored: Tue May 8 15:26:44 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:39:41 2018 -0700

--
 .../index/automation/PhoenixMRJobSubmitter.java | 48 ++--
 .../apache/phoenix/util/PhoenixMRJobUtil.java   | 18 +++-
 2 files changed, 52 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/48e5f433/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 9c447e8..d86802a 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
@@ -45,6 +45,7 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
+import org.apache.hadoop.mapreduce.MRJobConfig;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.mapreduce.index.IndexTool;
@@ -53,8 +54,8 @@ import org.apache.phoenix.schema.PTable.IndexType;
 import org.apache.phoenix.schema.PTableType;
 import org.apache.phoenix.schema.types.PDate;
 import org.apache.phoenix.util.PhoenixMRJobUtil;
-import org.apache.phoenix.util.UpgradeUtil;
 import org.apache.phoenix.util.PhoenixMRJobUtil.MR_SCHEDULER_TYPE;
+import org.apache.phoenix.util.UpgradeUtil;
 import org.apache.phoenix.util.ZKBasedMasterElectionUtil;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONObject;
@@ -69,8 +70,28 @@ public class PhoenixMRJobSubmitter {
 // Lock to elect a master node that submits the Phoenix Secondary Index MR 
Jobs
 private static final String PHOENIX_LOCKS_PARENT =
 "/phoenix/automated-mr-index-build-leader-election";
+public static final String PHOENIX_MR_CLIENT_SCANNER_TIMEOUT_PERIOD =
+"phoenix.mr.client.scanner.timeout.period";
+public static final String PHOENIX_MR_RPC_TIMEOUT =
+"phoenix.mr.rpc.timeout";
+public static final String PHOENIX_MR_TASK_TIMEOUT =
+"phoenix.mr.task.timeout";
+public static final String PHOENIX_MR_CLIENT_RETRIES_NUMBER =
+"phoenix.mr.client.retries.number";
+public static final String PHOENIX_MR_CLIENT_PAUSE =
+"phoenix.mr.client.retries.number";
+public static final String PHOENIX_MR_ZK_RECOVERY_RETRY =
+"phoenix.mr.zk.recovery.retry";
 private static final String AUTO_INDEX_BUILD_LOCK_NAME = 
"ActiveStandbyElectorLock";
-
+private static final int DEFAULT_TIMEOUT_IN_MILLIS = 60;
+public static final int DEFAULT_MR_CLIENT_SCANNER_TIMEOUT_PERIOD = 
DEFAULT_TIMEOUT_IN_MILLIS;
+public static final int DEFAULT_MR_RPC_TIMEOUT = DEFAULT_TIMEOUT_IN_MILLIS;
+public static final int DEFAULT_MR_TASK_TIMEOUT = 
DEFAULT_TIMEOUT_IN_MILLIS;
+// Reduced HBase/Zookeeper Client Retries
+public static final int DEFAULT_MR_CLIENT_RETRIES_NUMBER = 10;
+public static final int DEFAULT_MR_CLIENT_PAUSE = 1000;
+public static final int DEFAULT_MR_ZK_RECOVERY_RETRY = 1;
+
 public static final String CANDIDATE_INDEX_INFO_QUERY = "SELECT "
 + PhoenixDatabaseMetaData.INDEX_TYPE + ","
 + PhoenixDatabaseMetaData.DATA_TABLE_NAME + ", "
@@ -103,7 +124,28 @@ public class PhoenixMRJobSubmitter {
 }
 this.conf = conf;
 
-PhoenixMRJobUtil.updateTimeoutsToFailFast(conf);
+// Have Phoenix specific properties for defaults to enable potential 
override
+conf.setLong(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD, 
+conf.getLong(PHOENIX_MR_CLIENT_SCANNER_TIMEOUT_PERIOD,
+DEFAULT_MR_CLIENT_SCANNER_TIMEOUT_PERIOD));
+conf.setLong(HConstants.HBASE_RPC_TIMEOUT_KEY, 
+conf.getLong(PHOENIX_MR_RPC_TIMEOUT,
+DEFAULT_MR_RPC_TIMEOUT));
+conf.setLong(MRJobConfig.TASK_TIMEOUT, 
+  

[3/7] phoenix git commit: PHOENIX-3856 StatementContext class constructor not honouring supplied scan object (Sukumar Maddineni)

2018-05-09 Thread jamestaylor
PHOENIX-3856 StatementContext class constructor not honouring supplied scan 
object (Sukumar Maddineni)


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

Branch: refs/heads/master
Commit: a53d830ac9d51088eae82d668a2674926ea50f78
Parents: 48e5f43
Author: James Taylor 
Authored: Thu May 3 09:32:57 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:39:41 2018 -0700

--
 .../src/main/java/org/apache/phoenix/compile/StatementContext.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/a53d830a/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 c105046..3e5c8f2 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
@@ -98,7 +98,7 @@ public class StatementContext {
 }
 
 public StatementContext(PhoenixStatement statement, Scan scan) {
-this(statement, FromCompiler.EMPTY_TABLE_RESOLVER, new Scan(), new 
SequenceManager(statement));
+this(statement, FromCompiler.EMPTY_TABLE_RESOLVER, scan, new 
SequenceManager(statement));
 }
 
 public StatementContext(PhoenixStatement statement, ColumnResolver 
resolver) {



[1/7] phoenix git commit: PHOENIX-4678 ndexScrutinyTool generates malformed query due to incorrect table name(s) (Josh Elser)

2018-05-09 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/master 637cedbd4 -> 6157c13ee


PHOENIX-4678 ndexScrutinyTool generates malformed query due to incorrect table 
name(s) (Josh Elser)


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

Branch: refs/heads/master
Commit: 4dac9d632454864bb526c7fa144eb49cad850260
Parents: 766ffac
Author: James Taylor 
Authored: Wed May 9 12:50:22 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:39:41 2018 -0700

--
 phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/4dac9d63/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
--
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
index b43f54e..92a2cde 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
@@ -1132,7 +1132,7 @@ public class SchemaUtil {
  * @return the byte representation of the HTable
  */
 public static String getQualifiedTableName(String schemaName, String 
tableName) {
-if (schemaName != null) {
+if (schemaName != null && !schemaName.isEmpty()) {
 return String.format("%s.%s", normalizeIdentifier(schemaName),
 normalizeIdentifier(tableName));
 } else {



[6/7] phoenix git commit: PHOENIX-4727 Parameterize transaction tests with TRANSACTION_PROVIDER

2018-05-09 Thread jamestaylor
PHOENIX-4727 Parameterize transaction tests with TRANSACTION_PROVIDER


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

Branch: refs/heads/master
Commit: 3fefaca3820bbfb0dac29eb907a98824b291b622
Parents: 056f9c6
Author: James Taylor 
Authored: Mon May 7 18:23:03 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:39:41 2018 -0700

--
 .../phoenix/end2end/index/MutableIndexIT.java   | 21 +++---
 .../org/apache/phoenix/tx/TransactionIT.java| 75 +++-
 .../java/org/apache/phoenix/util/TestUtil.java  |  6 +-
 3 files changed, 74 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/3fefaca3/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
index 631f97f..e968e99 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
@@ -81,11 +81,11 @@ public class MutableIndexIT extends ParallelStatsDisabledIT 
{
 protected final boolean localIndex;
 private final String tableDDLOptions;

-public MutableIndexIT(boolean localIndex, boolean transactional, boolean 
columnEncoded) {
+public MutableIndexIT(Boolean localIndex, String txProvider, Boolean 
columnEncoded) {
this.localIndex = localIndex;
StringBuilder optionBuilder = new StringBuilder();
-   if (transactional) {
-   optionBuilder.append("TRANSACTIONAL=true");
+   if (txProvider != null) {
+   optionBuilder.append("TRANSACTIONAL=true," + 
PhoenixDatabaseMetaData.TRANSACTION_PROVIDER + "='" + txProvider + "'");
}
if (!columnEncoded) {
 if (optionBuilder.length()!=0)
@@ -107,12 +107,15 @@ public class MutableIndexIT extends 
ParallelStatsDisabledIT {
 }
 

@Parameters(name="MutableIndexIT_localIndex={0},transactional={1},columnEncoded={2}")
 // name is used by failsafe as file name in reports
-public static Collection data() {
-return Arrays.asList(new Boolean[][] { 
-{ false, false, false }, { false, false, true },
-{ false, true, false }, { false, true, true },
-{ true, false, false }, { true, false, true },
-{ true, true, false }, { true, true, true } });
+public static Collection data() {
+return Arrays.asList(new Object[][] { 
+{ false, null, false }, { false, null, true },
+{ false, "TEPHRA", false }, { false, "TEPHRA", true },
+//{ false, "OMID", false }, { false, "OMID", true },
+{ true, null, false }, { true, null, true },
+{ true, "TEPHRA", false }, { true, "TEPHRA", true },
+//{ true, "OMID", false }, { true, "OMID", true },
+});
 }
 
 @Test

http://git-wip-us.apache.org/repos/asf/phoenix/blob/3fefaca3/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
index f1344e0..c0ec6b8 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
@@ -32,6 +32,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
+import java.util.Arrays;
+import java.util.Collection;
 import java.util.Properties;
 
 import org.apache.hadoop.hbase.HColumnDescriptor;
@@ -43,6 +45,7 @@ import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.query.QueryConstants;
 import org.apache.phoenix.query.QueryServicesOptions;
+import org.apache.phoenix.schema.PTable;
 import org.apache.phoenix.schema.PTableKey;
 import org.apache.phoenix.transaction.PhoenixTransactionContext;
 import org.apache.phoenix.transaction.TransactionFactory;
@@ -52,16 +55,33 @@ import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.StringUtil;
 import org.apache.phoenix.util.TestUtil;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit

[5/7] phoenix git commit: PHOENIX-3270 Remove @Ignore tag for TransactionIT.testNonTxToTxTableFailure()

2018-05-09 Thread jamestaylor
PHOENIX-3270 Remove @Ignore tag for TransactionIT.testNonTxToTxTableFailure()


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

Branch: refs/heads/master
Commit: 056f9c6af3ff6c6333b8f1d7316f809652312e7b
Parents: a53d830
Author: James Taylor 
Authored: Thu May 3 09:52:57 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:39:41 2018 -0700

--
 .../it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java  | 2 --
 1 file changed, 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/056f9c6a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
index 580f055..ec1cf3a 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
@@ -57,7 +57,6 @@ import 
org.apache.phoenix.transaction.PhoenixTransactionContext;
 import org.apache.phoenix.util.ByteUtil;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.TestUtil;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -323,7 +322,6 @@ public class ParameterizedTransactionIT extends 
ParallelStatsDisabledIT {
 assertFalse(rs.next());
 }
 
-@Ignore
 @Test
 public void testNonTxToTxTableFailure() throws Exception {
 String nonTxTableName = generateUniqueName();



[7/7] phoenix git commit: PHOENIX-4646 The data exceeds the max capacity for the data type error for valid scenarios (Sergey Soldatov)

2018-05-09 Thread jamestaylor
PHOENIX-4646 The data exceeds the max capacity for the data type error for 
valid scenarios (Sergey Soldatov)


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

Branch: refs/heads/master
Commit: 6157c13ee316e5a000c9cd2fb2062d7c4f3f0caf
Parents: 4dac9d6
Author: James Taylor 
Authored: Wed May 9 13:12:26 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:39:42 2018 -0700

--
 .../apache/phoenix/end2end/UpsertSelectIT.java   | 19 +++
 .../apache/phoenix/schema/types/PVarchar.java| 10 ++
 2 files changed, 25 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/6157c13e/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
index 275d72d..e6feea6 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
@@ -1486,6 +1486,25 @@ public class UpsertSelectIT extends 
ParallelStatsDisabledIT {
 }
 }
 
+@Test // See https://issues.apache.org/jira/browse/PHOENIX-4646
+public void testLengthLimitedVarchar() throws Exception {
+String tableName1 = generateUniqueName();
+String tableName2 = generateUniqueName();
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+conn.setAutoCommit(true);
+conn.createStatement().execute("create table " + tableName1 + 
"(name varchar(160) primary key, id varchar(120), address varchar(160))"); 
+conn.createStatement().execute("create table " + tableName2 + 
"(name varchar(160) primary key, id varchar(10), address  varchar(10))");
+conn.createStatement().execute("upsert into " + tableName1 + " 
values('test','test','test')");
+conn.createStatement().execute("upsert into " + tableName2 + " 
select * from " + tableName1);
+ResultSet rs = conn.createStatement().executeQuery("select * from 
" + tableName2);
+assertTrue(rs.next());
+assertEquals("test", rs.getString(1));
+assertEquals("test", rs.getString(2));
+assertEquals("test", rs.getString(2));
+assertFalse(rs.next());
+}
+}
+
 private static Connection getTenantConnection(String tenantId) throws 
Exception {
 Properties props = PropertiesUtil.deepCopy(TestUtil.TEST_PROPERTIES);
 props.setProperty(TENANT_ID_ATTRIB, tenantId);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/6157c13e/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
index fb5a045..a99925c 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
@@ -102,15 +102,17 @@ public class PVarchar extends PDataType {
 SortOrder sortOrder, Integer maxLength, Integer scale,
 Integer desiredMaxLength, Integer desiredScale) {
 if (ptr.getLength() != 0 && desiredMaxLength != null) {
-if (maxLength == null) {
+if (maxLength == null || maxLength > desiredMaxLength) {
 if (value != null) { // Use value if provided
 maxLength = value.toString().length();
 } else {
-coerceBytes(ptr, value, srcType, maxLength, scale, 
sortOrder, desiredMaxLength, desiredScale, sortOrder, true);
-maxLength = StringUtil.calculateUTF8Length(ptr.get(), 
ptr.getOffset(), ptr.getLength(), sortOrder);
+coerceBytes(ptr, value, srcType, maxLength, scale, 
sortOrder, desiredMaxLength,
+desiredScale, sortOrder, true);
+maxLength = StringUtil
+.calculateUTF8Length(ptr.get(), ptr.getOffset(), 
ptr.getLength(), sortOrder);
 }
+return maxLength <= desiredMaxLength;
 }
-return maxLength <= desiredMaxLength;
 }
 return true;
 }



[2/7] phoenix git commit: PHOENIX-4623 Inconsistent physical view index name

2018-05-09 Thread jamestaylor
PHOENIX-4623 Inconsistent physical view index name


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

Branch: refs/heads/master
Commit: 766ffac17a94697b4f548abb4b6171e03c7a3fdb
Parents: 3fefaca
Author: James Taylor 
Authored: Tue May 8 16:29:41 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:39:41 2018 -0700

--
 .../org/apache/phoenix/end2end/BaseViewIT.java|  7 +++
 .../java/org/apache/phoenix/end2end/ViewIT.java   |  2 +-
 .../phoenix/schema/stats/StatsCollectorIT.java|  3 +--
 .../org/apache/phoenix/util/MetaDataUtil.java | 18 +-
 .../java/org/apache/phoenix/util/UpgradeUtil.java |  2 +-
 5 files changed, 11 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/766ffac1/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
index 478b234..5728a20 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
@@ -46,7 +46,6 @@ import org.apache.phoenix.util.MetaDataUtil;
 import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.SchemaUtil;
-import org.apache.phoenix.util.TestUtil;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
@@ -66,7 +65,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
if (transactional) {
optionBuilder.append(" TRANSACTIONAL=true ");
}
-   this.schemaName = TestUtil.DEFAULT_SCHEMA_NAME;
+   this.schemaName = "S_" + generateUniqueName();
this.tableDDLOptions = optionBuilder.toString();
this.tableName = "T_" + generateUniqueName();
 this.fullTableName = SchemaUtil.getTableName(schemaName, tableName);
@@ -166,7 +165,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 ResultSet rs;
 Connection conn = DriverManager.getConnection(getUrl());
 String viewIndexName1 = "I_" + generateUniqueName();
-String viewIndexPhysicalName = 
MetaDataUtil.getViewIndexName(schemaName, tableName);
+String viewIndexPhysicalName = 
MetaDataUtil.getViewIndexPhysicalName(fullTableName);
 if (localIndex) {
 conn.createStatement().execute("CREATE LOCAL INDEX " + 
viewIndexName1 + " on " + viewName + "(k3)");
 } else {
@@ -231,7 +230,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 rs = conn.createStatement().executeQuery("EXPLAIN " + query);
 String physicalTableName;
 if (localIndex) {
-physicalTableName = tableName;
+physicalTableName = fullTableName;
 assertEquals("CLIENT PARALLEL "+ (saltBuckets == null ? 1 : 
saltBuckets)  +"-WAY RANGE SCAN OVER " + fullTableName +" [" + (2) + ",'foo']\n"
 + "SERVER FILTER BY FIRST KEY ONLY\n"
 + "CLIENT MERGE SORT",QueryUtil.getExplainPlan(rs));

http://git-wip-us.apache.org/repos/asf/phoenix/blob/766ffac1/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
index 279bbd7..34292ba 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
@@ -69,7 +69,7 @@ public class ViewIT extends BaseViewIT {
 String ddl = "CREATE TABLE " + fullTableName + " (k INTEGER NOT NULL 
PRIMARY KEY, v1 DATE) "+ tableDDLOptions;
 conn.createStatement().execute(ddl);
 String fullParentViewName = "V_" + generateUniqueName();
-ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * 
FROM " + tableName + " WHERE k > 5";
+ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * 
FROM " + fullTableName + " WHERE k > 5";
 conn.createStatement().execute(ddl);
 try {
 conn.createStatement().execute("UPSERT INTO " + fullParentViewName 
+ " VALUES(1)");

http://git-wip-us.apache.org/repos/asf/phoenix/blob/766ffac1/phoenix-core/src/it/java/org/apache/phoenix/schema/stat

[4/4] phoenix git commit: PHOENIX-4646 The data exceeds the max capacity for the data type error for valid scenarios (Sergey Soldatov)

2018-05-09 Thread jamestaylor
PHOENIX-4646 The data exceeds the max capacity for the data type error for 
valid scenarios (Sergey Soldatov)


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

Branch: refs/heads/4.x-HBase-1.3
Commit: cc0de5d274e56205051dc5968281f5152e035ab2
Parents: 7c20fda
Author: James Taylor 
Authored: Wed May 9 13:12:26 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:37:10 2018 -0700

--
 .../apache/phoenix/end2end/UpsertSelectIT.java   | 19 +++
 .../apache/phoenix/schema/types/PVarchar.java| 10 ++
 2 files changed, 25 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/cc0de5d2/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
index 275d72d..e6feea6 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
@@ -1486,6 +1486,25 @@ public class UpsertSelectIT extends 
ParallelStatsDisabledIT {
 }
 }
 
+@Test // See https://issues.apache.org/jira/browse/PHOENIX-4646
+public void testLengthLimitedVarchar() throws Exception {
+String tableName1 = generateUniqueName();
+String tableName2 = generateUniqueName();
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+conn.setAutoCommit(true);
+conn.createStatement().execute("create table " + tableName1 + 
"(name varchar(160) primary key, id varchar(120), address varchar(160))"); 
+conn.createStatement().execute("create table " + tableName2 + 
"(name varchar(160) primary key, id varchar(10), address  varchar(10))");
+conn.createStatement().execute("upsert into " + tableName1 + " 
values('test','test','test')");
+conn.createStatement().execute("upsert into " + tableName2 + " 
select * from " + tableName1);
+ResultSet rs = conn.createStatement().executeQuery("select * from 
" + tableName2);
+assertTrue(rs.next());
+assertEquals("test", rs.getString(1));
+assertEquals("test", rs.getString(2));
+assertEquals("test", rs.getString(2));
+assertFalse(rs.next());
+}
+}
+
 private static Connection getTenantConnection(String tenantId) throws 
Exception {
 Properties props = PropertiesUtil.deepCopy(TestUtil.TEST_PROPERTIES);
 props.setProperty(TENANT_ID_ATTRIB, tenantId);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/cc0de5d2/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
index fb5a045..a99925c 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
@@ -102,15 +102,17 @@ public class PVarchar extends PDataType {
 SortOrder sortOrder, Integer maxLength, Integer scale,
 Integer desiredMaxLength, Integer desiredScale) {
 if (ptr.getLength() != 0 && desiredMaxLength != null) {
-if (maxLength == null) {
+if (maxLength == null || maxLength > desiredMaxLength) {
 if (value != null) { // Use value if provided
 maxLength = value.toString().length();
 } else {
-coerceBytes(ptr, value, srcType, maxLength, scale, 
sortOrder, desiredMaxLength, desiredScale, sortOrder, true);
-maxLength = StringUtil.calculateUTF8Length(ptr.get(), 
ptr.getOffset(), ptr.getLength(), sortOrder);
+coerceBytes(ptr, value, srcType, maxLength, scale, 
sortOrder, desiredMaxLength,
+desiredScale, sortOrder, true);
+maxLength = StringUtil
+.calculateUTF8Length(ptr.get(), ptr.getOffset(), 
ptr.getLength(), sortOrder);
 }
+return maxLength <= desiredMaxLength;
 }
-return maxLength <= desiredMaxLength;
 }
 return true;
 }



[06/10] phoenix git commit: PHOENIX-4623 Inconsistent physical view index name

2018-05-09 Thread jamestaylor
PHOENIX-4623 Inconsistent physical view index name


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

Branch: refs/heads/4.x-cdh5.11
Commit: 034d9867ad0a2dd1c94b26d9108f39aba1dbc024
Parents: de4c348
Author: James Taylor 
Authored: Tue May 8 16:29:41 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:40 2018 -0700

--
 .../org/apache/phoenix/end2end/BaseViewIT.java|  7 +++
 .../java/org/apache/phoenix/end2end/ViewIT.java   |  2 +-
 .../phoenix/schema/stats/StatsCollectorIT.java|  3 +--
 .../org/apache/phoenix/util/MetaDataUtil.java | 18 +-
 .../java/org/apache/phoenix/util/UpgradeUtil.java |  2 +-
 5 files changed, 11 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/034d9867/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
index 478b234..5728a20 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
@@ -46,7 +46,6 @@ import org.apache.phoenix.util.MetaDataUtil;
 import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.SchemaUtil;
-import org.apache.phoenix.util.TestUtil;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
@@ -66,7 +65,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
if (transactional) {
optionBuilder.append(" TRANSACTIONAL=true ");
}
-   this.schemaName = TestUtil.DEFAULT_SCHEMA_NAME;
+   this.schemaName = "S_" + generateUniqueName();
this.tableDDLOptions = optionBuilder.toString();
this.tableName = "T_" + generateUniqueName();
 this.fullTableName = SchemaUtil.getTableName(schemaName, tableName);
@@ -166,7 +165,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 ResultSet rs;
 Connection conn = DriverManager.getConnection(getUrl());
 String viewIndexName1 = "I_" + generateUniqueName();
-String viewIndexPhysicalName = 
MetaDataUtil.getViewIndexName(schemaName, tableName);
+String viewIndexPhysicalName = 
MetaDataUtil.getViewIndexPhysicalName(fullTableName);
 if (localIndex) {
 conn.createStatement().execute("CREATE LOCAL INDEX " + 
viewIndexName1 + " on " + viewName + "(k3)");
 } else {
@@ -231,7 +230,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 rs = conn.createStatement().executeQuery("EXPLAIN " + query);
 String physicalTableName;
 if (localIndex) {
-physicalTableName = tableName;
+physicalTableName = fullTableName;
 assertEquals("CLIENT PARALLEL "+ (saltBuckets == null ? 1 : 
saltBuckets)  +"-WAY RANGE SCAN OVER " + fullTableName +" [" + (2) + ",'foo']\n"
 + "SERVER FILTER BY FIRST KEY ONLY\n"
 + "CLIENT MERGE SORT",QueryUtil.getExplainPlan(rs));

http://git-wip-us.apache.org/repos/asf/phoenix/blob/034d9867/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
index 279bbd7..34292ba 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
@@ -69,7 +69,7 @@ public class ViewIT extends BaseViewIT {
 String ddl = "CREATE TABLE " + fullTableName + " (k INTEGER NOT NULL 
PRIMARY KEY, v1 DATE) "+ tableDDLOptions;
 conn.createStatement().execute(ddl);
 String fullParentViewName = "V_" + generateUniqueName();
-ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * 
FROM " + tableName + " WHERE k > 5";
+ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * 
FROM " + fullTableName + " WHERE k > 5";
 conn.createStatement().execute(ddl);
 try {
 conn.createStatement().execute("UPSERT INTO " + fullParentViewName 
+ " VALUES(1)");

http://git-wip-us.apache.org/repos/asf/phoenix/blob/034d9867/phoenix-core/src/it/java/org/apache/phoenix/schema

[3/4] phoenix git commit: PHOENIX-4678 ndexScrutinyTool generates malformed query due to incorrect table name(s) (Josh Elser)

2018-05-09 Thread jamestaylor
PHOENIX-4678 ndexScrutinyTool generates malformed query due to incorrect table 
name(s) (Josh Elser)


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

Branch: refs/heads/4.x-HBase-1.3
Commit: 7c20fdad9f100e5fbd36eb5e803603354ed2b180
Parents: 4d6f12e
Author: James Taylor 
Authored: Wed May 9 12:50:22 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:37:10 2018 -0700

--
 phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/7c20fdad/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
--
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
index b43f54e..92a2cde 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
@@ -1132,7 +1132,7 @@ public class SchemaUtil {
  * @return the byte representation of the HTable
  */
 public static String getQualifiedTableName(String schemaName, String 
tableName) {
-if (schemaName != null) {
+if (schemaName != null && !schemaName.isEmpty()) {
 return String.format("%s.%s", normalizeIdentifier(schemaName),
 normalizeIdentifier(tableName));
 } else {



[2/4] phoenix git commit: PHOENIX-4623 Inconsistent physical view index name

2018-05-09 Thread jamestaylor
PHOENIX-4623 Inconsistent physical view index name


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

Branch: refs/heads/4.x-HBase-1.3
Commit: 4d6f12e6097c8173abc799ef6cb3275c161e110c
Parents: 4849fbe
Author: James Taylor 
Authored: Tue May 8 16:29:41 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:36:32 2018 -0700

--
 .../org/apache/phoenix/end2end/BaseViewIT.java|  7 +++
 .../java/org/apache/phoenix/end2end/ViewIT.java   |  2 +-
 .../phoenix/schema/stats/StatsCollectorIT.java|  3 +--
 .../org/apache/phoenix/util/MetaDataUtil.java | 18 +-
 .../java/org/apache/phoenix/util/UpgradeUtil.java |  2 +-
 5 files changed, 11 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/4d6f12e6/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
index 478b234..5728a20 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
@@ -46,7 +46,6 @@ import org.apache.phoenix.util.MetaDataUtil;
 import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.SchemaUtil;
-import org.apache.phoenix.util.TestUtil;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
@@ -66,7 +65,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
if (transactional) {
optionBuilder.append(" TRANSACTIONAL=true ");
}
-   this.schemaName = TestUtil.DEFAULT_SCHEMA_NAME;
+   this.schemaName = "S_" + generateUniqueName();
this.tableDDLOptions = optionBuilder.toString();
this.tableName = "T_" + generateUniqueName();
 this.fullTableName = SchemaUtil.getTableName(schemaName, tableName);
@@ -166,7 +165,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 ResultSet rs;
 Connection conn = DriverManager.getConnection(getUrl());
 String viewIndexName1 = "I_" + generateUniqueName();
-String viewIndexPhysicalName = 
MetaDataUtil.getViewIndexName(schemaName, tableName);
+String viewIndexPhysicalName = 
MetaDataUtil.getViewIndexPhysicalName(fullTableName);
 if (localIndex) {
 conn.createStatement().execute("CREATE LOCAL INDEX " + 
viewIndexName1 + " on " + viewName + "(k3)");
 } else {
@@ -231,7 +230,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 rs = conn.createStatement().executeQuery("EXPLAIN " + query);
 String physicalTableName;
 if (localIndex) {
-physicalTableName = tableName;
+physicalTableName = fullTableName;
 assertEquals("CLIENT PARALLEL "+ (saltBuckets == null ? 1 : 
saltBuckets)  +"-WAY RANGE SCAN OVER " + fullTableName +" [" + (2) + ",'foo']\n"
 + "SERVER FILTER BY FIRST KEY ONLY\n"
 + "CLIENT MERGE SORT",QueryUtil.getExplainPlan(rs));

http://git-wip-us.apache.org/repos/asf/phoenix/blob/4d6f12e6/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
index 279bbd7..34292ba 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
@@ -69,7 +69,7 @@ public class ViewIT extends BaseViewIT {
 String ddl = "CREATE TABLE " + fullTableName + " (k INTEGER NOT NULL 
PRIMARY KEY, v1 DATE) "+ tableDDLOptions;
 conn.createStatement().execute(ddl);
 String fullParentViewName = "V_" + generateUniqueName();
-ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * 
FROM " + tableName + " WHERE k > 5";
+ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * 
FROM " + fullTableName + " WHERE k > 5";
 conn.createStatement().execute(ddl);
 try {
 conn.createStatement().execute("UPSERT INTO " + fullParentViewName 
+ " VALUES(1)");

http://git-wip-us.apache.org/repos/asf/phoenix/blob/4d6f12e6/phoenix-core/src/it/java/org/apache/phoenix/sche

[1/4] phoenix git commit: PHOENIX-4732 Improve config defaults for async secondary index MR jobs

2018-05-09 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.3 7e5c3871d -> cc0de5d27


PHOENIX-4732 Improve config defaults for async secondary index MR jobs


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

Branch: refs/heads/4.x-HBase-1.3
Commit: 4849fbe2b7160d9cf0e1f05b93ae39b186d3f144
Parents: 7e5c387
Author: James Taylor 
Authored: Tue May 8 15:26:44 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:35:52 2018 -0700

--
 .../index/automation/PhoenixMRJobSubmitter.java | 48 ++--
 .../apache/phoenix/util/PhoenixMRJobUtil.java   | 18 +++-
 2 files changed, 52 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/4849fbe2/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 9c447e8..d86802a 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
@@ -45,6 +45,7 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
+import org.apache.hadoop.mapreduce.MRJobConfig;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.mapreduce.index.IndexTool;
@@ -53,8 +54,8 @@ import org.apache.phoenix.schema.PTable.IndexType;
 import org.apache.phoenix.schema.PTableType;
 import org.apache.phoenix.schema.types.PDate;
 import org.apache.phoenix.util.PhoenixMRJobUtil;
-import org.apache.phoenix.util.UpgradeUtil;
 import org.apache.phoenix.util.PhoenixMRJobUtil.MR_SCHEDULER_TYPE;
+import org.apache.phoenix.util.UpgradeUtil;
 import org.apache.phoenix.util.ZKBasedMasterElectionUtil;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONObject;
@@ -69,8 +70,28 @@ public class PhoenixMRJobSubmitter {
 // Lock to elect a master node that submits the Phoenix Secondary Index MR 
Jobs
 private static final String PHOENIX_LOCKS_PARENT =
 "/phoenix/automated-mr-index-build-leader-election";
+public static final String PHOENIX_MR_CLIENT_SCANNER_TIMEOUT_PERIOD =
+"phoenix.mr.client.scanner.timeout.period";
+public static final String PHOENIX_MR_RPC_TIMEOUT =
+"phoenix.mr.rpc.timeout";
+public static final String PHOENIX_MR_TASK_TIMEOUT =
+"phoenix.mr.task.timeout";
+public static final String PHOENIX_MR_CLIENT_RETRIES_NUMBER =
+"phoenix.mr.client.retries.number";
+public static final String PHOENIX_MR_CLIENT_PAUSE =
+"phoenix.mr.client.retries.number";
+public static final String PHOENIX_MR_ZK_RECOVERY_RETRY =
+"phoenix.mr.zk.recovery.retry";
 private static final String AUTO_INDEX_BUILD_LOCK_NAME = 
"ActiveStandbyElectorLock";
-
+private static final int DEFAULT_TIMEOUT_IN_MILLIS = 60;
+public static final int DEFAULT_MR_CLIENT_SCANNER_TIMEOUT_PERIOD = 
DEFAULT_TIMEOUT_IN_MILLIS;
+public static final int DEFAULT_MR_RPC_TIMEOUT = DEFAULT_TIMEOUT_IN_MILLIS;
+public static final int DEFAULT_MR_TASK_TIMEOUT = 
DEFAULT_TIMEOUT_IN_MILLIS;
+// Reduced HBase/Zookeeper Client Retries
+public static final int DEFAULT_MR_CLIENT_RETRIES_NUMBER = 10;
+public static final int DEFAULT_MR_CLIENT_PAUSE = 1000;
+public static final int DEFAULT_MR_ZK_RECOVERY_RETRY = 1;
+
 public static final String CANDIDATE_INDEX_INFO_QUERY = "SELECT "
 + PhoenixDatabaseMetaData.INDEX_TYPE + ","
 + PhoenixDatabaseMetaData.DATA_TABLE_NAME + ", "
@@ -103,7 +124,28 @@ public class PhoenixMRJobSubmitter {
 }
 this.conf = conf;
 
-PhoenixMRJobUtil.updateTimeoutsToFailFast(conf);
+// Have Phoenix specific properties for defaults to enable potential 
override
+conf.setLong(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD, 
+conf.getLong(PHOENIX_MR_CLIENT_SCANNER_TIMEOUT_PERIOD,
+DEFAULT_MR_CLIENT_SCANNER_TIMEOUT_PERIOD));
+conf.setLong(HConstants.HBASE_RPC_TIMEOUT_KEY, 
+conf.getLong(PHOENIX_MR_RPC_TIMEOUT,
+ 

[07/10] phoenix git commit: PHOENIX-4646 The data exceeds the max capacity for the data type error for valid scenarios (Sergey Soldatov)

2018-05-09 Thread jamestaylor
PHOENIX-4646 The data exceeds the max capacity for the data type error for 
valid scenarios (Sergey Soldatov)


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

Branch: refs/heads/4.x-cdh5.11
Commit: 810ed4e37a24cc281c46ece4ed958e45ab458ba2
Parents: f1230c0
Author: James Taylor 
Authored: Wed May 9 13:12:26 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:40 2018 -0700

--
 .../apache/phoenix/end2end/UpsertSelectIT.java   | 19 +++
 .../apache/phoenix/schema/types/PVarchar.java| 10 ++
 2 files changed, 25 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/810ed4e3/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
index 99cbe47..5db1fdd 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
@@ -1488,6 +1488,25 @@ public class UpsertSelectIT extends 
ParallelStatsDisabledIT {
 }
 }
 
+@Test // See https://issues.apache.org/jira/browse/PHOENIX-4646
+public void testLengthLimitedVarchar() throws Exception {
+String tableName1 = generateUniqueName();
+String tableName2 = generateUniqueName();
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+conn.setAutoCommit(true);
+conn.createStatement().execute("create table " + tableName1 + 
"(name varchar(160) primary key, id varchar(120), address varchar(160))"); 
+conn.createStatement().execute("create table " + tableName2 + 
"(name varchar(160) primary key, id varchar(10), address  varchar(10))");
+conn.createStatement().execute("upsert into " + tableName1 + " 
values('test','test','test')");
+conn.createStatement().execute("upsert into " + tableName2 + " 
select * from " + tableName1);
+ResultSet rs = conn.createStatement().executeQuery("select * from 
" + tableName2);
+assertTrue(rs.next());
+assertEquals("test", rs.getString(1));
+assertEquals("test", rs.getString(2));
+assertEquals("test", rs.getString(2));
+assertFalse(rs.next());
+}
+}
+
 private static Connection getTenantConnection(String tenantId) throws 
Exception {
 Properties props = PropertiesUtil.deepCopy(TestUtil.TEST_PROPERTIES);
 props.setProperty(TENANT_ID_ATTRIB, tenantId);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/810ed4e3/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
index fb5a045..a99925c 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
@@ -102,15 +102,17 @@ public class PVarchar extends PDataType {
 SortOrder sortOrder, Integer maxLength, Integer scale,
 Integer desiredMaxLength, Integer desiredScale) {
 if (ptr.getLength() != 0 && desiredMaxLength != null) {
-if (maxLength == null) {
+if (maxLength == null || maxLength > desiredMaxLength) {
 if (value != null) { // Use value if provided
 maxLength = value.toString().length();
 } else {
-coerceBytes(ptr, value, srcType, maxLength, scale, 
sortOrder, desiredMaxLength, desiredScale, sortOrder, true);
-maxLength = StringUtil.calculateUTF8Length(ptr.get(), 
ptr.getOffset(), ptr.getLength(), sortOrder);
+coerceBytes(ptr, value, srcType, maxLength, scale, 
sortOrder, desiredMaxLength,
+desiredScale, sortOrder, true);
+maxLength = StringUtil
+.calculateUTF8Length(ptr.get(), ptr.getOffset(), 
ptr.getLength(), sortOrder);
 }
+return maxLength <= desiredMaxLength;
 }
-return maxLength <= desiredMaxLength;
 }
 return true;
 }



[08/10] phoenix git commit: PHOENIX-4678 ndexScrutinyTool generates malformed query due to incorrect table name(s) (Josh Elser)

2018-05-09 Thread jamestaylor
PHOENIX-4678 ndexScrutinyTool generates malformed query due to incorrect table 
name(s) (Josh Elser)


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

Branch: refs/heads/4.x-cdh5.11
Commit: f1230c0a04e215230ec0312fe62a34841eec6eaa
Parents: 034d986
Author: James Taylor 
Authored: Wed May 9 12:50:22 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:40 2018 -0700

--
 phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f1230c0a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
--
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
index b43f54e..92a2cde 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
@@ -1132,7 +1132,7 @@ public class SchemaUtil {
  * @return the byte representation of the HTable
  */
 public static String getQualifiedTableName(String schemaName, String 
tableName) {
-if (schemaName != null) {
+if (schemaName != null && !schemaName.isEmpty()) {
 return String.format("%s.%s", normalizeIdentifier(schemaName),
 normalizeIdentifier(tableName));
 } else {



[04/10] phoenix git commit: PHOENIX-4732 Improve config defaults for async secondary index MR jobs

2018-05-09 Thread jamestaylor
PHOENIX-4732 Improve config defaults for async secondary index MR jobs


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

Branch: refs/heads/4.x-cdh5.11
Commit: 197692686b83f45ce622f806acf3fad968e8c238
Parents: 5ee89b4
Author: James Taylor 
Authored: Tue May 8 15:26:44 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:37 2018 -0700

--
 .../index/automation/PhoenixMRJobSubmitter.java | 48 ++--
 .../apache/phoenix/util/PhoenixMRJobUtil.java   | 18 +++-
 2 files changed, 52 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/19769268/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 9c447e8..d86802a 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
@@ -45,6 +45,7 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
+import org.apache.hadoop.mapreduce.MRJobConfig;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.mapreduce.index.IndexTool;
@@ -53,8 +54,8 @@ import org.apache.phoenix.schema.PTable.IndexType;
 import org.apache.phoenix.schema.PTableType;
 import org.apache.phoenix.schema.types.PDate;
 import org.apache.phoenix.util.PhoenixMRJobUtil;
-import org.apache.phoenix.util.UpgradeUtil;
 import org.apache.phoenix.util.PhoenixMRJobUtil.MR_SCHEDULER_TYPE;
+import org.apache.phoenix.util.UpgradeUtil;
 import org.apache.phoenix.util.ZKBasedMasterElectionUtil;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONObject;
@@ -69,8 +70,28 @@ public class PhoenixMRJobSubmitter {
 // Lock to elect a master node that submits the Phoenix Secondary Index MR 
Jobs
 private static final String PHOENIX_LOCKS_PARENT =
 "/phoenix/automated-mr-index-build-leader-election";
+public static final String PHOENIX_MR_CLIENT_SCANNER_TIMEOUT_PERIOD =
+"phoenix.mr.client.scanner.timeout.period";
+public static final String PHOENIX_MR_RPC_TIMEOUT =
+"phoenix.mr.rpc.timeout";
+public static final String PHOENIX_MR_TASK_TIMEOUT =
+"phoenix.mr.task.timeout";
+public static final String PHOENIX_MR_CLIENT_RETRIES_NUMBER =
+"phoenix.mr.client.retries.number";
+public static final String PHOENIX_MR_CLIENT_PAUSE =
+"phoenix.mr.client.retries.number";
+public static final String PHOENIX_MR_ZK_RECOVERY_RETRY =
+"phoenix.mr.zk.recovery.retry";
 private static final String AUTO_INDEX_BUILD_LOCK_NAME = 
"ActiveStandbyElectorLock";
-
+private static final int DEFAULT_TIMEOUT_IN_MILLIS = 60;
+public static final int DEFAULT_MR_CLIENT_SCANNER_TIMEOUT_PERIOD = 
DEFAULT_TIMEOUT_IN_MILLIS;
+public static final int DEFAULT_MR_RPC_TIMEOUT = DEFAULT_TIMEOUT_IN_MILLIS;
+public static final int DEFAULT_MR_TASK_TIMEOUT = 
DEFAULT_TIMEOUT_IN_MILLIS;
+// Reduced HBase/Zookeeper Client Retries
+public static final int DEFAULT_MR_CLIENT_RETRIES_NUMBER = 10;
+public static final int DEFAULT_MR_CLIENT_PAUSE = 1000;
+public static final int DEFAULT_MR_ZK_RECOVERY_RETRY = 1;
+
 public static final String CANDIDATE_INDEX_INFO_QUERY = "SELECT "
 + PhoenixDatabaseMetaData.INDEX_TYPE + ","
 + PhoenixDatabaseMetaData.DATA_TABLE_NAME + ", "
@@ -103,7 +124,28 @@ public class PhoenixMRJobSubmitter {
 }
 this.conf = conf;
 
-PhoenixMRJobUtil.updateTimeoutsToFailFast(conf);
+// Have Phoenix specific properties for defaults to enable potential 
override
+conf.setLong(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD, 
+conf.getLong(PHOENIX_MR_CLIENT_SCANNER_TIMEOUT_PERIOD,
+DEFAULT_MR_CLIENT_SCANNER_TIMEOUT_PERIOD));
+conf.setLong(HConstants.HBASE_RPC_TIMEOUT_KEY, 
+conf.getLong(PHOENIX_MR_RPC_TIMEOUT,
+DEFAULT_MR_RPC_TIMEOUT));
+conf.setLong(MRJobConfig.TASK_TIMEOUT, 
+ 

[09/10] phoenix git commit: PHOENIX-3270 Remove @Ignore tag for TransactionIT.testNonTxToTxTableFailure()

2018-05-09 Thread jamestaylor
PHOENIX-3270 Remove @Ignore tag for TransactionIT.testNonTxToTxTableFailure()


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

Branch: refs/heads/4.x-cdh5.11
Commit: 59aa56ea3f34592a25f141fdafc03d2da5b905ab
Parents: d23239f
Author: James Taylor 
Authored: Thu May 3 09:52:57 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:40 2018 -0700

--
 .../it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java  | 2 --
 1 file changed, 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/59aa56ea/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
index 580f055..ec1cf3a 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
@@ -57,7 +57,6 @@ import 
org.apache.phoenix.transaction.PhoenixTransactionContext;
 import org.apache.phoenix.util.ByteUtil;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.TestUtil;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -323,7 +322,6 @@ public class ParameterizedTransactionIT extends 
ParallelStatsDisabledIT {
 assertFalse(rs.next());
 }
 
-@Ignore
 @Test
 public void testNonTxToTxTableFailure() throws Exception {
 String nonTxTableName = generateUniqueName();



[10/10] phoenix git commit: PHOENIX-4727 Parameterize transaction tests with TRANSACTION_PROVIDER

2018-05-09 Thread jamestaylor
PHOENIX-4727 Parameterize transaction tests with TRANSACTION_PROVIDER


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

Branch: refs/heads/4.x-cdh5.11
Commit: de4c348b04a344537893dcef865895409d6b61e7
Parents: 59aa56e
Author: James Taylor 
Authored: Mon May 7 18:23:03 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:40 2018 -0700

--
 .../phoenix/end2end/index/MutableIndexIT.java   | 21 +++---
 .../org/apache/phoenix/tx/TransactionIT.java| 75 +++-
 .../java/org/apache/phoenix/util/TestUtil.java  |  6 +-
 3 files changed, 74 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/de4c348b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
index 631f97f..e968e99 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
@@ -81,11 +81,11 @@ public class MutableIndexIT extends ParallelStatsDisabledIT 
{
 protected final boolean localIndex;
 private final String tableDDLOptions;

-public MutableIndexIT(boolean localIndex, boolean transactional, boolean 
columnEncoded) {
+public MutableIndexIT(Boolean localIndex, String txProvider, Boolean 
columnEncoded) {
this.localIndex = localIndex;
StringBuilder optionBuilder = new StringBuilder();
-   if (transactional) {
-   optionBuilder.append("TRANSACTIONAL=true");
+   if (txProvider != null) {
+   optionBuilder.append("TRANSACTIONAL=true," + 
PhoenixDatabaseMetaData.TRANSACTION_PROVIDER + "='" + txProvider + "'");
}
if (!columnEncoded) {
 if (optionBuilder.length()!=0)
@@ -107,12 +107,15 @@ public class MutableIndexIT extends 
ParallelStatsDisabledIT {
 }
 

@Parameters(name="MutableIndexIT_localIndex={0},transactional={1},columnEncoded={2}")
 // name is used by failsafe as file name in reports
-public static Collection data() {
-return Arrays.asList(new Boolean[][] { 
-{ false, false, false }, { false, false, true },
-{ false, true, false }, { false, true, true },
-{ true, false, false }, { true, false, true },
-{ true, true, false }, { true, true, true } });
+public static Collection data() {
+return Arrays.asList(new Object[][] { 
+{ false, null, false }, { false, null, true },
+{ false, "TEPHRA", false }, { false, "TEPHRA", true },
+//{ false, "OMID", false }, { false, "OMID", true },
+{ true, null, false }, { true, null, true },
+{ true, "TEPHRA", false }, { true, "TEPHRA", true },
+//{ true, "OMID", false }, { true, "OMID", true },
+});
 }
 
 @Test

http://git-wip-us.apache.org/repos/asf/phoenix/blob/de4c348b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
index f1344e0..c0ec6b8 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
@@ -32,6 +32,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
+import java.util.Arrays;
+import java.util.Collection;
 import java.util.Properties;
 
 import org.apache.hadoop.hbase.HColumnDescriptor;
@@ -43,6 +45,7 @@ import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.query.QueryConstants;
 import org.apache.phoenix.query.QueryServicesOptions;
+import org.apache.phoenix.schema.PTable;
 import org.apache.phoenix.schema.PTableKey;
 import org.apache.phoenix.transaction.PhoenixTransactionContext;
 import org.apache.phoenix.transaction.TransactionFactory;
@@ -52,16 +55,33 @@ import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.StringUtil;
 import org.apache.phoenix.util.TestUtil;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.

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

2018-05-09 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.x-cdh5.11 8ed7eb0f5 -> 810ed4e37


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/5ee89b44
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/5ee89b44
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/5ee89b44

Branch: refs/heads/4.x-cdh5.11
Commit: 5ee89b440e4394b043674a2a0379339ef14789c6
Parents: 90dc5ef
Author: Rajeshbabu Chintaguntla 
Authored: Wed May 9 18:13:38 2018 +0530
Committer: James Taylor 
Committed: Wed May 9 13:27:36 2018 -0700

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


http://git-wip-us.apache.org/repos/asf/phoenix/blob/5ee89b44/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 d80b6fc..9190373 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
@@ -26,6 +26,7 @@ import java.io.IOException;
 import java.sql.SQLException;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutorService;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -66,8 +67,6 @@ import org.apache.phoenix.hbase.index.write.IndexWriterUtils;
 import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.query.QueryServicesOptions;
 import org.apache.phoenix.schema.StaleRegionBoundaryCacheException;
-import org.jboss.netty.util.internal.ConcurrentHashMap;
-
 
 @SuppressWarnings("deprecation")
 public class ServerUtil {



[05/10] phoenix git commit: PHOENIX-3856 StatementContext class constructor not honouring supplied scan object (Sukumar Maddineni)

2018-05-09 Thread jamestaylor
PHOENIX-3856 StatementContext class constructor not honouring supplied scan 
object (Sukumar Maddineni)


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

Branch: refs/heads/4.x-cdh5.11
Commit: d23239fd0acd4613c565c179f4880621300f3405
Parents: 1976926
Author: James Taylor 
Authored: Thu May 3 09:32:57 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:29:39 2018 -0700

--
 .../src/main/java/org/apache/phoenix/compile/StatementContext.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d23239fd/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 c105046..3e5c8f2 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
@@ -98,7 +98,7 @@ public class StatementContext {
 }
 
 public StatementContext(PhoenixStatement statement, Scan scan) {
-this(statement, FromCompiler.EMPTY_TABLE_RESOLVER, new Scan(), new 
SequenceManager(statement));
+this(statement, FromCompiler.EMPTY_TABLE_RESOLVER, scan, new 
SequenceManager(statement));
 }
 
 public StatementContext(PhoenixStatement statement, ColumnResolver 
resolver) {



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

2018-05-09 Thread jamestaylor
PHOENIX-4685 Properly handle connection caching for Phoenix inside 
RegionServers(Rajeshbabu)


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

Branch: refs/heads/4.x-cdh5.11
Commit: dde1054f34fe1784447307600d0949f35e6f475a
Parents: 8ed7eb0
Author: Rajeshbabu Chintaguntla 
Authored: Tue May 8 09:26:41 2018 +0530
Committer: James Taylor 
Committed: Wed May 9 13:27:36 2018 -0700

--
 .../DelegateRegionCoprocessorEnvironment.java   |   7 +-
 .../UngroupedAggregateRegionObserver.java   |  14 +-
 .../org/apache/phoenix/hbase/index/Indexer.java |  19 +--
 .../hbase/index/write/IndexWriterUtils.java |  27 +---
 .../index/PhoenixTransactionalIndexer.java  |  18 +--
 .../org/apache/phoenix/util/ServerUtil.java | 141 ---
 6 files changed, 142 insertions(+), 84 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/dde1054f/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionCoprocessorEnvironment.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionCoprocessorEnvironment.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionCoprocessorEnvironment.java
index 284d53c..a791f4a 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionCoprocessorEnvironment.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionCoprocessorEnvironment.java
@@ -32,6 +32,7 @@ import 
org.apache.hadoop.hbase.regionserver.RegionServerServices;
 import org.apache.phoenix.hbase.index.table.HTableFactory;
 import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr;
 import org.apache.phoenix.util.ServerUtil;
+import org.apache.phoenix.util.ServerUtil.ConnectionType;
 
 /**
  * Class to encapsulate {@link RegionCoprocessorEnvironment} for phoenix 
coprocessors. Often we
@@ -44,10 +45,10 @@ public class DelegateRegionCoprocessorEnvironment 
implements RegionCoprocessorEn
 private RegionCoprocessorEnvironment delegate;
 private HTableFactory tableFactory;
 
-public DelegateRegionCoprocessorEnvironment(Configuration config, 
RegionCoprocessorEnvironment delegate) {
-this.config = config;
+public DelegateRegionCoprocessorEnvironment(RegionCoprocessorEnvironment 
delegate, ConnectionType connectionType) {
+this.config = 
ServerUtil.ConnectionFactory.getTypeSpecificConfiguration(connectionType, 
delegate.getConfiguration());
 this.delegate = delegate;
-this.tableFactory = ServerUtil.getDelegateHTableFactory(this, config);
+this.tableFactory = ServerUtil.getDelegateHTableFactory(this, 
connectionType);
 }
 
 @Override

http://git-wip-us.apache.org/repos/asf/phoenix/blob/dde1054f/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
index 6bee65c..14213f4 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
@@ -144,6 +144,7 @@ import org.apache.phoenix.util.ReadOnlyProps;
 import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.SchemaUtil;
 import org.apache.phoenix.util.ServerUtil;
+import org.apache.phoenix.util.ServerUtil.ConnectionType;
 import org.apache.phoenix.util.StringUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -225,14 +226,7 @@ public class UngroupedAggregateRegionObserver extends 
BaseScannerRegionObserver
 
upsertSelectConfig.setClass(RpcControllerFactory.CUSTOM_CONTROLLER_CONF_KEY,
 InterRegionServerIndexRpcControllerFactory.class, 
RpcControllerFactory.class);
 
-compactionConfig = PropertiesUtil.cloneConfig(e.getConfiguration());
-// lower the number of rpc retries, so we don't hang the compaction
-compactionConfig.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER,
-
e.getConfiguration().getInt(QueryServices.METADATA_WRITE_RETRIES_NUMBER,
-QueryServicesOptions.DEFAULT_METADATA_WRITE_RETRIES_NUMBER));
-compactionConfig.setInt(HConstants.HBASE_CLIENT_PAUSE,
-
e.getConfiguration().getInt(QueryServices.METADATA_WRITE_RETRY_PAUSE,
-QueryServicesOptions.DEFAUL

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

2018-05-09 Thread jamestaylor
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/90dc5ef4
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/90dc5ef4
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/90dc5ef4

Branch: refs/heads/4.x-cdh5.11
Commit: 90dc5ef487d467d169551ce7410ec8a6bc8c7dbd
Parents: dde1054
Author: Rajeshbabu Chintaguntla 
Authored: Tue May 8 20:37:50 2018 +0530
Committer: James Taylor 
Committed: Wed May 9 13:27:36 2018 -0700

--
 phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/90dc5ef4/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 2dab076..d80b6fc 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
@@ -27,7 +27,6 @@ import java.sql.SQLException;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutorService;
-import java.util.function.Function;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 



[5/7] phoenix git commit: PHOENIX-4623 Inconsistent physical view index name

2018-05-09 Thread jamestaylor
PHOENIX-4623 Inconsistent physical view index name


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

Branch: refs/heads/4.x-HBase-1.2
Commit: 9da347dadd1a59e734392a558861824c70feeaa1
Parents: eec6830
Author: James Taylor 
Authored: Tue May 8 16:29:41 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:25:30 2018 -0700

--
 .../org/apache/phoenix/end2end/BaseViewIT.java|  7 +++
 .../java/org/apache/phoenix/end2end/ViewIT.java   |  2 +-
 .../phoenix/schema/stats/StatsCollectorIT.java|  3 +--
 .../org/apache/phoenix/util/MetaDataUtil.java | 18 +-
 .../java/org/apache/phoenix/util/UpgradeUtil.java |  2 +-
 5 files changed, 11 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/9da347da/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
index 478b234..5728a20 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
@@ -46,7 +46,6 @@ import org.apache.phoenix.util.MetaDataUtil;
 import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.SchemaUtil;
-import org.apache.phoenix.util.TestUtil;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
@@ -66,7 +65,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
if (transactional) {
optionBuilder.append(" TRANSACTIONAL=true ");
}
-   this.schemaName = TestUtil.DEFAULT_SCHEMA_NAME;
+   this.schemaName = "S_" + generateUniqueName();
this.tableDDLOptions = optionBuilder.toString();
this.tableName = "T_" + generateUniqueName();
 this.fullTableName = SchemaUtil.getTableName(schemaName, tableName);
@@ -166,7 +165,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 ResultSet rs;
 Connection conn = DriverManager.getConnection(getUrl());
 String viewIndexName1 = "I_" + generateUniqueName();
-String viewIndexPhysicalName = 
MetaDataUtil.getViewIndexName(schemaName, tableName);
+String viewIndexPhysicalName = 
MetaDataUtil.getViewIndexPhysicalName(fullTableName);
 if (localIndex) {
 conn.createStatement().execute("CREATE LOCAL INDEX " + 
viewIndexName1 + " on " + viewName + "(k3)");
 } else {
@@ -231,7 +230,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 rs = conn.createStatement().executeQuery("EXPLAIN " + query);
 String physicalTableName;
 if (localIndex) {
-physicalTableName = tableName;
+physicalTableName = fullTableName;
 assertEquals("CLIENT PARALLEL "+ (saltBuckets == null ? 1 : 
saltBuckets)  +"-WAY RANGE SCAN OVER " + fullTableName +" [" + (2) + ",'foo']\n"
 + "SERVER FILTER BY FIRST KEY ONLY\n"
 + "CLIENT MERGE SORT",QueryUtil.getExplainPlan(rs));

http://git-wip-us.apache.org/repos/asf/phoenix/blob/9da347da/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
index 279bbd7..34292ba 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
@@ -69,7 +69,7 @@ public class ViewIT extends BaseViewIT {
 String ddl = "CREATE TABLE " + fullTableName + " (k INTEGER NOT NULL 
PRIMARY KEY, v1 DATE) "+ tableDDLOptions;
 conn.createStatement().execute(ddl);
 String fullParentViewName = "V_" + generateUniqueName();
-ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * 
FROM " + tableName + " WHERE k > 5";
+ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * 
FROM " + fullTableName + " WHERE k > 5";
 conn.createStatement().execute(ddl);
 try {
 conn.createStatement().execute("UPSERT INTO " + fullParentViewName 
+ " VALUES(1)");

http://git-wip-us.apache.org/repos/asf/phoenix/blob/9da347da/phoenix-core/src/it/java/org/apache/phoenix/sche

[6/7] phoenix git commit: PHOENIX-4678 ndexScrutinyTool generates malformed query due to incorrect table name(s) (Josh Elser)

2018-05-09 Thread jamestaylor
PHOENIX-4678 ndexScrutinyTool generates malformed query due to incorrect table 
name(s) (Josh Elser)


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

Branch: refs/heads/4.x-HBase-1.2
Commit: e1e61f548c825d421caa93bbf306049dbd07f26d
Parents: 9da347d
Author: James Taylor 
Authored: Wed May 9 12:50:22 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:25:30 2018 -0700

--
 phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/e1e61f54/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
--
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
index b43f54e..92a2cde 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
@@ -1132,7 +1132,7 @@ public class SchemaUtil {
  * @return the byte representation of the HTable
  */
 public static String getQualifiedTableName(String schemaName, String 
tableName) {
-if (schemaName != null) {
+if (schemaName != null && !schemaName.isEmpty()) {
 return String.format("%s.%s", normalizeIdentifier(schemaName),
 normalizeIdentifier(tableName));
 } else {



[3/7] phoenix git commit: PHOENIX-4732 Improve config defaults for async secondary index MR jobs

2018-05-09 Thread jamestaylor
PHOENIX-4732 Improve config defaults for async secondary index MR jobs


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

Branch: refs/heads/4.x-HBase-1.2
Commit: 976ffd56ce589595e80e9244df8cc442d17d8a43
Parents: f186c30
Author: James Taylor 
Authored: Tue May 8 15:26:44 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:25:29 2018 -0700

--
 .../index/automation/PhoenixMRJobSubmitter.java | 48 ++--
 .../apache/phoenix/util/PhoenixMRJobUtil.java   | 18 +++-
 2 files changed, 52 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/976ffd56/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 9c447e8..d86802a 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
@@ -45,6 +45,7 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
+import org.apache.hadoop.mapreduce.MRJobConfig;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.mapreduce.index.IndexTool;
@@ -53,8 +54,8 @@ import org.apache.phoenix.schema.PTable.IndexType;
 import org.apache.phoenix.schema.PTableType;
 import org.apache.phoenix.schema.types.PDate;
 import org.apache.phoenix.util.PhoenixMRJobUtil;
-import org.apache.phoenix.util.UpgradeUtil;
 import org.apache.phoenix.util.PhoenixMRJobUtil.MR_SCHEDULER_TYPE;
+import org.apache.phoenix.util.UpgradeUtil;
 import org.apache.phoenix.util.ZKBasedMasterElectionUtil;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONObject;
@@ -69,8 +70,28 @@ public class PhoenixMRJobSubmitter {
 // Lock to elect a master node that submits the Phoenix Secondary Index MR 
Jobs
 private static final String PHOENIX_LOCKS_PARENT =
 "/phoenix/automated-mr-index-build-leader-election";
+public static final String PHOENIX_MR_CLIENT_SCANNER_TIMEOUT_PERIOD =
+"phoenix.mr.client.scanner.timeout.period";
+public static final String PHOENIX_MR_RPC_TIMEOUT =
+"phoenix.mr.rpc.timeout";
+public static final String PHOENIX_MR_TASK_TIMEOUT =
+"phoenix.mr.task.timeout";
+public static final String PHOENIX_MR_CLIENT_RETRIES_NUMBER =
+"phoenix.mr.client.retries.number";
+public static final String PHOENIX_MR_CLIENT_PAUSE =
+"phoenix.mr.client.retries.number";
+public static final String PHOENIX_MR_ZK_RECOVERY_RETRY =
+"phoenix.mr.zk.recovery.retry";
 private static final String AUTO_INDEX_BUILD_LOCK_NAME = 
"ActiveStandbyElectorLock";
-
+private static final int DEFAULT_TIMEOUT_IN_MILLIS = 60;
+public static final int DEFAULT_MR_CLIENT_SCANNER_TIMEOUT_PERIOD = 
DEFAULT_TIMEOUT_IN_MILLIS;
+public static final int DEFAULT_MR_RPC_TIMEOUT = DEFAULT_TIMEOUT_IN_MILLIS;
+public static final int DEFAULT_MR_TASK_TIMEOUT = 
DEFAULT_TIMEOUT_IN_MILLIS;
+// Reduced HBase/Zookeeper Client Retries
+public static final int DEFAULT_MR_CLIENT_RETRIES_NUMBER = 10;
+public static final int DEFAULT_MR_CLIENT_PAUSE = 1000;
+public static final int DEFAULT_MR_ZK_RECOVERY_RETRY = 1;
+
 public static final String CANDIDATE_INDEX_INFO_QUERY = "SELECT "
 + PhoenixDatabaseMetaData.INDEX_TYPE + ","
 + PhoenixDatabaseMetaData.DATA_TABLE_NAME + ", "
@@ -103,7 +124,28 @@ public class PhoenixMRJobSubmitter {
 }
 this.conf = conf;
 
-PhoenixMRJobUtil.updateTimeoutsToFailFast(conf);
+// Have Phoenix specific properties for defaults to enable potential 
override
+conf.setLong(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD, 
+conf.getLong(PHOENIX_MR_CLIENT_SCANNER_TIMEOUT_PERIOD,
+DEFAULT_MR_CLIENT_SCANNER_TIMEOUT_PERIOD));
+conf.setLong(HConstants.HBASE_RPC_TIMEOUT_KEY, 
+conf.getLong(PHOENIX_MR_RPC_TIMEOUT,
+DEFAULT_MR_RPC_TIMEOUT));
+conf.setLong(MRJobConfig.TASK_TIMEOUT, 

[1/7] phoenix git commit: PHOENIX-4727 Parameterize transaction tests with TRANSACTION_PROVIDER

2018-05-09 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.2 f186c3080 -> 766355614


PHOENIX-4727 Parameterize transaction tests with TRANSACTION_PROVIDER


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

Branch: refs/heads/4.x-HBase-1.2
Commit: eec6830002ed979539b8c99ebd44d3d7d6be7328
Parents: dcdc269
Author: James Taylor 
Authored: Mon May 7 18:23:03 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:25:29 2018 -0700

--
 .../phoenix/end2end/index/MutableIndexIT.java   | 21 +++---
 .../org/apache/phoenix/tx/TransactionIT.java| 75 +++-
 .../java/org/apache/phoenix/util/TestUtil.java  |  6 +-
 3 files changed, 74 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/eec68300/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
index 631f97f..e968e99 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
@@ -81,11 +81,11 @@ public class MutableIndexIT extends ParallelStatsDisabledIT 
{
 protected final boolean localIndex;
 private final String tableDDLOptions;

-public MutableIndexIT(boolean localIndex, boolean transactional, boolean 
columnEncoded) {
+public MutableIndexIT(Boolean localIndex, String txProvider, Boolean 
columnEncoded) {
this.localIndex = localIndex;
StringBuilder optionBuilder = new StringBuilder();
-   if (transactional) {
-   optionBuilder.append("TRANSACTIONAL=true");
+   if (txProvider != null) {
+   optionBuilder.append("TRANSACTIONAL=true," + 
PhoenixDatabaseMetaData.TRANSACTION_PROVIDER + "='" + txProvider + "'");
}
if (!columnEncoded) {
 if (optionBuilder.length()!=0)
@@ -107,12 +107,15 @@ public class MutableIndexIT extends 
ParallelStatsDisabledIT {
 }
 

@Parameters(name="MutableIndexIT_localIndex={0},transactional={1},columnEncoded={2}")
 // name is used by failsafe as file name in reports
-public static Collection data() {
-return Arrays.asList(new Boolean[][] { 
-{ false, false, false }, { false, false, true },
-{ false, true, false }, { false, true, true },
-{ true, false, false }, { true, false, true },
-{ true, true, false }, { true, true, true } });
+public static Collection data() {
+return Arrays.asList(new Object[][] { 
+{ false, null, false }, { false, null, true },
+{ false, "TEPHRA", false }, { false, "TEPHRA", true },
+//{ false, "OMID", false }, { false, "OMID", true },
+{ true, null, false }, { true, null, true },
+{ true, "TEPHRA", false }, { true, "TEPHRA", true },
+//{ true, "OMID", false }, { true, "OMID", true },
+});
 }
 
 @Test

http://git-wip-us.apache.org/repos/asf/phoenix/blob/eec68300/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
index f1344e0..c0ec6b8 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
@@ -32,6 +32,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
+import java.util.Arrays;
+import java.util.Collection;
 import java.util.Properties;
 
 import org.apache.hadoop.hbase.HColumnDescriptor;
@@ -43,6 +45,7 @@ import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.query.QueryConstants;
 import org.apache.phoenix.query.QueryServicesOptions;
+import org.apache.phoenix.schema.PTable;
 import org.apache.phoenix.schema.PTableKey;
 import org.apache.phoenix.transaction.PhoenixTransactionContext;
 import org.apache.phoenix.transaction.TransactionFactory;
@@ -52,16 +55,33 @@ import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.StringUtil;
 import org.apache.p

[4/7] phoenix git commit: PHOENIX-3270 Remove @Ignore tag for TransactionIT.testNonTxToTxTableFailure()

2018-05-09 Thread jamestaylor
PHOENIX-3270 Remove @Ignore tag for TransactionIT.testNonTxToTxTableFailure()


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

Branch: refs/heads/4.x-HBase-1.2
Commit: dcdc26931611ed2b4a8fcfc5a05bd848029a520c
Parents: 05bb42f
Author: James Taylor 
Authored: Thu May 3 09:52:57 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:25:29 2018 -0700

--
 .../it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java  | 2 --
 1 file changed, 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/dcdc2693/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
index 580f055..ec1cf3a 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
@@ -57,7 +57,6 @@ import 
org.apache.phoenix.transaction.PhoenixTransactionContext;
 import org.apache.phoenix.util.ByteUtil;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.TestUtil;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -323,7 +322,6 @@ public class ParameterizedTransactionIT extends 
ParallelStatsDisabledIT {
 assertFalse(rs.next());
 }
 
-@Ignore
 @Test
 public void testNonTxToTxTableFailure() throws Exception {
 String nonTxTableName = generateUniqueName();



[2/7] phoenix git commit: PHOENIX-3856 StatementContext class constructor not honouring supplied scan object (Sukumar Maddineni)

2018-05-09 Thread jamestaylor
PHOENIX-3856 StatementContext class constructor not honouring supplied scan 
object (Sukumar Maddineni)


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

Branch: refs/heads/4.x-HBase-1.2
Commit: 05bb42fdce6bb6c15b535c39b78ff9c237167b0e
Parents: 976ffd5
Author: James Taylor 
Authored: Thu May 3 09:32:57 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:25:29 2018 -0700

--
 .../src/main/java/org/apache/phoenix/compile/StatementContext.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/05bb42fd/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 c105046..3e5c8f2 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
@@ -98,7 +98,7 @@ public class StatementContext {
 }
 
 public StatementContext(PhoenixStatement statement, Scan scan) {
-this(statement, FromCompiler.EMPTY_TABLE_RESOLVER, new Scan(), new 
SequenceManager(statement));
+this(statement, FromCompiler.EMPTY_TABLE_RESOLVER, scan, new 
SequenceManager(statement));
 }
 
 public StatementContext(PhoenixStatement statement, ColumnResolver 
resolver) {



[7/7] phoenix git commit: PHOENIX-4646 The data exceeds the max capacity for the data type error for valid scenarios (Sergey Soldatov)

2018-05-09 Thread jamestaylor
PHOENIX-4646 The data exceeds the max capacity for the data type error for 
valid scenarios (Sergey Soldatov)


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

Branch: refs/heads/4.x-HBase-1.2
Commit: 766355614e31ba69f5ed2c58f071e40c314d7fa8
Parents: e1e61f5
Author: James Taylor 
Authored: Wed May 9 13:12:26 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:25:30 2018 -0700

--
 .../apache/phoenix/end2end/UpsertSelectIT.java   | 19 +++
 .../apache/phoenix/schema/types/PVarchar.java| 10 ++
 2 files changed, 25 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/76635561/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
index 99cbe47..5db1fdd 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
@@ -1488,6 +1488,25 @@ public class UpsertSelectIT extends 
ParallelStatsDisabledIT {
 }
 }
 
+@Test // See https://issues.apache.org/jira/browse/PHOENIX-4646
+public void testLengthLimitedVarchar() throws Exception {
+String tableName1 = generateUniqueName();
+String tableName2 = generateUniqueName();
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+conn.setAutoCommit(true);
+conn.createStatement().execute("create table " + tableName1 + 
"(name varchar(160) primary key, id varchar(120), address varchar(160))"); 
+conn.createStatement().execute("create table " + tableName2 + 
"(name varchar(160) primary key, id varchar(10), address  varchar(10))");
+conn.createStatement().execute("upsert into " + tableName1 + " 
values('test','test','test')");
+conn.createStatement().execute("upsert into " + tableName2 + " 
select * from " + tableName1);
+ResultSet rs = conn.createStatement().executeQuery("select * from 
" + tableName2);
+assertTrue(rs.next());
+assertEquals("test", rs.getString(1));
+assertEquals("test", rs.getString(2));
+assertEquals("test", rs.getString(2));
+assertFalse(rs.next());
+}
+}
+
 private static Connection getTenantConnection(String tenantId) throws 
Exception {
 Properties props = PropertiesUtil.deepCopy(TestUtil.TEST_PROPERTIES);
 props.setProperty(TENANT_ID_ATTRIB, tenantId);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/76635561/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
index fb5a045..a99925c 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
@@ -102,15 +102,17 @@ public class PVarchar extends PDataType {
 SortOrder sortOrder, Integer maxLength, Integer scale,
 Integer desiredMaxLength, Integer desiredScale) {
 if (ptr.getLength() != 0 && desiredMaxLength != null) {
-if (maxLength == null) {
+if (maxLength == null || maxLength > desiredMaxLength) {
 if (value != null) { // Use value if provided
 maxLength = value.toString().length();
 } else {
-coerceBytes(ptr, value, srcType, maxLength, scale, 
sortOrder, desiredMaxLength, desiredScale, sortOrder, true);
-maxLength = StringUtil.calculateUTF8Length(ptr.get(), 
ptr.getOffset(), ptr.getLength(), sortOrder);
+coerceBytes(ptr, value, srcType, maxLength, scale, 
sortOrder, desiredMaxLength,
+desiredScale, sortOrder, true);
+maxLength = StringUtil
+.calculateUTF8Length(ptr.get(), ptr.getOffset(), 
ptr.getLength(), sortOrder);
 }
+return maxLength <= desiredMaxLength;
 }
-return maxLength <= desiredMaxLength;
 }
 return true;
 }



[7/7] phoenix git commit: PHOENIX-4646 The data exceeds the max capacity for the data type error for valid scenarios (Sergey Soldatov)

2018-05-09 Thread jamestaylor
PHOENIX-4646 The data exceeds the max capacity for the data type error for 
valid scenarios (Sergey Soldatov)


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

Branch: refs/heads/4.x-HBase-1.1
Commit: 79838c0d5faec70d1c65789b311d8b08cd08c5d2
Parents: 6b5130d
Author: James Taylor 
Authored: Wed May 9 13:12:26 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:23:13 2018 -0700

--
 .../apache/phoenix/end2end/UpsertSelectIT.java   | 19 +++
 .../apache/phoenix/schema/types/PVarchar.java| 10 ++
 2 files changed, 25 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/79838c0d/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
index 99cbe47..5db1fdd 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
@@ -1488,6 +1488,25 @@ public class UpsertSelectIT extends 
ParallelStatsDisabledIT {
 }
 }
 
+@Test // See https://issues.apache.org/jira/browse/PHOENIX-4646
+public void testLengthLimitedVarchar() throws Exception {
+String tableName1 = generateUniqueName();
+String tableName2 = generateUniqueName();
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+conn.setAutoCommit(true);
+conn.createStatement().execute("create table " + tableName1 + 
"(name varchar(160) primary key, id varchar(120), address varchar(160))"); 
+conn.createStatement().execute("create table " + tableName2 + 
"(name varchar(160) primary key, id varchar(10), address  varchar(10))");
+conn.createStatement().execute("upsert into " + tableName1 + " 
values('test','test','test')");
+conn.createStatement().execute("upsert into " + tableName2 + " 
select * from " + tableName1);
+ResultSet rs = conn.createStatement().executeQuery("select * from 
" + tableName2);
+assertTrue(rs.next());
+assertEquals("test", rs.getString(1));
+assertEquals("test", rs.getString(2));
+assertEquals("test", rs.getString(2));
+assertFalse(rs.next());
+}
+}
+
 private static Connection getTenantConnection(String tenantId) throws 
Exception {
 Properties props = PropertiesUtil.deepCopy(TestUtil.TEST_PROPERTIES);
 props.setProperty(TENANT_ID_ATTRIB, tenantId);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/79838c0d/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
index fb5a045..a99925c 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
@@ -102,15 +102,17 @@ public class PVarchar extends PDataType {
 SortOrder sortOrder, Integer maxLength, Integer scale,
 Integer desiredMaxLength, Integer desiredScale) {
 if (ptr.getLength() != 0 && desiredMaxLength != null) {
-if (maxLength == null) {
+if (maxLength == null || maxLength > desiredMaxLength) {
 if (value != null) { // Use value if provided
 maxLength = value.toString().length();
 } else {
-coerceBytes(ptr, value, srcType, maxLength, scale, 
sortOrder, desiredMaxLength, desiredScale, sortOrder, true);
-maxLength = StringUtil.calculateUTF8Length(ptr.get(), 
ptr.getOffset(), ptr.getLength(), sortOrder);
+coerceBytes(ptr, value, srcType, maxLength, scale, 
sortOrder, desiredMaxLength,
+desiredScale, sortOrder, true);
+maxLength = StringUtil
+.calculateUTF8Length(ptr.get(), ptr.getOffset(), 
ptr.getLength(), sortOrder);
 }
+return maxLength <= desiredMaxLength;
 }
-return maxLength <= desiredMaxLength;
 }
 return true;
 }



[4/7] phoenix git commit: PHOENIX-4727 Parameterize transaction tests with TRANSACTION_PROVIDER

2018-05-09 Thread jamestaylor
PHOENIX-4727 Parameterize transaction tests with TRANSACTION_PROVIDER


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

Branch: refs/heads/4.x-HBase-1.1
Commit: 04797bffe1c0c28cfb0a0c942422ccfa244ae411
Parents: 018ebfc
Author: James Taylor 
Authored: Mon May 7 18:23:03 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:22:36 2018 -0700

--
 .../phoenix/end2end/index/MutableIndexIT.java   | 21 +++---
 .../org/apache/phoenix/tx/TransactionIT.java| 75 +++-
 .../java/org/apache/phoenix/util/TestUtil.java  |  6 +-
 3 files changed, 74 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/04797bff/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
index 2e1d2ee..8e2df30 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
@@ -78,11 +78,11 @@ public class MutableIndexIT extends ParallelStatsDisabledIT 
{
 protected final boolean localIndex;
 private final String tableDDLOptions;

-public MutableIndexIT(boolean localIndex, boolean transactional, boolean 
columnEncoded) {
+public MutableIndexIT(Boolean localIndex, String txProvider, Boolean 
columnEncoded) {
this.localIndex = localIndex;
StringBuilder optionBuilder = new StringBuilder();
-   if (transactional) {
-   optionBuilder.append("TRANSACTIONAL=true");
+   if (txProvider != null) {
+   optionBuilder.append("TRANSACTIONAL=true," + 
PhoenixDatabaseMetaData.TRANSACTION_PROVIDER + "='" + txProvider + "'");
}
if (!columnEncoded) {
 if (optionBuilder.length()!=0)
@@ -104,12 +104,15 @@ public class MutableIndexIT extends 
ParallelStatsDisabledIT {
 }
 

@Parameters(name="MutableIndexIT_localIndex={0},transactional={1},columnEncoded={2}")
 // name is used by failsafe as file name in reports
-public static Collection data() {
-return Arrays.asList(new Boolean[][] { 
-{ false, false, false }, { false, false, true },
-{ false, true, false }, { false, true, true },
-{ true, false, false }, { true, false, true },
-{ true, true, false }, { true, true, true } });
+public static Collection data() {
+return Arrays.asList(new Object[][] { 
+{ false, null, false }, { false, null, true },
+{ false, "TEPHRA", false }, { false, "TEPHRA", true },
+//{ false, "OMID", false }, { false, "OMID", true },
+{ true, null, false }, { true, null, true },
+{ true, "TEPHRA", false }, { true, "TEPHRA", true },
+//{ true, "OMID", false }, { true, "OMID", true },
+});
 }
 
 @Test

http://git-wip-us.apache.org/repos/asf/phoenix/blob/04797bff/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
index f1344e0..c0ec6b8 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
@@ -32,6 +32,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
+import java.util.Arrays;
+import java.util.Collection;
 import java.util.Properties;
 
 import org.apache.hadoop.hbase.HColumnDescriptor;
@@ -43,6 +45,7 @@ import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.query.QueryConstants;
 import org.apache.phoenix.query.QueryServicesOptions;
+import org.apache.phoenix.schema.PTable;
 import org.apache.phoenix.schema.PTableKey;
 import org.apache.phoenix.transaction.PhoenixTransactionContext;
 import org.apache.phoenix.transaction.TransactionFactory;
@@ -52,16 +55,33 @@ import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.StringUtil;
 import org.apache.phoenix.util.TestUtil;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import or

[1/7] phoenix git commit: PHOENIX-4623 Inconsistent physical view index name

2018-05-09 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.1 6f52b737d -> 79838c0d5


PHOENIX-4623 Inconsistent physical view index name


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

Branch: refs/heads/4.x-HBase-1.1
Commit: d17dc04601767c5265ce2e7436fed270fa7aba72
Parents: 04797bf
Author: James Taylor 
Authored: Tue May 8 16:29:41 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:22:36 2018 -0700

--
 .../org/apache/phoenix/end2end/BaseViewIT.java|  7 +++
 .../java/org/apache/phoenix/end2end/ViewIT.java   |  2 +-
 .../phoenix/schema/stats/StatsCollectorIT.java|  3 +--
 .../org/apache/phoenix/util/MetaDataUtil.java | 18 +-
 .../java/org/apache/phoenix/util/UpgradeUtil.java |  2 +-
 5 files changed, 11 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d17dc046/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
index 478b234..5728a20 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
@@ -46,7 +46,6 @@ import org.apache.phoenix.util.MetaDataUtil;
 import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.SchemaUtil;
-import org.apache.phoenix.util.TestUtil;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
@@ -66,7 +65,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
if (transactional) {
optionBuilder.append(" TRANSACTIONAL=true ");
}
-   this.schemaName = TestUtil.DEFAULT_SCHEMA_NAME;
+   this.schemaName = "S_" + generateUniqueName();
this.tableDDLOptions = optionBuilder.toString();
this.tableName = "T_" + generateUniqueName();
 this.fullTableName = SchemaUtil.getTableName(schemaName, tableName);
@@ -166,7 +165,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 ResultSet rs;
 Connection conn = DriverManager.getConnection(getUrl());
 String viewIndexName1 = "I_" + generateUniqueName();
-String viewIndexPhysicalName = 
MetaDataUtil.getViewIndexName(schemaName, tableName);
+String viewIndexPhysicalName = 
MetaDataUtil.getViewIndexPhysicalName(fullTableName);
 if (localIndex) {
 conn.createStatement().execute("CREATE LOCAL INDEX " + 
viewIndexName1 + " on " + viewName + "(k3)");
 } else {
@@ -231,7 +230,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 rs = conn.createStatement().executeQuery("EXPLAIN " + query);
 String physicalTableName;
 if (localIndex) {
-physicalTableName = tableName;
+physicalTableName = fullTableName;
 assertEquals("CLIENT PARALLEL "+ (saltBuckets == null ? 1 : 
saltBuckets)  +"-WAY RANGE SCAN OVER " + fullTableName +" [" + (2) + ",'foo']\n"
 + "SERVER FILTER BY FIRST KEY ONLY\n"
 + "CLIENT MERGE SORT",QueryUtil.getExplainPlan(rs));

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d17dc046/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
index 279bbd7..34292ba 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
@@ -69,7 +69,7 @@ public class ViewIT extends BaseViewIT {
 String ddl = "CREATE TABLE " + fullTableName + " (k INTEGER NOT NULL 
PRIMARY KEY, v1 DATE) "+ tableDDLOptions;
 conn.createStatement().execute(ddl);
 String fullParentViewName = "V_" + generateUniqueName();
-ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * 
FROM " + tableName + " WHERE k > 5";
+ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * 
FROM " + fullTableName + " WHERE k > 5";
 conn.createStatement().execute(ddl);
 try {
 conn.createStatement().execute("UPSERT INTO " + fullParentViewName 
+ " VALUES(1)");

http://git-wip-us.a

[5/7] phoenix git commit: PHOENIX-3270 Remove @Ignore tag for TransactionIT.testNonTxToTxTableFailure()

2018-05-09 Thread jamestaylor
PHOENIX-3270 Remove @Ignore tag for TransactionIT.testNonTxToTxTableFailure()


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

Branch: refs/heads/4.x-HBase-1.1
Commit: 018ebfc2b1cad73140dbdb25f6c6faa0ec6e6e5f
Parents: a3d1c94
Author: James Taylor 
Authored: Thu May 3 09:52:57 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:22:36 2018 -0700

--
 .../it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java  | 2 --
 1 file changed, 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/018ebfc2/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
index 580f055..ec1cf3a 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
@@ -57,7 +57,6 @@ import 
org.apache.phoenix.transaction.PhoenixTransactionContext;
 import org.apache.phoenix.util.ByteUtil;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.TestUtil;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -323,7 +322,6 @@ public class ParameterizedTransactionIT extends 
ParallelStatsDisabledIT {
 assertFalse(rs.next());
 }
 
-@Ignore
 @Test
 public void testNonTxToTxTableFailure() throws Exception {
 String nonTxTableName = generateUniqueName();



[6/7] phoenix git commit: PHOENIX-4678 ndexScrutinyTool generates malformed query due to incorrect table name(s) (Josh Elser)

2018-05-09 Thread jamestaylor
PHOENIX-4678 ndexScrutinyTool generates malformed query due to incorrect table 
name(s) (Josh Elser)


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

Branch: refs/heads/4.x-HBase-1.1
Commit: 6b5130d29f5605509ffad07a7c9d8c0e406a527b
Parents: d17dc04
Author: James Taylor 
Authored: Wed May 9 12:50:22 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:23:13 2018 -0700

--
 phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/6b5130d2/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
--
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
index a73467a..153b377 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
@@ -1103,7 +1103,7 @@ public class SchemaUtil {
  * @return the byte representation of the HTable
  */
 public static String getQualifiedTableName(String schemaName, String 
tableName) {
-if (schemaName != null) {
+if (schemaName != null && !schemaName.isEmpty()) {
 return String.format("%s.%s", normalizeIdentifier(schemaName),
 normalizeIdentifier(tableName));
 } else {



[2/7] phoenix git commit: PHOENIX-3856 StatementContext class constructor not honouring supplied scan object (Sukumar Maddineni)

2018-05-09 Thread jamestaylor
PHOENIX-3856 StatementContext class constructor not honouring supplied scan 
object (Sukumar Maddineni)


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

Branch: refs/heads/4.x-HBase-1.1
Commit: a3d1c9462da35a2206faf36e39913de81e52bd4e
Parents: bf52114
Author: James Taylor 
Authored: Thu May 3 09:32:57 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:22:36 2018 -0700

--
 .../src/main/java/org/apache/phoenix/compile/StatementContext.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/a3d1c946/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 c105046..3e5c8f2 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
@@ -98,7 +98,7 @@ public class StatementContext {
 }
 
 public StatementContext(PhoenixStatement statement, Scan scan) {
-this(statement, FromCompiler.EMPTY_TABLE_RESOLVER, new Scan(), new 
SequenceManager(statement));
+this(statement, FromCompiler.EMPTY_TABLE_RESOLVER, scan, new 
SequenceManager(statement));
 }
 
 public StatementContext(PhoenixStatement statement, ColumnResolver 
resolver) {



[3/7] phoenix git commit: PHOENIX-4732 Improve config defaults for async secondary index MR jobs

2018-05-09 Thread jamestaylor
PHOENIX-4732 Improve config defaults for async secondary index MR jobs


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

Branch: refs/heads/4.x-HBase-1.1
Commit: bf52114b05e2391c4855fe21e39f2369f8a403f1
Parents: 6f52b73
Author: James Taylor 
Authored: Tue May 8 15:26:44 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:22:36 2018 -0700

--
 .../index/automation/PhoenixMRJobSubmitter.java | 48 ++--
 .../apache/phoenix/util/PhoenixMRJobUtil.java   | 18 +++-
 2 files changed, 52 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/bf52114b/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 9c447e8..d86802a 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
@@ -45,6 +45,7 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
+import org.apache.hadoop.mapreduce.MRJobConfig;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.mapreduce.index.IndexTool;
@@ -53,8 +54,8 @@ import org.apache.phoenix.schema.PTable.IndexType;
 import org.apache.phoenix.schema.PTableType;
 import org.apache.phoenix.schema.types.PDate;
 import org.apache.phoenix.util.PhoenixMRJobUtil;
-import org.apache.phoenix.util.UpgradeUtil;
 import org.apache.phoenix.util.PhoenixMRJobUtil.MR_SCHEDULER_TYPE;
+import org.apache.phoenix.util.UpgradeUtil;
 import org.apache.phoenix.util.ZKBasedMasterElectionUtil;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONObject;
@@ -69,8 +70,28 @@ public class PhoenixMRJobSubmitter {
 // Lock to elect a master node that submits the Phoenix Secondary Index MR 
Jobs
 private static final String PHOENIX_LOCKS_PARENT =
 "/phoenix/automated-mr-index-build-leader-election";
+public static final String PHOENIX_MR_CLIENT_SCANNER_TIMEOUT_PERIOD =
+"phoenix.mr.client.scanner.timeout.period";
+public static final String PHOENIX_MR_RPC_TIMEOUT =
+"phoenix.mr.rpc.timeout";
+public static final String PHOENIX_MR_TASK_TIMEOUT =
+"phoenix.mr.task.timeout";
+public static final String PHOENIX_MR_CLIENT_RETRIES_NUMBER =
+"phoenix.mr.client.retries.number";
+public static final String PHOENIX_MR_CLIENT_PAUSE =
+"phoenix.mr.client.retries.number";
+public static final String PHOENIX_MR_ZK_RECOVERY_RETRY =
+"phoenix.mr.zk.recovery.retry";
 private static final String AUTO_INDEX_BUILD_LOCK_NAME = 
"ActiveStandbyElectorLock";
-
+private static final int DEFAULT_TIMEOUT_IN_MILLIS = 60;
+public static final int DEFAULT_MR_CLIENT_SCANNER_TIMEOUT_PERIOD = 
DEFAULT_TIMEOUT_IN_MILLIS;
+public static final int DEFAULT_MR_RPC_TIMEOUT = DEFAULT_TIMEOUT_IN_MILLIS;
+public static final int DEFAULT_MR_TASK_TIMEOUT = 
DEFAULT_TIMEOUT_IN_MILLIS;
+// Reduced HBase/Zookeeper Client Retries
+public static final int DEFAULT_MR_CLIENT_RETRIES_NUMBER = 10;
+public static final int DEFAULT_MR_CLIENT_PAUSE = 1000;
+public static final int DEFAULT_MR_ZK_RECOVERY_RETRY = 1;
+
 public static final String CANDIDATE_INDEX_INFO_QUERY = "SELECT "
 + PhoenixDatabaseMetaData.INDEX_TYPE + ","
 + PhoenixDatabaseMetaData.DATA_TABLE_NAME + ", "
@@ -103,7 +124,28 @@ public class PhoenixMRJobSubmitter {
 }
 this.conf = conf;
 
-PhoenixMRJobUtil.updateTimeoutsToFailFast(conf);
+// Have Phoenix specific properties for defaults to enable potential 
override
+conf.setLong(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD, 
+conf.getLong(PHOENIX_MR_CLIENT_SCANNER_TIMEOUT_PERIOD,
+DEFAULT_MR_CLIENT_SCANNER_TIMEOUT_PERIOD));
+conf.setLong(HConstants.HBASE_RPC_TIMEOUT_KEY, 
+conf.getLong(PHOENIX_MR_RPC_TIMEOUT,
+DEFAULT_MR_RPC_TIMEOUT));
+conf.setLong(MRJobConfig.TASK_TIMEOUT, 

[1/2] phoenix git commit: PHOENIX-4678 ndexScrutinyTool generates malformed query due to incorrect table name(s) (Josh Elser)

2018-05-09 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 f81f4327e -> 68938b856


PHOENIX-4678 ndexScrutinyTool generates malformed query due to incorrect table 
name(s) (Josh Elser)


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 2600c54abca442b9dfbe1b3f79778786825fd2d3
Parents: f81f432
Author: James Taylor 
Authored: Wed May 9 12:50:22 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 12:50:22 2018 -0700

--
 phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/2600c54a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
--
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
index a73467a..153b377 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
@@ -1103,7 +1103,7 @@ public class SchemaUtil {
  * @return the byte representation of the HTable
  */
 public static String getQualifiedTableName(String schemaName, String 
tableName) {
-if (schemaName != null) {
+if (schemaName != null && !schemaName.isEmpty()) {
 return String.format("%s.%s", normalizeIdentifier(schemaName),
 normalizeIdentifier(tableName));
 } else {



[2/2] phoenix git commit: PHOENIX-4646 The data exceeds the max capacity for the data type error for valid scenarios (Sergey Soldatov)

2018-05-09 Thread jamestaylor
PHOENIX-4646 The data exceeds the max capacity for the data type error for 
valid scenarios (Sergey Soldatov)


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 68938b856a515503dd5fd45683f7c8d647e7a78a
Parents: 2600c54
Author: James Taylor 
Authored: Wed May 9 13:12:26 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 13:12:26 2018 -0700

--
 .../apache/phoenix/end2end/UpsertSelectIT.java   | 19 +++
 .../apache/phoenix/schema/types/PVarchar.java| 10 ++
 2 files changed, 25 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/68938b85/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
index 087dadf..e6ca437 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectIT.java
@@ -1486,6 +1486,25 @@ public class UpsertSelectIT extends 
ParallelStatsDisabledIT {
 }
 }
 
+@Test // See https://issues.apache.org/jira/browse/PHOENIX-4646
+public void testLengthLimitedVarchar() throws Exception {
+String tableName1 = generateUniqueName();
+String tableName2 = generateUniqueName();
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+conn.setAutoCommit(true);
+conn.createStatement().execute("create table " + tableName1 + 
"(name varchar(160) primary key, id varchar(120), address varchar(160))"); 
+conn.createStatement().execute("create table " + tableName2 + 
"(name varchar(160) primary key, id varchar(10), address  varchar(10))");
+conn.createStatement().execute("upsert into " + tableName1 + " 
values('test','test','test')");
+conn.createStatement().execute("upsert into " + tableName2 + " 
select * from " + tableName1);
+ResultSet rs = conn.createStatement().executeQuery("select * from 
" + tableName2);
+assertTrue(rs.next());
+assertEquals("test", rs.getString(1));
+assertEquals("test", rs.getString(2));
+assertEquals("test", rs.getString(2));
+assertFalse(rs.next());
+}
+}
+
 private static Connection getTenantConnection(String tenantId) throws 
Exception {
 Properties props = PropertiesUtil.deepCopy(TestUtil.TEST_PROPERTIES);
 props.setProperty(TENANT_ID_ATTRIB, tenantId);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/68938b85/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
index fb5a045..a99925c 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PVarchar.java
@@ -102,15 +102,17 @@ public class PVarchar extends PDataType {
 SortOrder sortOrder, Integer maxLength, Integer scale,
 Integer desiredMaxLength, Integer desiredScale) {
 if (ptr.getLength() != 0 && desiredMaxLength != null) {
-if (maxLength == null) {
+if (maxLength == null || maxLength > desiredMaxLength) {
 if (value != null) { // Use value if provided
 maxLength = value.toString().length();
 } else {
-coerceBytes(ptr, value, srcType, maxLength, scale, 
sortOrder, desiredMaxLength, desiredScale, sortOrder, true);
-maxLength = StringUtil.calculateUTF8Length(ptr.get(), 
ptr.getOffset(), ptr.getLength(), sortOrder);
+coerceBytes(ptr, value, srcType, maxLength, scale, 
sortOrder, desiredMaxLength,
+desiredScale, sortOrder, true);
+maxLength = StringUtil
+.calculateUTF8Length(ptr.get(), ptr.getOffset(), 
ptr.getLength(), sortOrder);
 }
+return maxLength <= desiredMaxLength;
 }
-return maxLength <= desiredMaxLength;
 }
 return true;
 }



[3/5] phoenix git commit: PHOENIX-4727 Parameterize transaction tests with TRANSACTION_PROVIDER

2018-05-09 Thread jamestaylor
PHOENIX-4727 Parameterize transaction tests with TRANSACTION_PROVIDER


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

Branch: refs/heads/4.x-HBase-0.98
Commit: cc94b682c8d6a61bdb8cb40e571d97f3732f3e71
Parents: 1e5f3cc
Author: James Taylor 
Authored: Mon May 7 18:23:03 2018 -0700
Committer: James Taylor 
Committed: Tue May 8 16:00:48 2018 -0700

--
 .../phoenix/end2end/index/MutableIndexIT.java   | 21 +++---
 .../org/apache/phoenix/tx/TransactionIT.java| 75 +++-
 .../java/org/apache/phoenix/util/TestUtil.java  |  6 +-
 3 files changed, 74 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/cc94b682/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
index f7d483b..65b30ee 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
@@ -78,11 +78,11 @@ public class MutableIndexIT extends ParallelStatsDisabledIT 
{
 protected final boolean localIndex;
 private final String tableDDLOptions;

-public MutableIndexIT(boolean localIndex, boolean transactional, boolean 
columnEncoded) {
+public MutableIndexIT(Boolean localIndex, String txProvider, Boolean 
columnEncoded) {
this.localIndex = localIndex;
StringBuilder optionBuilder = new StringBuilder();
-   if (transactional) {
-   optionBuilder.append("TRANSACTIONAL=true");
+   if (txProvider != null) {
+   optionBuilder.append("TRANSACTIONAL=true," + 
PhoenixDatabaseMetaData.TRANSACTION_PROVIDER + "='" + txProvider + "'");
}
if (!columnEncoded) {
 if (optionBuilder.length()!=0)
@@ -104,12 +104,15 @@ public class MutableIndexIT extends 
ParallelStatsDisabledIT {
 }
 

@Parameters(name="MutableIndexIT_localIndex={0},transactional={1},columnEncoded={2}")
 // name is used by failsafe as file name in reports
-public static Collection data() {
-return Arrays.asList(new Boolean[][] { 
-{ false, false, false }, { false, false, true },
-{ false, true, false }, { false, true, true },
-{ true, false, false }, { true, false, true },
-{ true, true, false }, { true, true, true } });
+public static Collection data() {
+return Arrays.asList(new Object[][] { 
+{ false, null, false }, { false, null, true },
+{ false, "TEPHRA", false }, { false, "TEPHRA", true },
+//{ false, "OMID", false }, { false, "OMID", true },
+{ true, null, false }, { true, null, true },
+{ true, "TEPHRA", false }, { true, "TEPHRA", true },
+//{ true, "OMID", false }, { true, "OMID", true },
+});
 }
 
 @Test

http://git-wip-us.apache.org/repos/asf/phoenix/blob/cc94b682/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
index f1344e0..c0ec6b8 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
@@ -32,6 +32,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
+import java.util.Arrays;
+import java.util.Collection;
 import java.util.Properties;
 
 import org.apache.hadoop.hbase.HColumnDescriptor;
@@ -43,6 +45,7 @@ import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.query.QueryConstants;
 import org.apache.phoenix.query.QueryServicesOptions;
+import org.apache.phoenix.schema.PTable;
 import org.apache.phoenix.schema.PTableKey;
 import org.apache.phoenix.transaction.PhoenixTransactionContext;
 import org.apache.phoenix.transaction.TransactionFactory;
@@ -52,16 +55,33 @@ import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.StringUtil;
 import org.apache.phoenix.util.TestUtil;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import o

[5/5] phoenix git commit: PHOENIX-4730 Upgrade Netty versions in 0.98 branch (Andrew Purtell)

2018-05-09 Thread jamestaylor
PHOENIX-4730 Upgrade Netty versions in 0.98 branch (Andrew Purtell)


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

Branch: refs/heads/4.x-HBase-0.98
Commit: f81f4327ea711d72b0e42eed17ba5f8212bc03b7
Parents: 78e94f7
Author: James Taylor 
Authored: Wed May 9 12:20:21 2018 -0700
Committer: James Taylor 
Committed: Wed May 9 12:20:21 2018 -0700

--
 phoenix-core/pom.xml  | 4 
 phoenix-flume/pom.xml | 4 
 phoenix-kafka/pom.xml | 4 
 pom.xml   | 8 +++-
 4 files changed, 7 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f81f4327/phoenix-core/pom.xml
--
diff --git a/phoenix-core/pom.xml b/phoenix-core/pom.xml
index 699d596..d9c8e97 100644
--- a/phoenix-core/pom.xml
+++ b/phoenix-core/pom.xml
@@ -349,10 +349,6 @@
   htrace-core
 
 
-  io.netty
-  netty
-
-
   commons-cli
   commons-cli
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/f81f4327/phoenix-flume/pom.xml
--
diff --git a/phoenix-flume/pom.xml b/phoenix-flume/pom.xml
index f364805..b8503b7 100644
--- a/phoenix-flume/pom.xml
+++ b/phoenix-flume/pom.xml
@@ -73,10 +73,6 @@
   htrace-core
 
 
-  io.netty
-  netty
-
-
   commons-codec
   commons-codec
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/f81f4327/phoenix-kafka/pom.xml
--
diff --git a/phoenix-kafka/pom.xml b/phoenix-kafka/pom.xml
index f059f0f..8233df8 100644
--- a/phoenix-kafka/pom.xml
+++ b/phoenix-kafka/pom.xml
@@ -147,10 +147,6 @@
htrace-core


-   io.netty
-   netty
-   
-   
commons-cli
commons-cli


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f81f4327/pom.xml
--
diff --git a/pom.xml b/pom.xml
index eaa8202..44094c7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -92,7 +92,8 @@
 1.0-1
 2.11
 0.3
-3.6.6.Final
+3.10.6.Final
+4.0.56.Final
 1.7
 2.04
 3.2.2
@@ -889,6 +890,11 @@
 ${netty.version}
   
   
+io.netty
+netty-all
+${netty-all.version}
+  
+  
 commons-codec
 commons-codec
 ${commons-codec.version}



[1/5] phoenix git commit: PHOENIX-3856 StatementContext class constructor not honouring supplied scan object (Sukumar Maddineni)

2018-05-09 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 0482c539a -> f81f4327e


PHOENIX-3856 StatementContext class constructor not honouring supplied scan 
object (Sukumar Maddineni)


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 7a79e62013c3f6ffce588103803fb8075485c5bd
Parents: 0482c53
Author: James Taylor 
Authored: Thu May 3 09:32:57 2018 -0700
Committer: James Taylor 
Committed: Tue May 8 15:59:36 2018 -0700

--
 .../src/main/java/org/apache/phoenix/compile/StatementContext.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/7a79e620/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 c105046..3e5c8f2 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
@@ -98,7 +98,7 @@ public class StatementContext {
 }
 
 public StatementContext(PhoenixStatement statement, Scan scan) {
-this(statement, FromCompiler.EMPTY_TABLE_RESOLVER, new Scan(), new 
SequenceManager(statement));
+this(statement, FromCompiler.EMPTY_TABLE_RESOLVER, scan, new 
SequenceManager(statement));
 }
 
 public StatementContext(PhoenixStatement statement, ColumnResolver 
resolver) {



[4/5] phoenix git commit: PHOENIX-4623 Inconsistent physical view index name

2018-05-09 Thread jamestaylor
PHOENIX-4623 Inconsistent physical view index name


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 78e94f7c745239730b17117b32b7505ce86bb54a
Parents: cc94b68
Author: James Taylor 
Authored: Tue May 8 16:29:41 2018 -0700
Committer: James Taylor 
Committed: Tue May 8 16:29:41 2018 -0700

--
 .../org/apache/phoenix/end2end/BaseViewIT.java|  7 +++
 .../java/org/apache/phoenix/end2end/ViewIT.java   |  2 +-
 .../phoenix/schema/stats/StatsCollectorIT.java|  3 +--
 .../org/apache/phoenix/util/MetaDataUtil.java | 18 +-
 .../java/org/apache/phoenix/util/UpgradeUtil.java |  2 +-
 5 files changed, 11 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/78e94f7c/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
index 478b234..5728a20 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseViewIT.java
@@ -46,7 +46,6 @@ import org.apache.phoenix.util.MetaDataUtil;
 import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.SchemaUtil;
-import org.apache.phoenix.util.TestUtil;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
@@ -66,7 +65,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
if (transactional) {
optionBuilder.append(" TRANSACTIONAL=true ");
}
-   this.schemaName = TestUtil.DEFAULT_SCHEMA_NAME;
+   this.schemaName = "S_" + generateUniqueName();
this.tableDDLOptions = optionBuilder.toString();
this.tableName = "T_" + generateUniqueName();
 this.fullTableName = SchemaUtil.getTableName(schemaName, tableName);
@@ -166,7 +165,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 ResultSet rs;
 Connection conn = DriverManager.getConnection(getUrl());
 String viewIndexName1 = "I_" + generateUniqueName();
-String viewIndexPhysicalName = 
MetaDataUtil.getViewIndexName(schemaName, tableName);
+String viewIndexPhysicalName = 
MetaDataUtil.getViewIndexPhysicalName(fullTableName);
 if (localIndex) {
 conn.createStatement().execute("CREATE LOCAL INDEX " + 
viewIndexName1 + " on " + viewName + "(k3)");
 } else {
@@ -231,7 +230,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 rs = conn.createStatement().executeQuery("EXPLAIN " + query);
 String physicalTableName;
 if (localIndex) {
-physicalTableName = tableName;
+physicalTableName = fullTableName;
 assertEquals("CLIENT PARALLEL "+ (saltBuckets == null ? 1 : 
saltBuckets)  +"-WAY RANGE SCAN OVER " + fullTableName +" [" + (2) + ",'foo']\n"
 + "SERVER FILTER BY FIRST KEY ONLY\n"
 + "CLIENT MERGE SORT",QueryUtil.getExplainPlan(rs));

http://git-wip-us.apache.org/repos/asf/phoenix/blob/78e94f7c/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
index 279bbd7..34292ba 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
@@ -69,7 +69,7 @@ public class ViewIT extends BaseViewIT {
 String ddl = "CREATE TABLE " + fullTableName + " (k INTEGER NOT NULL 
PRIMARY KEY, v1 DATE) "+ tableDDLOptions;
 conn.createStatement().execute(ddl);
 String fullParentViewName = "V_" + generateUniqueName();
-ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * 
FROM " + tableName + " WHERE k > 5";
+ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * 
FROM " + fullTableName + " WHERE k > 5";
 conn.createStatement().execute(ddl);
 try {
 conn.createStatement().execute("UPSERT INTO " + fullParentViewName 
+ " VALUES(1)");

http://git-wip-us.apache.org/repos/asf/phoenix/blob/78e94f7c/phoenix-core/src/it/java/org/apache/phoenix/sch

[2/5] phoenix git commit: PHOENIX-3270 Remove @Ignore tag for TransactionIT.testNonTxToTxTableFailure()

2018-05-09 Thread jamestaylor
PHOENIX-3270 Remove @Ignore tag for TransactionIT.testNonTxToTxTableFailure()


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 1e5f3cc5bdfcabf8f9a9fea53ebe311fd8fde893
Parents: 7a79e62
Author: James Taylor 
Authored: Thu May 3 09:52:57 2018 -0700
Committer: James Taylor 
Committed: Tue May 8 15:59:52 2018 -0700

--
 .../it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java  | 2 --
 1 file changed, 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/1e5f3cc5/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
index 7b513b9..d8c42b1 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
@@ -57,7 +57,6 @@ import 
org.apache.phoenix.transaction.PhoenixTransactionContext;
 import org.apache.phoenix.util.ByteUtil;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.TestUtil;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -324,7 +323,6 @@ public class ParameterizedTransactionIT extends 
ParallelStatsDisabledIT {
 assertFalse(rs.next());
 }
 
-@Ignore
 @Test
 public void testNonTxToTxTableFailure() throws Exception {
 String nonTxTableName = generateUniqueName();



Build failed in Jenkins: Phoenix | Master #2015

2018-05-09 Thread Apache Jenkins Server
See 


Changes:

[rajeshbabu] PHOENIX-4685 Properly handle connection caching for Phoenix inside

--
[...truncated 475.66 KB...]
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ phoenix-core 
---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1078 source files to 

[WARNING] 
:[25,16]
 sun.misc.Unsafe is internal proprietary API and may be removed in a future 
release
[WARNING] 
:[116,26]
 sun.misc.Unsafe is internal proprietary API and may be removed in a future 
release
[WARNING] 
:[122,30]
 sun.misc.Unsafe is internal proprietary API and may be removed in a future 
release
[WARNING] 
:[126,39]
 sun.misc.Unsafe is internal proprietary API and may be removed in a future 
release
[WARNING] 
:
 Some input files use or override a deprecated API.
[WARNING] 
:
 Recompile with -Xlint:deprecation for details.
[WARNING] 
:
 Some input files use unchecked or unsafe operations.
[WARNING] 
:
 Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] --- maven-dependency-plugin:2.1:build-classpath 
(create-mrapp-generated-classpath) @ phoenix-core ---
[INFO] Wrote classpath file 
'
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ 
phoenix-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] Copying 2 resources
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ 
phoenix-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 516 source files to 

[WARNING] 
:
 Some input files use or override a deprecated API.
[WARNING] 
:
 Recompile with -Xlint:deprecation for details.
[WARNING] 
:
 Some input files use unchecked or unsafe operations.
[WARNING] 
:
 Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] --- maven-surefire-plugin:2.20:test (default-test) @ 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] Reactor Summary:
[INFO] 
[INFO] Apache Phoenix . SUCCESS [  2.692 s]
[INFO] Phoenix Core ... FAILURE [ 51.932 s]
[INFO] Phoenix - Flume  SKIPPED
[INFO] Phoenix - Kafka  SKIPPED
[INFO] Phoenix - Pig .. SKIPPED
[INFO] Phoenix Query Server Client  SKIPPED
[INFO] Phoenix Query Server ... SKIPPED
[INFO] Phoenix - Pherf  SKIPPED
[INFO] Phoenix - Spark  SKIPPED
[INFO] Phoenix - Hive . SKIPPED
[INFO] Phoenix Client . SKIPPED
[INF

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

2018-05-09 Thread rajeshbabu
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.1 9178f569c -> 6f52b737d


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/6f52b737
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/6f52b737
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/6f52b737

Branch: refs/heads/4.x-HBase-1.1
Commit: 6f52b737d8902800692f62ded13dffa0355465c9
Parents: 9178f56
Author: Rajeshbabu Chintaguntla 
Authored: Wed May 9 18:13:38 2018 +0530
Committer: Rajeshbabu Chintaguntla 
Committed: Wed May 9 18:13:38 2018 +0530

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


http://git-wip-us.apache.org/repos/asf/phoenix/blob/6f52b737/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 451bc52..5d2a94c 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
@@ -26,6 +26,7 @@ import java.io.IOException;
 import java.sql.SQLException;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutorService;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -66,8 +67,6 @@ import org.apache.phoenix.hbase.index.write.IndexWriterUtils;
 import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.query.QueryServicesOptions;
 import org.apache.phoenix.schema.StaleRegionBoundaryCacheException;
-import org.jboss.netty.util.internal.ConcurrentHashMap;
-
 
 @SuppressWarnings("deprecation")
 public class ServerUtil {



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

2018-05-09 Thread rajeshbabu
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.3 d38822ed7 -> 7e5c3871d


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/7e5c3871
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/7e5c3871
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/7e5c3871

Branch: refs/heads/4.x-HBase-1.3
Commit: 7e5c3871dc55e00d800c8a2cf17f44d45cb8a194
Parents: d38822e
Author: Rajeshbabu Chintaguntla 
Authored: Wed May 9 18:13:13 2018 +0530
Committer: Rajeshbabu Chintaguntla 
Committed: Wed May 9 18:13:13 2018 +0530

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


http://git-wip-us.apache.org/repos/asf/phoenix/blob/7e5c3871/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 d80b6fc..9190373 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
@@ -26,6 +26,7 @@ import java.io.IOException;
 import java.sql.SQLException;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutorService;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -66,8 +67,6 @@ import org.apache.phoenix.hbase.index.write.IndexWriterUtils;
 import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.query.QueryServicesOptions;
 import org.apache.phoenix.schema.StaleRegionBoundaryCacheException;
-import org.jboss.netty.util.internal.ConcurrentHashMap;
-
 
 @SuppressWarnings("deprecation")
 public class ServerUtil {



  1   2   >