Build failed in Jenkins: Phoenix-4.x-HBase-1.1 #24

2016-05-16 Thread Apache Jenkins Server
See 

Changes:

[ankitsinghal59] PHOENIX-2884 Fix EXPLAIN plan for offset on salted table

[ankitsinghal59] PHOENIX-2862 Do client server compatibility checks before 
upgrading

[ankitsinghal59] PHOENIX-2887 Uberjar application fail with 
'IllegalAccessError: class

--
[...truncated 2069 lines...]
Caused by: java.io.IOException: Shutting down
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds

Running org.apache.phoenix.end2end.index.ImmutableIndexWithStatsIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.004 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.index.ImmutableIndexWithStatsIT
org.apache.phoenix.end2end.index.ImmutableIndexWithStatsIT  Time elapsed: 0.004 
sec  <<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
at 
org.apache.phoenix.end2end.index.ImmutableIndexWithStatsIT.doSetup(ImmutableIndexWithStatsIT.java:52)
Caused by: java.io.IOException: Shutting down
at 
org.apache.phoenix.end2end.index.ImmutableIndexWithStatsIT.doSetup(ImmutableIndexWithStatsIT.java:52)
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds
at 
org.apache.phoenix.end2end.index.ImmutableIndexWithStatsIT.doSetup(ImmutableIndexWithStatsIT.java:52)

Running org.apache.phoenix.end2end.index.MutableIndexFailureIT
Running org.apache.phoenix.end2end.index.MutableIndexReplicationIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.006 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.index.MutableIndexFailureIT
org.apache.phoenix.end2end.index.MutableIndexFailureIT  Time elapsed: 0.006 sec 
 <<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
at 
org.apache.phoenix.end2end.index.MutableIndexFailureIT.doSetup(MutableIndexFailureIT.java:113)
Caused by: java.io.IOException: Shutting down
at 
org.apache.phoenix.end2end.index.MutableIndexFailureIT.doSetup(MutableIndexFailureIT.java:113)
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds
at 
org.apache.phoenix.end2end.index.MutableIndexFailureIT.doSetup(MutableIndexFailureIT.java:113)

Running org.apache.phoenix.hbase.index.FailForUnsupportedHBaseVersionsIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.007 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.index.MutableIndexReplicationIT
org.apache.phoenix.end2end.index.MutableIndexReplicationIT  Time elapsed: 0.006 
sec  <<< ERROR!
java.io.IOException: Shutting down
at 
org.apache.phoenix.end2end.index.MutableIndexReplicationIT.setupConfigsAndStartCluster(MutableIndexReplicationIT.java:170)
at 
org.apache.phoenix.end2end.index.MutableIndexReplicationIT.setUpBeforeClass(MutableIndexReplicationIT.java:108)
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds
at 
org.apache.phoenix.end2end.index.MutableIndexReplicationIT.setupConfigsAndStartCluster(MutableIndexReplicationIT.java:170)
at 
org.apache.phoenix.end2end.index.MutableIndexReplicationIT.setUpBeforeClass(MutableIndexReplicationIT.java:108)

Running org.apache.phoenix.end2end.index.ReadOnlyIndexFailureIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.007 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.index.ReadOnlyIndexFailureIT
org.apache.phoenix.end2end.index.ReadOnlyIndexFailureIT  Time elapsed: 0.006 
sec  <<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
at 
org.apache.phoenix.end2end.index.ReadOnlyIndexFailureIT.doSetup(ReadOnlyIndexFailureIT.java:116)
Caused by: java.io.IOException: Shutting down
at 
org.apache.phoenix.end2end.index.ReadOnlyIndexFailureIT.doSetup(ReadOnlyIndexFailureIT.java:116)
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds
at 
org.apache.phoenix.end2end.index.ReadOnlyIndexFailureIT.doSetup(ReadOnlyIndexFailureIT.java:116)

Running org.apache.phoenix.end2end.index.txn.TxWriteFailureIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.006 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.index.txn.TxWriteFailureIT
org.apache.phoenix.end2end.index.txn.TxWriteFailureIT  Time elapsed: 0.005 sec  
<<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
at 
org.apache.phoenix.end2end.index.txn.TxWriteFailureIT.doSetup(TxWriteFailureIT.java:86)
Caused by: java.io.IOException: Shutting down
at 
org.apache.phoenix.end2end.index.txn.TxWriteFailureIT.doSetup(TxWriteFailureIT.java:86)
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds
at 
org.apache.phoenix.end2end.index.txn.TxWriteFailureIT.doSetup(TxWriteFailureIT.java:86)

Running org.apache.phoenix.execute.PartialCommitIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.007 sec <<< 

Build failed in Jenkins: Phoenix-4.x-HBase-1.0 #473

2016-05-16 Thread Apache Jenkins Server
See 

Changes:

[ankitsinghal59] PHOENIX-2884 Fix EXPLAIN plan for offset on salted table

[ankitsinghal59] PHOENIX-2862 Do client server compatibility checks before 
upgrading

[ankitsinghal59] PHOENIX-2887 Uberjar application fail with 
'IllegalAccessError: class

--
[...truncated 1508 lines...]
Tests run: 6, Failures: 0, Errors: 0, Skipped: 3

[INFO] 
[INFO] --- maven-failsafe-plugin:2.19.1:integration-test 
(HBaseManagedTimeTableReuseTest) @ phoenix-pherf ---

---
 T E S T S
---

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-failsafe-plugin:2.19.1:integration-test 
(NeedTheirOwnClusterTests) @ phoenix-pherf ---

---
 T E S T S
---

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-failsafe-plugin:2.19.1:verify (ClientManagedTimeTests) @ 
phoenix-pherf ---
[INFO] 
[INFO] --- maven-failsafe-plugin:2.19.1:verify (HBaseManagedTimeTests) @ 
phoenix-pherf ---
[INFO] 
[INFO] --- maven-failsafe-plugin:2.19.1:verify (HBaseManagedTimeTableReuseTest) 
@ phoenix-pherf ---
[INFO] 
[INFO] --- maven-failsafe-plugin:2.19.1:verify (NeedTheirOwnClusterTests) @ 
phoenix-pherf ---
[INFO] 
[INFO] --- maven-install-plugin:2.5.1:install (default-install) @ phoenix-pherf 
---
[INFO] Installing 

 to 
/home/jenkins/.m2/repository/org/apache/phoenix/phoenix-pherf/4.8.0-HBase-1.0-SNAPSHOT/phoenix-pherf-4.8.0-HBase-1.0-SNAPSHOT.jar
[INFO] Installing 
 
to 
/home/jenkins/.m2/repository/org/apache/phoenix/phoenix-pherf/4.8.0-HBase-1.0-SNAPSHOT/phoenix-pherf-4.8.0-HBase-1.0-SNAPSHOT.pom
[INFO] Installing 

 to 
/home/jenkins/.m2/repository/org/apache/phoenix/phoenix-pherf/4.8.0-HBase-1.0-SNAPSHOT/phoenix-pherf-4.8.0-HBase-1.0-SNAPSHOT-sources.jar
[INFO] Installing 

 to 
/home/jenkins/.m2/repository/org/apache/phoenix/phoenix-pherf/4.8.0-HBase-1.0-SNAPSHOT/phoenix-pherf-4.8.0-HBase-1.0-SNAPSHOT-tests.jar
[INFO] Installing 

 to 
/home/jenkins/.m2/repository/org/apache/phoenix/phoenix-pherf/4.8.0-HBase-1.0-SNAPSHOT/phoenix-pherf-4.8.0-HBase-1.0-SNAPSHOT-minimal.jar
[INFO] 
[INFO] 
[INFO] Building Phoenix - Spark 4.8.0-HBase-1.0-SNAPSHOT
[INFO] 
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ phoenix-spark ---
[INFO] Deleting 

[INFO] 
[INFO] --- maven-checkstyle-plugin:2.13:check (validate) @ phoenix-spark ---
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.5:process (default) @ phoenix-spark 
---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 
phoenix-spark ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 

[INFO] Copying 3 resources
[INFO] 
[INFO] --- scala-maven-plugin:3.2.0:add-source (scala-compile-first) @ 
phoenix-spark ---
[INFO] Add Source directory: 

[INFO] 
[INFO] --- scala-maven-plugin:3.2.0:compile (scala-compile-first) @ 
phoenix-spark ---
[WARNING]  Expected all dependencies to require Scala version: 2.10.4
[WARNING]  org.apache.phoenix:phoenix-spark:4.8.0-HBase-1.0-SNAPSHOT requires 
scala version: 2.10.4
[WARNING]  com.twitter:chill_2.10:0.5.0 requires scala version: 2.10.4
[WARNING]  com.typesafe.akka:akka-remote_2.10:2.3.11 requires scala version: 
2.10.4
[WARNING]  com.typesafe.akka:akka-actor_2.10:2.3.11 requires scala version: 
2.10.4
[WARNING]  com.typesafe.akka:akka-slf4j_2.10:2.3.11 requires scala version: 
2.10.4
[WARNING]  org.apache.spark:spark-core_2.10:1.5.2 requires scala version: 2.10.4
[WARNING]  org.json4s:json4s-jackson_2.10:3.2.10 requires scala version: 2.10.0
[WARNING] Multiple versions of scala libraries detected!
[INFO] 

[3/3] phoenix git commit: PHOENIX-2887 Uberjar application fail with 'IllegalAccessError: class com.google.protobuf.ZeroCopyLiteralByteString cannot access its superclass com.google.protobuf.LiteralBy

2016-05-16 Thread ankit
PHOENIX-2887 Uberjar application fail with 'IllegalAccessError: class 
com.google.protobuf.ZeroCopyLiteralByteString cannot access its superclass 
com.google.protobuf.LiteralByteString'


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 4837f1ff9d5a6265a07eecfc9d5d3ee55a56653f
Parents: d45938c
Author: Ankit Singhal 
Authored: Mon May 16 12:46:43 2016 +0530
Committer: Ankit Singhal 
Committed: Mon May 16 12:46:43 2016 +0530

--
 .../java/org/apache/phoenix/cache/ServerCacheClient.java | 3 +--
 .../src/main/java/org/apache/phoenix/schema/PTableImpl.java  | 8 +++-
 2 files changed, 4 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/4837f1ff/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java 
b/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java
index 424482a..aea15c2 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java
@@ -71,7 +71,6 @@ import org.apache.phoenix.util.SQLCloseables;
 import org.apache.phoenix.util.ScanUtil;
 
 import com.google.common.collect.ImmutableSet;
-import com.google.protobuf.HBaseZeroCopyByteString;
 
 /**
  * 
@@ -214,7 +213,7 @@ public class ServerCacheClient {
 
ServerCacheFactoryProtos.ServerCacheFactory.Builder svrCacheFactoryBuider = 
ServerCacheFactoryProtos.ServerCacheFactory.newBuilder();
 
svrCacheFactoryBuider.setClassName(cacheFactory.getClass().getName());
 
builder.setCacheFactory(svrCacheFactoryBuider.build());
-
builder.setTxState(HBaseZeroCopyByteString.wrap(txState));
+
builder.setTxState(ByteStringer.wrap(txState));
 
instance.addServerCache(controller, builder.build(), rpcCallback);
 
if(controller.getFailedOn() != null) {
 throw 
controller.getFailedOn();

http://git-wip-us.apache.org/repos/asf/phoenix/blob/4837f1ff/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java
index 70414d5..bd23ab8 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java
@@ -66,8 +66,6 @@ import org.apache.phoenix.util.SizedUtil;
 import org.apache.phoenix.util.StringUtil;
 import org.apache.phoenix.util.TrustedByteArrayOutputStream;
 
-import co.cask.tephra.TxConstants;
-
 import com.google.common.base.Objects;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ArrayListMultimap;
@@ -77,9 +75,10 @@ import com.google.common.collect.ImmutableSortedMap;
 import com.google.common.collect.ListMultimap;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
-import com.google.protobuf.HBaseZeroCopyByteString;
 import com.sun.istack.NotNull;
 
+import co.cask.tephra.TxConstants;
+
 /**
  *
  * Base class for PTable implementors.  Provides abstraction for
@@ -1069,8 +1068,7 @@ public class PTableImpl implements PTable {
   int maxLength = pGuidePosts.getMaxLength();
   int guidePostsCount = pGuidePosts.getEncodedGuidePostsCount();
 GuidePostsInfo info = new 
GuidePostsInfo(pGuidePosts.getByteCountsList(),
-new ImmutableBytesWritable(
-
HBaseZeroCopyByteString.zeroCopyGetBytes(pGuidePosts.getEncodedGuidePosts())),
+new 
ImmutableBytesWritable(pGuidePosts.getEncodedGuidePosts().toByteArray()),
 pGuidePosts.getRowCountsList(), maxLength, 
guidePostsCount);
   tableGuidePosts.put(pTableStatsProto.getKey().toByteArray(), info);
   }



[2/3] phoenix git commit: PHOENIX-2862 Do client server compatibility checks before upgrading system tables

2016-05-16 Thread ankit
PHOENIX-2862 Do client server compatibility checks before upgrading system 
tables


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

Branch: refs/heads/4.x-HBase-0.98
Commit: d45938c2bb9186d5db9f39eb63069985a35dddb0
Parents: a9934ef
Author: Ankit Singhal 
Authored: Mon May 16 12:45:33 2016 +0530
Committer: Ankit Singhal 
Committed: Mon May 16 12:45:33 2016 +0530

--
 .../end2end/QueryDatabaseMetaDataIT.java|  1 +
 .../org/apache/phoenix/end2end/UpgradeIT.java   |  4 +-
 .../apache/phoenix/compile/FromCompiler.java|  3 +
 .../coprocessor/MetaDataEndpointImpl.java   | 30 +++---
 .../coprocessor/MetaDataRegionObserver.java |  9 +-
 .../phoenix/exception/SQLExceptionCode.java |  8 +-
 .../phoenix/jdbc/PhoenixDatabaseMetaData.java   |  1 +
 .../query/ConnectionQueryServicesImpl.java  | 98 ++--
 .../org/apache/phoenix/query/QueryServices.java |  4 +-
 .../phoenix/query/QueryServicesOptions.java |  2 +-
 .../org/apache/phoenix/util/MetaDataUtil.java   | 46 +++--
 .../org/apache/phoenix/util/SchemaUtil.java | 15 ++-
 .../org/apache/phoenix/util/UpgradeUtil.java| 48 ++
 .../apache/phoenix/util/MetaDataUtilTest.java   | 36 +++
 14 files changed, 220 insertions(+), 85 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d45938c2/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
index abcf6ef..aa7a6b2 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
@@ -147,6 +147,7 @@ public class QueryDatabaseMetaDataIT extends 
BaseClientManagedTimeIT {
 assertEquals(CUSTOM_ENTITY_DATA_NAME, rs.getString("TABLE_NAME"));
 assertEquals(PTableType.TABLE.toString(), rs.getString("TABLE_TYPE"));
 assertEquals("false", 
rs.getString(PhoenixDatabaseMetaData.TRANSACTIONAL));
+assertEquals(Boolean.FALSE, 
rs.getBoolean(PhoenixDatabaseMetaData.IS_NAMESPACE_MAPPED));
 
 rs = dbmd.getTables(null, CUSTOM_ENTITY_DATA_SCHEMA_NAME, 
CUSTOM_ENTITY_DATA_NAME, null);
 assertTrue(rs.next());

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d45938c2/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
index 1c86039..37d285f 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
@@ -129,7 +129,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 String indexName = "IDX";
 String localIndexName = "LIDX";
 String[] tableNames = new String[] { phoenixFullTableName, 
schemaName + "." + indexName,
-schemaName + "." + localIndexName, "diff.v", "test.v" };
+schemaName + "." + localIndexName, "diff.v", "test.v","v"};
 conn.createStatement().execute("CREATE TABLE " + 
phoenixFullTableName
 + "(k VARCHAR PRIMARY KEY, v INTEGER, f INTEGER, g INTEGER 
NULL, h INTEGER NULL)");
 PreparedStatement upsertStmt = conn
@@ -150,6 +150,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 conn.createStatement().execute("CREATE VIEW diff.v (col VARCHAR) 
AS SELECT * FROM " + phoenixFullTableName);
 // creating view in schema 'test'
 conn.createStatement().execute("CREATE VIEW test.v (col VARCHAR) 
AS SELECT * FROM " + phoenixFullTableName);
+conn.createStatement().execute("CREATE VIEW v (col VARCHAR) AS 
SELECT * FROM " + phoenixFullTableName);
 // Creating index on views
 conn.createStatement().execute("create index v_idx on 
diff.v(col)");
 conn.createStatement().execute("create index v_idx on 
test.v(col)");
@@ -170,6 +171,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 
assertTrue(admin.tableExists(MetaDataUtil.getViewIndexPhysicalName(Bytes.toBytes(phoenixFullTableName;
 Properties props = new Properties();
 

[1/3] phoenix git commit: PHOENIX-2884 Fix EXPLAIN plan for offset on salted table

2016-05-16 Thread ankit
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 ea93058f4 -> 4837f1ff9


PHOENIX-2884 Fix EXPLAIN plan for offset on salted table


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

Branch: refs/heads/4.x-HBase-0.98
Commit: a9934ef90aa12e133a5d609e9c6df57e670e5284
Parents: ea93058
Author: Ankit Singhal 
Authored: Mon May 16 12:43:09 2016 +0530
Committer: Ankit Singhal 
Committed: Mon May 16 12:43:09 2016 +0530

--
 .../phoenix/end2end/QueryWithOffsetIT.java  | 25 
 .../phoenix/iterate/BaseResultIterators.java|  4 +---
 2 files changed, 21 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/a9934ef9/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryWithOffsetIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryWithOffsetIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryWithOffsetIT.java
index 7f360de..f4b3440 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryWithOffsetIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryWithOffsetIT.java
@@ -38,6 +38,7 @@ import java.util.Properties;
 
 import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.util.PropertiesUtil;
+import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.ReadOnlyProps;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -50,16 +51,18 @@ import com.google.common.collect.Maps;
 @RunWith(Parameterized.class)
 public class QueryWithOffsetIT extends BaseOwnClusterHBaseManagedTimeIT {
 
-private String tableName;
+private String tableName = "T";
 private final String[] strings = { "a", "b", "c", "d", "e", "f", "g", "h", 
"i", "j", "k", "l", "m", "n", "o", "p",
 "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
 private final String ddl;
+private final boolean isSalted;
 
 public QueryWithOffsetIT(String preSplit) {
 this.tableName = tableName + "_" + preSplit.charAt(2);
 this.ddl = "CREATE TABLE " + tableName + " (t_id VARCHAR NOT NULL,\n" 
+ "k1 INTEGER NOT NULL,\n"
 + "k2 INTEGER NOT NULL,\n" + "C3.k3 INTEGER,\n" + "C2.v1 
VARCHAR,\n"
 + "CONSTRAINT pk PRIMARY KEY (t_id, k1, k2)) " + preSplit;
+this.isSalted = preSplit.startsWith(" SALT_BUCKETS");
 }
 
 @BeforeClass
@@ -122,16 +125,28 @@ public class QueryWithOffsetIT extends 
BaseOwnClusterHBaseManagedTimeIT {
 updateStatistics(conn);
 String query = "SELECT t_id from " + tableName + " offset " + offset;
 ResultSet rs = conn.createStatement().executeQuery("EXPLAIN " + query);
-rs.next();
-rs.next();
-rs.next();
-assertEquals("SERVER OFFSET " + offset, rs.getString(1));
+if(!isSalted){
+assertEquals("CLIENT SERIAL 1-WAY FULL SCAN OVER T_P\n" + "
SERVER FILTER BY FIRST KEY ONLY\n"
++ "SERVER OFFSET " + offset, 
QueryUtil.getExplainPlan(rs));
+}else{
+assertEquals("CLIENT PARALLEL 10-WAY FULL SCAN OVER T_A\n" + "
SERVER FILTER BY FIRST KEY ONLY\n"
++ "CLIENT MERGE SORT\n" + "CLIENT OFFSET " + offset, 
QueryUtil.getExplainPlan(rs));
+}
 rs = conn.createStatement().executeQuery(query);
 int i = 0;
 while (i++ < strings.length - offset) {
 assertTrue(rs.next());
 assertEquals(strings[offset + i - 1], rs.getString(1));
 }
+query = "SELECT t_id from " + tableName + " ORDER BY v1 offset " + 
offset;
+rs = conn.createStatement().executeQuery("EXPLAIN " + query);
+if (!isSalted) {
+assertEquals("CLIENT PARALLEL 5-WAY FULL SCAN OVER T_P\n" + "
SERVER SORTED BY [C2.V1]\n"
++ "CLIENT MERGE SORT\n" + "CLIENT OFFSET " + offset, 
QueryUtil.getExplainPlan(rs));
+} else {
+assertEquals("CLIENT PARALLEL 10-WAY FULL SCAN OVER T_A\n" + "
SERVER SORTED BY [C2.V1]\n"
++ "CLIENT MERGE SORT\n" + "CLIENT OFFSET " + offset, 
QueryUtil.getExplainPlan(rs));
+}
 conn.close();
 }
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/a9934ef9/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
 

[2/3] phoenix git commit: PHOENIX-2862 Do client server compatibility checks before upgrading system tables

2016-05-16 Thread ankit
PHOENIX-2862 Do client server compatibility checks before upgrading system 
tables


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

Branch: refs/heads/4.x-HBase-1.0
Commit: 28dbbebf070eb7a54644d578333b762b1e2ccf30
Parents: c345e09
Author: Ankit Singhal 
Authored: Mon May 16 12:38:04 2016 +0530
Committer: Ankit Singhal 
Committed: Mon May 16 12:38:04 2016 +0530

--
 .../end2end/QueryDatabaseMetaDataIT.java|  1 +
 .../org/apache/phoenix/end2end/UpgradeIT.java   |  4 +-
 .../apache/phoenix/compile/FromCompiler.java|  3 +
 .../coprocessor/MetaDataEndpointImpl.java   | 30 ---
 .../coprocessor/MetaDataRegionObserver.java |  9 +-
 .../phoenix/exception/SQLExceptionCode.java |  8 +-
 .../phoenix/jdbc/PhoenixDatabaseMetaData.java   |  4 +-
 .../query/ConnectionQueryServicesImpl.java  | 86 ++--
 .../org/apache/phoenix/query/QueryServices.java |  4 +-
 .../phoenix/query/QueryServicesOptions.java |  2 +-
 .../org/apache/phoenix/util/MetaDataUtil.java   | 46 ---
 .../org/apache/phoenix/util/SchemaUtil.java | 15 +++-
 .../org/apache/phoenix/util/UpgradeUtil.java| 48 ++-
 .../apache/phoenix/util/MetaDataUtilTest.java   | 36 
 14 files changed, 216 insertions(+), 80 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/28dbbebf/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
index abcf6ef..aa7a6b2 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
@@ -147,6 +147,7 @@ public class QueryDatabaseMetaDataIT extends 
BaseClientManagedTimeIT {
 assertEquals(CUSTOM_ENTITY_DATA_NAME, rs.getString("TABLE_NAME"));
 assertEquals(PTableType.TABLE.toString(), rs.getString("TABLE_TYPE"));
 assertEquals("false", 
rs.getString(PhoenixDatabaseMetaData.TRANSACTIONAL));
+assertEquals(Boolean.FALSE, 
rs.getBoolean(PhoenixDatabaseMetaData.IS_NAMESPACE_MAPPED));
 
 rs = dbmd.getTables(null, CUSTOM_ENTITY_DATA_SCHEMA_NAME, 
CUSTOM_ENTITY_DATA_NAME, null);
 assertTrue(rs.next());

http://git-wip-us.apache.org/repos/asf/phoenix/blob/28dbbebf/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
index 1c86039..37d285f 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
@@ -129,7 +129,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 String indexName = "IDX";
 String localIndexName = "LIDX";
 String[] tableNames = new String[] { phoenixFullTableName, 
schemaName + "." + indexName,
-schemaName + "." + localIndexName, "diff.v", "test.v" };
+schemaName + "." + localIndexName, "diff.v", "test.v","v"};
 conn.createStatement().execute("CREATE TABLE " + 
phoenixFullTableName
 + "(k VARCHAR PRIMARY KEY, v INTEGER, f INTEGER, g INTEGER 
NULL, h INTEGER NULL)");
 PreparedStatement upsertStmt = conn
@@ -150,6 +150,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 conn.createStatement().execute("CREATE VIEW diff.v (col VARCHAR) 
AS SELECT * FROM " + phoenixFullTableName);
 // creating view in schema 'test'
 conn.createStatement().execute("CREATE VIEW test.v (col VARCHAR) 
AS SELECT * FROM " + phoenixFullTableName);
+conn.createStatement().execute("CREATE VIEW v (col VARCHAR) AS 
SELECT * FROM " + phoenixFullTableName);
 // Creating index on views
 conn.createStatement().execute("create index v_idx on 
diff.v(col)");
 conn.createStatement().execute("create index v_idx on 
test.v(col)");
@@ -170,6 +171,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 
assertTrue(admin.tableExists(MetaDataUtil.getViewIndexPhysicalName(Bytes.toBytes(phoenixFullTableName;
 Properties props = new Properties();
 

[1/3] phoenix git commit: PHOENIX-2884 Fix EXPLAIN plan for offset on salted table

2016-05-16 Thread ankit
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 588eb1732 -> f30442226


PHOENIX-2884 Fix EXPLAIN plan for offset on salted table


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

Branch: refs/heads/4.x-HBase-1.0
Commit: c345e09c889d57a83856db4a65c7c0731f6ff117
Parents: 588eb17
Author: Ankit Singhal 
Authored: Mon May 16 12:36:50 2016 +0530
Committer: Ankit Singhal 
Committed: Mon May 16 12:36:50 2016 +0530

--
 .../phoenix/end2end/QueryWithOffsetIT.java  | 25 
 .../phoenix/iterate/BaseResultIterators.java|  4 +---
 2 files changed, 21 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/c345e09c/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryWithOffsetIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryWithOffsetIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryWithOffsetIT.java
index 7f360de..f4b3440 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryWithOffsetIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryWithOffsetIT.java
@@ -38,6 +38,7 @@ import java.util.Properties;
 
 import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.util.PropertiesUtil;
+import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.ReadOnlyProps;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -50,16 +51,18 @@ import com.google.common.collect.Maps;
 @RunWith(Parameterized.class)
 public class QueryWithOffsetIT extends BaseOwnClusterHBaseManagedTimeIT {
 
-private String tableName;
+private String tableName = "T";
 private final String[] strings = { "a", "b", "c", "d", "e", "f", "g", "h", 
"i", "j", "k", "l", "m", "n", "o", "p",
 "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
 private final String ddl;
+private final boolean isSalted;
 
 public QueryWithOffsetIT(String preSplit) {
 this.tableName = tableName + "_" + preSplit.charAt(2);
 this.ddl = "CREATE TABLE " + tableName + " (t_id VARCHAR NOT NULL,\n" 
+ "k1 INTEGER NOT NULL,\n"
 + "k2 INTEGER NOT NULL,\n" + "C3.k3 INTEGER,\n" + "C2.v1 
VARCHAR,\n"
 + "CONSTRAINT pk PRIMARY KEY (t_id, k1, k2)) " + preSplit;
+this.isSalted = preSplit.startsWith(" SALT_BUCKETS");
 }
 
 @BeforeClass
@@ -122,16 +125,28 @@ public class QueryWithOffsetIT extends 
BaseOwnClusterHBaseManagedTimeIT {
 updateStatistics(conn);
 String query = "SELECT t_id from " + tableName + " offset " + offset;
 ResultSet rs = conn.createStatement().executeQuery("EXPLAIN " + query);
-rs.next();
-rs.next();
-rs.next();
-assertEquals("SERVER OFFSET " + offset, rs.getString(1));
+if(!isSalted){
+assertEquals("CLIENT SERIAL 1-WAY FULL SCAN OVER T_P\n" + "
SERVER FILTER BY FIRST KEY ONLY\n"
++ "SERVER OFFSET " + offset, 
QueryUtil.getExplainPlan(rs));
+}else{
+assertEquals("CLIENT PARALLEL 10-WAY FULL SCAN OVER T_A\n" + "
SERVER FILTER BY FIRST KEY ONLY\n"
++ "CLIENT MERGE SORT\n" + "CLIENT OFFSET " + offset, 
QueryUtil.getExplainPlan(rs));
+}
 rs = conn.createStatement().executeQuery(query);
 int i = 0;
 while (i++ < strings.length - offset) {
 assertTrue(rs.next());
 assertEquals(strings[offset + i - 1], rs.getString(1));
 }
+query = "SELECT t_id from " + tableName + " ORDER BY v1 offset " + 
offset;
+rs = conn.createStatement().executeQuery("EXPLAIN " + query);
+if (!isSalted) {
+assertEquals("CLIENT PARALLEL 5-WAY FULL SCAN OVER T_P\n" + "
SERVER SORTED BY [C2.V1]\n"
++ "CLIENT MERGE SORT\n" + "CLIENT OFFSET " + offset, 
QueryUtil.getExplainPlan(rs));
+} else {
+assertEquals("CLIENT PARALLEL 10-WAY FULL SCAN OVER T_A\n" + "
SERVER SORTED BY [C2.V1]\n"
++ "CLIENT MERGE SORT\n" + "CLIENT OFFSET " + offset, 
QueryUtil.getExplainPlan(rs));
+}
 conn.close();
 }
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/c345e09c/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
 

[3/3] phoenix git commit: PHOENIX-2887 Uberjar application fail with 'IllegalAccessError: class com.google.protobuf.ZeroCopyLiteralByteString cannot access its superclass com.google.protobuf.LiteralBy

2016-05-16 Thread ankit
PHOENIX-2887 Uberjar application fail with 'IllegalAccessError: class 
com.google.protobuf.ZeroCopyLiteralByteString cannot access its superclass 
com.google.protobuf.LiteralByteString'


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

Branch: refs/heads/4.x-HBase-1.0
Commit: f304422260bce334db0638a2f18ba8e55ecce2ec
Parents: 28dbbeb
Author: Ankit Singhal 
Authored: Mon May 16 12:38:22 2016 +0530
Committer: Ankit Singhal 
Committed: Mon May 16 12:38:22 2016 +0530

--
 dev/test-patch.properties   |  1 +
 dev/test-patch.sh   | 32 
 .../apache/phoenix/cache/ServerCacheClient.java |  3 +-
 .../org/apache/phoenix/schema/PTableImpl.java   |  8 ++---
 4 files changed, 37 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f3044222/dev/test-patch.properties
--
diff --git a/dev/test-patch.properties b/dev/test-patch.properties
index 6a82eee..804d56b 100644
--- a/dev/test-patch.properties
+++ b/dev/test-patch.properties
@@ -33,3 +33,4 @@ BRANCH_NAMES="3.0 3.2 4.0.1 4.2 4.3 4.x-HBase-0.98 master"
 # All supported Hadoop versions that we want to test the compilation with
 HADOOP2_VERSIONS="2.4.1 2.5.2 2.6.0"
 HADOOP3_VERSIONS="3.0.0-SNAPSHOT"
+INCOMPATIBLE_CLASSES="com.google.protobuf.HBaseZeroCopyByteString"

http://git-wip-us.apache.org/repos/asf/phoenix/blob/f3044222/dev/test-patch.sh
--
diff --git a/dev/test-patch.sh b/dev/test-patch.sh
index 1ed7e62..1a24166 100755
--- a/dev/test-patch.sh
+++ b/dev/test-patch.sh
@@ -520,6 +520,36 @@ checkAntiPatterns () {
 }
 
 ###
+### Check against use of known incompatible classes
+checkUseOfIncompatibleClasses () {
+  echo ""
+  echo ""
+  echo "=="
+  echo "=="
+  echo "Checking against use of known incompatible classes."
+  echo "=="
+  echo "=="
+  echo ""
+  echo ""
+  for INCOMPATIBLE_CLASS in $INCOMPATIBLE_CLASSES ; do
+  warning=`$GREP "+import $INCOMPATIBLE_CLASS" $PATCH_DIR/patch`
+  if [[ $warning != "" ]]; then
+warnings="$warnings
+$INCOMPATIBLE_CLASS"
+(( count = count + 1 ))
+  fi
+  done
+  if [[ $warnings != "" ]]; then
+JIRA_COMMENT="$JIRA_COMMENT
+
+{color:red}-1 Known Incompatible class{color}.  The patch 
appears to have $count incompatible classes:
+ $warnings."
+  return 1
+  fi
+  return 0
+}
+
+###
 ### Check that there are no incorrect annotations
 checkInterfaceAudience () {
   echo ""
@@ -1050,6 +1080,8 @@ fi
 
 checkAntiPatterns
 (( RESULT = RESULT + $? ))
+checkUseOfIncompatibleClasses
+(( RESULT = RESULT + $? ))
 # checkBuildWithHadoopVersions
 # (( RESULT = RESULT + $? ))
 checkJavacWarnings

http://git-wip-us.apache.org/repos/asf/phoenix/blob/f3044222/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java 
b/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java
index 424482a..aea15c2 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java
@@ -71,7 +71,6 @@ import org.apache.phoenix.util.SQLCloseables;
 import org.apache.phoenix.util.ScanUtil;
 
 import com.google.common.collect.ImmutableSet;
-import com.google.protobuf.HBaseZeroCopyByteString;
 
 /**
  * 
@@ -214,7 +213,7 @@ public class ServerCacheClient {
 
ServerCacheFactoryProtos.ServerCacheFactory.Builder svrCacheFactoryBuider = 
ServerCacheFactoryProtos.ServerCacheFactory.newBuilder();
 
svrCacheFactoryBuider.setClassName(cacheFactory.getClass().getName());
 
builder.setCacheFactory(svrCacheFactoryBuider.build());
-

[1/3] phoenix git commit: PHOENIX-2884 Fix EXPLAIN plan for offset on salted table

2016-05-16 Thread ankit
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.1 52da01463 -> 9c3c849a1


PHOENIX-2884 Fix EXPLAIN plan for offset on salted table


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

Branch: refs/heads/4.x-HBase-1.1
Commit: 156c356669a5e8ecfb31768e62d9990b459bf31c
Parents: 52da014
Author: Ankit Singhal 
Authored: Mon May 16 12:19:20 2016 +0530
Committer: Ankit Singhal 
Committed: Mon May 16 12:19:20 2016 +0530

--
 .../phoenix/end2end/QueryWithOffsetIT.java  | 25 
 .../phoenix/iterate/BaseResultIterators.java|  4 +---
 2 files changed, 21 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/156c3566/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryWithOffsetIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryWithOffsetIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryWithOffsetIT.java
index dd21f31..c5b6959 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryWithOffsetIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryWithOffsetIT.java
@@ -38,6 +38,7 @@ import java.util.Properties;
 
 import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.util.PropertiesUtil;
+import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.ReadOnlyProps;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -50,16 +51,18 @@ import com.google.common.collect.Maps;
 @RunWith(Parameterized.class)
 public class QueryWithOffsetIT extends BaseOwnClusterHBaseManagedTimeIT {
 
-private String tableName;
+private String tableName = "T";
 private final String[] strings = { "a", "b", "c", "d", "e", "f", "g", "h", 
"i", "j", "k", "l", "m", "n", "o", "p",
 "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
 private final String ddl;
+private final boolean isSalted;
 
 public QueryWithOffsetIT(String preSplit) {
 this.tableName=tableName + "_" + preSplit.charAt(2);
 this.ddl = "CREATE TABLE " + tableName + " (t_id VARCHAR NOT NULL,\n" 
+ "k1 INTEGER NOT NULL,\n"
 + "k2 INTEGER NOT NULL,\n" + "C3.k3 INTEGER,\n" + "C2.v1 
VARCHAR,\n"
 + "CONSTRAINT pk PRIMARY KEY (t_id, k1, k2)) " + preSplit;
+this.isSalted = preSplit.startsWith(" SALT_BUCKETS");
 }
 
 @BeforeClass
@@ -122,16 +125,28 @@ public class QueryWithOffsetIT extends 
BaseOwnClusterHBaseManagedTimeIT {
 updateStatistics(conn);
 String query = "SELECT t_id from " + tableName + " offset " + offset;
 ResultSet rs = conn.createStatement().executeQuery("EXPLAIN " + query);
-rs.next();
-rs.next();
-rs.next();
-assertEquals("SERVER OFFSET " + offset, rs.getString(1));
+if(!isSalted){
+assertEquals("CLIENT SERIAL 1-WAY FULL SCAN OVER T_P\n" + "
SERVER FILTER BY FIRST KEY ONLY\n"
++ "SERVER OFFSET " + offset, 
QueryUtil.getExplainPlan(rs));
+}else{
+assertEquals("CLIENT PARALLEL 10-WAY FULL SCAN OVER T_A\n" + "
SERVER FILTER BY FIRST KEY ONLY\n"
++ "CLIENT MERGE SORT\n" + "CLIENT OFFSET " + offset, 
QueryUtil.getExplainPlan(rs));
+}
 rs = conn.createStatement().executeQuery(query);
 int i = 0;
 while (i++ < strings.length - offset) {
 assertTrue(rs.next());
 assertEquals(strings[offset + i - 1], rs.getString(1));
 }
+query = "SELECT t_id from " + tableName + " ORDER BY v1 offset " + 
offset;
+rs = conn.createStatement().executeQuery("EXPLAIN " + query);
+if (!isSalted) {
+assertEquals("CLIENT PARALLEL 5-WAY FULL SCAN OVER T_P\n" + "
SERVER SORTED BY [C2.V1]\n"
++ "CLIENT MERGE SORT\n" + "CLIENT OFFSET " + offset, 
QueryUtil.getExplainPlan(rs));
+} else {
+assertEquals("CLIENT PARALLEL 10-WAY FULL SCAN OVER T_A\n" + "
SERVER SORTED BY [C2.V1]\n"
++ "CLIENT MERGE SORT\n" + "CLIENT OFFSET " + offset, 
QueryUtil.getExplainPlan(rs));
+}
 conn.close();
 }
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/156c3566/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
 

[2/3] phoenix git commit: PHOENIX-2862 Do client server compatibility checks before upgrading system tables

2016-05-16 Thread ankit
PHOENIX-2862 Do client server compatibility checks before upgrading system 
tables


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

Branch: refs/heads/4.x-HBase-1.1
Commit: 3bd2a78e1f85d44bff1c0bad09f62ca08acaced7
Parents: 156c356
Author: Ankit Singhal 
Authored: Mon May 16 12:19:55 2016 +0530
Committer: Ankit Singhal 
Committed: Mon May 16 12:19:55 2016 +0530

--
 .../end2end/QueryDatabaseMetaDataIT.java|  1 +
 .../org/apache/phoenix/end2end/UpgradeIT.java   |  4 +-
 .../apache/phoenix/compile/FromCompiler.java|  3 +
 .../coprocessor/MetaDataEndpointImpl.java   | 30 ---
 .../coprocessor/MetaDataRegionObserver.java |  9 +-
 .../phoenix/exception/SQLExceptionCode.java |  8 +-
 .../phoenix/jdbc/PhoenixDatabaseMetaData.java   |  4 +-
 .../query/ConnectionQueryServicesImpl.java  | 86 ++--
 .../org/apache/phoenix/query/QueryServices.java |  4 +-
 .../phoenix/query/QueryServicesOptions.java |  2 +-
 .../org/apache/phoenix/util/MetaDataUtil.java   | 46 ---
 .../org/apache/phoenix/util/SchemaUtil.java | 15 +++-
 .../org/apache/phoenix/util/UpgradeUtil.java| 48 ++-
 .../apache/phoenix/util/MetaDataUtilTest.java   | 36 
 14 files changed, 216 insertions(+), 80 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/3bd2a78e/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
index abcf6ef..aa7a6b2 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
@@ -147,6 +147,7 @@ public class QueryDatabaseMetaDataIT extends 
BaseClientManagedTimeIT {
 assertEquals(CUSTOM_ENTITY_DATA_NAME, rs.getString("TABLE_NAME"));
 assertEquals(PTableType.TABLE.toString(), rs.getString("TABLE_TYPE"));
 assertEquals("false", 
rs.getString(PhoenixDatabaseMetaData.TRANSACTIONAL));
+assertEquals(Boolean.FALSE, 
rs.getBoolean(PhoenixDatabaseMetaData.IS_NAMESPACE_MAPPED));
 
 rs = dbmd.getTables(null, CUSTOM_ENTITY_DATA_SCHEMA_NAME, 
CUSTOM_ENTITY_DATA_NAME, null);
 assertTrue(rs.next());

http://git-wip-us.apache.org/repos/asf/phoenix/blob/3bd2a78e/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
index 1c86039..37d285f 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
@@ -129,7 +129,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 String indexName = "IDX";
 String localIndexName = "LIDX";
 String[] tableNames = new String[] { phoenixFullTableName, 
schemaName + "." + indexName,
-schemaName + "." + localIndexName, "diff.v", "test.v" };
+schemaName + "." + localIndexName, "diff.v", "test.v","v"};
 conn.createStatement().execute("CREATE TABLE " + 
phoenixFullTableName
 + "(k VARCHAR PRIMARY KEY, v INTEGER, f INTEGER, g INTEGER 
NULL, h INTEGER NULL)");
 PreparedStatement upsertStmt = conn
@@ -150,6 +150,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 conn.createStatement().execute("CREATE VIEW diff.v (col VARCHAR) 
AS SELECT * FROM " + phoenixFullTableName);
 // creating view in schema 'test'
 conn.createStatement().execute("CREATE VIEW test.v (col VARCHAR) 
AS SELECT * FROM " + phoenixFullTableName);
+conn.createStatement().execute("CREATE VIEW v (col VARCHAR) AS 
SELECT * FROM " + phoenixFullTableName);
 // Creating index on views
 conn.createStatement().execute("create index v_idx on 
diff.v(col)");
 conn.createStatement().execute("create index v_idx on 
test.v(col)");
@@ -170,6 +171,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 
assertTrue(admin.tableExists(MetaDataUtil.getViewIndexPhysicalName(Bytes.toBytes(phoenixFullTableName;
 Properties props = new Properties();
 

[2/3] phoenix git commit: PHOENIX-2862 Do client server compatibility checks before upgrading system tables

2016-05-16 Thread ankit
PHOENIX-2862 Do client server compatibility checks before upgrading system 
tables


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

Branch: refs/heads/master
Commit: 20ce95b0c09d7aaa394f2e703f6b1e193141ad33
Parents: 33fb201
Author: Ankit Singhal 
Authored: Mon May 16 12:16:47 2016 +0530
Committer: Ankit Singhal 
Committed: Mon May 16 12:16:47 2016 +0530

--
 .../end2end/QueryDatabaseMetaDataIT.java|  1 +
 .../org/apache/phoenix/end2end/UpgradeIT.java   |  4 +-
 .../apache/phoenix/compile/FromCompiler.java|  3 +
 .../coprocessor/MetaDataEndpointImpl.java   | 30 ---
 .../coprocessor/MetaDataRegionObserver.java |  9 +-
 .../phoenix/exception/SQLExceptionCode.java |  8 +-
 .../phoenix/jdbc/PhoenixDatabaseMetaData.java   |  4 +-
 .../query/ConnectionQueryServicesImpl.java  | 86 ++--
 .../org/apache/phoenix/query/QueryServices.java |  4 +-
 .../phoenix/query/QueryServicesOptions.java |  2 +-
 .../org/apache/phoenix/util/MetaDataUtil.java   | 46 ---
 .../org/apache/phoenix/util/SchemaUtil.java | 15 +++-
 .../org/apache/phoenix/util/UpgradeUtil.java| 48 ++-
 .../apache/phoenix/util/MetaDataUtilTest.java   | 36 
 14 files changed, 216 insertions(+), 80 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/20ce95b0/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
index 1d0f767..fbea0f0 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryDatabaseMetaDataIT.java
@@ -147,6 +147,7 @@ public class QueryDatabaseMetaDataIT extends 
BaseClientManagedTimeIT {
 assertEquals(CUSTOM_ENTITY_DATA_NAME, rs.getString("TABLE_NAME"));
 assertEquals(PTableType.TABLE.toString(), rs.getString("TABLE_TYPE"));
 assertEquals("false", 
rs.getString(PhoenixDatabaseMetaData.TRANSACTIONAL));
+assertEquals(Boolean.FALSE, 
rs.getBoolean(PhoenixDatabaseMetaData.IS_NAMESPACE_MAPPED));
 
 rs = dbmd.getTables(null, CUSTOM_ENTITY_DATA_SCHEMA_NAME, 
CUSTOM_ENTITY_DATA_NAME, null);
 assertTrue(rs.next());

http://git-wip-us.apache.org/repos/asf/phoenix/blob/20ce95b0/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
index 1c86039..37d285f 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
@@ -129,7 +129,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 String indexName = "IDX";
 String localIndexName = "LIDX";
 String[] tableNames = new String[] { phoenixFullTableName, 
schemaName + "." + indexName,
-schemaName + "." + localIndexName, "diff.v", "test.v" };
+schemaName + "." + localIndexName, "diff.v", "test.v","v"};
 conn.createStatement().execute("CREATE TABLE " + 
phoenixFullTableName
 + "(k VARCHAR PRIMARY KEY, v INTEGER, f INTEGER, g INTEGER 
NULL, h INTEGER NULL)");
 PreparedStatement upsertStmt = conn
@@ -150,6 +150,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 conn.createStatement().execute("CREATE VIEW diff.v (col VARCHAR) 
AS SELECT * FROM " + phoenixFullTableName);
 // creating view in schema 'test'
 conn.createStatement().execute("CREATE VIEW test.v (col VARCHAR) 
AS SELECT * FROM " + phoenixFullTableName);
+conn.createStatement().execute("CREATE VIEW v (col VARCHAR) AS 
SELECT * FROM " + phoenixFullTableName);
 // Creating index on views
 conn.createStatement().execute("create index v_idx on 
diff.v(col)");
 conn.createStatement().execute("create index v_idx on 
test.v(col)");
@@ -170,6 +171,7 @@ public class UpgradeIT extends BaseHBaseManagedTimeIT {
 
assertTrue(admin.tableExists(MetaDataUtil.getViewIndexPhysicalName(Bytes.toBytes(phoenixFullTableName;
 Properties props = new Properties();
 

[1/3] phoenix git commit: PHOENIX-2884 Fix EXPLAIN plan for offset on salted table

2016-05-16 Thread ankit
Repository: phoenix
Updated Branches:
  refs/heads/master 98e783cf6 -> 5d641ad34


PHOENIX-2884 Fix EXPLAIN plan for offset on salted table


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

Branch: refs/heads/master
Commit: 33fb201ebe46ba90f81658ef9b487f3b74070a4a
Parents: 98e783c
Author: Ankit Singhal 
Authored: Mon May 16 12:16:21 2016 +0530
Committer: Ankit Singhal 
Committed: Mon May 16 12:16:21 2016 +0530

--
 .../phoenix/end2end/QueryWithOffsetIT.java  | 25 
 .../phoenix/iterate/BaseResultIterators.java|  4 +---
 2 files changed, 21 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/33fb201e/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryWithOffsetIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryWithOffsetIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryWithOffsetIT.java
index dd21f31..c5b6959 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryWithOffsetIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryWithOffsetIT.java
@@ -38,6 +38,7 @@ import java.util.Properties;
 
 import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.util.PropertiesUtil;
+import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.ReadOnlyProps;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -50,16 +51,18 @@ import com.google.common.collect.Maps;
 @RunWith(Parameterized.class)
 public class QueryWithOffsetIT extends BaseOwnClusterHBaseManagedTimeIT {
 
-private String tableName;
+private String tableName = "T";
 private final String[] strings = { "a", "b", "c", "d", "e", "f", "g", "h", 
"i", "j", "k", "l", "m", "n", "o", "p",
 "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
 private final String ddl;
+private final boolean isSalted;
 
 public QueryWithOffsetIT(String preSplit) {
 this.tableName=tableName + "_" + preSplit.charAt(2);
 this.ddl = "CREATE TABLE " + tableName + " (t_id VARCHAR NOT NULL,\n" 
+ "k1 INTEGER NOT NULL,\n"
 + "k2 INTEGER NOT NULL,\n" + "C3.k3 INTEGER,\n" + "C2.v1 
VARCHAR,\n"
 + "CONSTRAINT pk PRIMARY KEY (t_id, k1, k2)) " + preSplit;
+this.isSalted = preSplit.startsWith(" SALT_BUCKETS");
 }
 
 @BeforeClass
@@ -122,16 +125,28 @@ public class QueryWithOffsetIT extends 
BaseOwnClusterHBaseManagedTimeIT {
 updateStatistics(conn);
 String query = "SELECT t_id from " + tableName + " offset " + offset;
 ResultSet rs = conn.createStatement().executeQuery("EXPLAIN " + query);
-rs.next();
-rs.next();
-rs.next();
-assertEquals("SERVER OFFSET " + offset, rs.getString(1));
+if(!isSalted){
+assertEquals("CLIENT SERIAL 1-WAY FULL SCAN OVER T_P\n" + "
SERVER FILTER BY FIRST KEY ONLY\n"
++ "SERVER OFFSET " + offset, 
QueryUtil.getExplainPlan(rs));
+}else{
+assertEquals("CLIENT PARALLEL 10-WAY FULL SCAN OVER T_A\n" + "
SERVER FILTER BY FIRST KEY ONLY\n"
++ "CLIENT MERGE SORT\n" + "CLIENT OFFSET " + offset, 
QueryUtil.getExplainPlan(rs));
+}
 rs = conn.createStatement().executeQuery(query);
 int i = 0;
 while (i++ < strings.length - offset) {
 assertTrue(rs.next());
 assertEquals(strings[offset + i - 1], rs.getString(1));
 }
+query = "SELECT t_id from " + tableName + " ORDER BY v1 offset " + 
offset;
+rs = conn.createStatement().executeQuery("EXPLAIN " + query);
+if (!isSalted) {
+assertEquals("CLIENT PARALLEL 5-WAY FULL SCAN OVER T_P\n" + "
SERVER SORTED BY [C2.V1]\n"
++ "CLIENT MERGE SORT\n" + "CLIENT OFFSET " + offset, 
QueryUtil.getExplainPlan(rs));
+} else {
+assertEquals("CLIENT PARALLEL 10-WAY FULL SCAN OVER T_A\n" + "
SERVER SORTED BY [C2.V1]\n"
++ "CLIENT MERGE SORT\n" + "CLIENT OFFSET " + offset, 
QueryUtil.getExplainPlan(rs));
+}
 conn.close();
 }
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/33fb201e/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
 

[3/3] phoenix git commit: PHOENIX-2887 Uberjar application fail with 'IllegalAccessError: class com.google.protobuf.ZeroCopyLiteralByteString cannot access its superclass com.google.protobuf.LiteralBy

2016-05-16 Thread ankit
PHOENIX-2887 Uberjar application fail with 'IllegalAccessError: class 
com.google.protobuf.ZeroCopyLiteralByteString cannot access its superclass 
com.google.protobuf.LiteralByteString'


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

Branch: refs/heads/master
Commit: 5d641ad34207b8e87b1f460a168664387f143286
Parents: 20ce95b
Author: Ankit Singhal 
Authored: Mon May 16 12:17:05 2016 +0530
Committer: Ankit Singhal 
Committed: Mon May 16 12:17:05 2016 +0530

--
 dev/test-patch.properties   |  1 +
 dev/test-patch.sh   | 32 
 .../apache/phoenix/cache/ServerCacheClient.java |  3 +-
 .../org/apache/phoenix/schema/PTableImpl.java   |  8 ++---
 4 files changed, 37 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/5d641ad3/dev/test-patch.properties
--
diff --git a/dev/test-patch.properties b/dev/test-patch.properties
index 53f2ad4..8d1e2ed 100644
--- a/dev/test-patch.properties
+++ b/dev/test-patch.properties
@@ -33,3 +33,4 @@ BRANCH_NAMES="4.4-HBase-0.98 4.4-HBase-1.0 4.4-HBase-1.1 
4.x-HBase-0.98 4.x-HBas
 # All supported Hadoop versions that we want to test the compilation with
 HADOOP2_VERSIONS="2.4.1 2.5.2 2.6.0"
 HADOOP3_VERSIONS="3.0.0-SNAPSHOT"
+INCOMPATIBLE_CLASSES="com.google.protobuf.HBaseZeroCopyByteString"

http://git-wip-us.apache.org/repos/asf/phoenix/blob/5d641ad3/dev/test-patch.sh
--
diff --git a/dev/test-patch.sh b/dev/test-patch.sh
index 5ee1607..4454e13 100755
--- a/dev/test-patch.sh
+++ b/dev/test-patch.sh
@@ -520,6 +520,36 @@ checkAntiPatterns () {
 }
 
 ###
+### Check against use of known incompatible classes
+checkUseOfIncompatibleClasses () {
+  echo ""
+  echo ""
+  echo "=="
+  echo "=="
+  echo "Checking against use of known incompatible classes."
+  echo "=="
+  echo "=="
+  echo ""
+  echo ""
+  for INCOMPATIBLE_CLASS in $INCOMPATIBLE_CLASSES ; do
+  warning=`$GREP "+import $INCOMPATIBLE_CLASS" $PATCH_DIR/patch`
+  if [[ $warning != "" ]]; then
+warnings="$warnings
+$INCOMPATIBLE_CLASS"
+(( count = count + 1 ))
+  fi
+  done
+  if [[ $warnings != "" ]]; then
+JIRA_COMMENT="$JIRA_COMMENT
+
+{color:red}-1 Known Incompatible class{color}.  The patch 
appears to have $count incompatible classes:
+ $warnings."
+  return 1
+  fi
+  return 0
+}
+
+###
 ### Check that there are no incorrect annotations
 checkInterfaceAudience () {
   echo ""
@@ -1050,6 +1080,8 @@ fi
 
 checkAntiPatterns
 (( RESULT = RESULT + $? ))
+checkUseOfIncompatibleClasses
+(( RESULT = RESULT + $? ))
 # checkBuildWithHadoopVersions
 # (( RESULT = RESULT + $? ))
 checkJavacWarnings

http://git-wip-us.apache.org/repos/asf/phoenix/blob/5d641ad3/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java 
b/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java
index 424482a..aea15c2 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java
@@ -71,7 +71,6 @@ import org.apache.phoenix.util.SQLCloseables;
 import org.apache.phoenix.util.ScanUtil;
 
 import com.google.common.collect.ImmutableSet;
-import com.google.protobuf.HBaseZeroCopyByteString;
 
 /**
  * 
@@ -214,7 +213,7 @@ public class ServerCacheClient {
 
ServerCacheFactoryProtos.ServerCacheFactory.Builder svrCacheFactoryBuider = 
ServerCacheFactoryProtos.ServerCacheFactory.newBuilder();
 
svrCacheFactoryBuider.setClassName(cacheFactory.getClass().getName());
 
builder.setCacheFactory(svrCacheFactoryBuider.build());
-