Jenkins build is back to normal : Phoenix-4.x-HBase-1.3 #17

2018-01-19 Thread Apache Jenkins Server
See 




Build failed in Jenkins: Phoenix | Master #1916

2018-01-19 Thread Apache Jenkins Server
See 


Changes:

[elserj] PHOENIX-4541 Fix apache-rat-check failures

[elserj] PHOENIX-4542 Use .sha256 and .sha512

--
[...truncated 1.17 MB...]
[INFO] Running org.apache.phoenix.end2end.join.SortMergeJoinLocalIndexIT
[INFO] Tests run: 40, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 510.217 
s - in org.apache.phoenix.end2end.index.LocalMutableTxIndexIT
[INFO] Running org.apache.phoenix.end2end.join.SubqueryIT
[INFO] Tests run: 64, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 765.703 
s - in org.apache.phoenix.end2end.index.MutableIndexIT
[INFO] Tests run: 33, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 368.021 
s - in org.apache.phoenix.end2end.join.HashJoinNoIndexIT
[INFO] Running org.apache.phoenix.end2end.join.SubqueryUsingSortMergeJoinIT
[INFO] Running org.apache.phoenix.end2end.salted.SaltedTableIT
[INFO] Tests run: 34, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 389.076 
s - in org.apache.phoenix.end2end.join.SortMergeJoinNoIndexIT
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 30.686 s 
- in org.apache.phoenix.end2end.salted.SaltedTableIT
[INFO] Running org.apache.phoenix.end2end.salted.SaltedTableVarLengthRowKeyIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.386 s 
- in org.apache.phoenix.end2end.salted.SaltedTableVarLengthRowKeyIT
[INFO] Running org.apache.phoenix.iterate.PhoenixQueryTimeoutIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 9.247 s 
- in org.apache.phoenix.iterate.PhoenixQueryTimeoutIT
[INFO] Running org.apache.phoenix.iterate.RoundRobinResultIteratorIT
[INFO] Running org.apache.phoenix.end2end.salted.SaltedTableUpsertSelectIT
[INFO] Tests run: 33, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 635.474 
s - in org.apache.phoenix.end2end.join.HashJoinGlobalIndexIT
[INFO] Tests run: 21, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 395.476 
s - in org.apache.phoenix.end2end.join.SubqueryIT
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 49.803 s 
- in org.apache.phoenix.end2end.salted.SaltedTableUpsertSelectIT
[INFO] Running org.apache.phoenix.trace.PhoenixTableMetricsWriterIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 14.428 s 
- in org.apache.phoenix.trace.PhoenixTableMetricsWriterIT
[INFO] Running org.apache.phoenix.trace.PhoenixTracingEndToEndIT
[INFO] Running org.apache.phoenix.replication.SystemCatalogWALEntryFilterIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.237 s 
- in org.apache.phoenix.replication.SystemCatalogWALEntryFilterIT
[INFO] Running org.apache.phoenix.tx.FlappingTransactionIT
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 85.273 s 
- in org.apache.phoenix.iterate.RoundRobinResultIteratorIT
[INFO] Running org.apache.phoenix.tx.ParameterizedTransactionIT
[INFO] Running org.apache.phoenix.rpc.UpdateCacheIT
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 19.62 s 
- in org.apache.phoenix.tx.FlappingTransactionIT
[INFO] Running org.apache.phoenix.tx.TransactionIT
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 42.921 s 
- in org.apache.phoenix.rpc.UpdateCacheIT
[INFO] Running org.apache.phoenix.tx.TxCheckpointIT
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 106.048 
s - in org.apache.phoenix.trace.PhoenixTracingEndToEndIT
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 98.69 s 
- in org.apache.phoenix.tx.TransactionIT
[INFO] Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 289.863 
s - in org.apache.phoenix.end2end.join.SubqueryUsingSortMergeJoinIT
[INFO] Tests run: 34, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 659.316 
s - in org.apache.phoenix.end2end.join.SortMergeJoinGlobalIndexIT
[INFO] Running org.apache.phoenix.util.IndexScrutinyIT
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 29.589 s 
- in org.apache.phoenix.util.IndexScrutinyIT
[INFO] Tests run: 34, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 850.07 
s - in org.apache.phoenix.end2end.join.HashJoinLocalIndexIT
[WARNING] Tests run: 52, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 
363.035 s - in org.apache.phoenix.tx.ParameterizedTransactionIT
[INFO] Tests run: 34, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 848.791 
s - in org.apache.phoenix.end2end.join.SortMergeJoinLocalIndexIT
[INFO] Tests run: 40, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 421.788 
s - in org.apache.phoenix.tx.TxCheckpointIT
[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   DefaultColumnValueIT.testDefaultIndexed:978
[ERROR]   RowValueConstructorIT.testRVCLastPkIsTable1stPkIndex:1584
[ERROR]   
IndexMetadataIT.testMutableTableOnlyHasPrimaryKeyIndex:623->helpTestTableOnlyHasPrimaryKeyIndex:662
[ERROR] Errors: 
[ERROR]   

Build failed in Jenkins: Phoenix-4.x-HBase-1.2 #244

2018-01-19 Thread Apache Jenkins Server
See 


Changes:

[elserj] PHOENIX-4541 Fix apache-rat-check failures

[elserj] PHOENIX-4542 Use .sha256 and .sha512

--
[...truncated 115.79 KB...]
[INFO] Running org.apache.phoenix.end2end.CsvBulkLoadToolIT
[WARNING] Tests run: 26, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 
101.839 s - in 
org.apache.phoenix.end2end.ColumnEncodedImmutableNonTxStatsCollectorIT
[WARNING] Tests run: 26, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 
101.86 s - in 
org.apache.phoenix.end2end.ColumnEncodedMutableNonTxStatsCollectorIT
[WARNING] Tests run: 26, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 
104.376 s - in 
org.apache.phoenix.end2end.ColumnEncodedImmutableTxStatsCollectorIT
[WARNING] Tests run: 26, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 
101.541 s - in org.apache.phoenix.end2end.ColumnEncodedMutableTxStatsCollectorIT
[INFO] Running org.apache.phoenix.end2end.DropSchemaIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 12.729 s 
- in org.apache.phoenix.end2end.DropSchemaIT
[INFO] Running org.apache.phoenix.end2end.FlappingLocalIndexIT
[INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 88.477 
s - in org.apache.phoenix.end2end.CsvBulkLoadToolIT
[INFO] Running org.apache.phoenix.end2end.IndexExtendedIT
[INFO] Running org.apache.phoenix.end2end.IndexToolForPartialBuildIT
[INFO] Running org.apache.phoenix.end2end.IndexScrutinyToolIT
[INFO] Running 
org.apache.phoenix.end2end.IndexToolForPartialBuildWithNamespaceEnabledIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 26.665 s 
- in org.apache.phoenix.end2end.IndexToolForPartialBuildIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 26.344 s 
- in org.apache.phoenix.end2end.IndexToolForPartialBuildWithNamespaceEnabledIT
[INFO] Running org.apache.phoenix.end2end.IndexToolIT
[INFO] Running org.apache.phoenix.end2end.MigrateSystemTablesToSystemNamespaceIT
[INFO] Running org.apache.phoenix.end2end.LocalIndexSplitMergeIT
[INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 134.236 
s - in org.apache.phoenix.end2end.FlappingLocalIndexIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 59.802 s 
- in org.apache.phoenix.end2end.LocalIndexSplitMergeIT
[INFO] Tests run: 32, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 146.677 
s - in org.apache.phoenix.end2end.IndexExtendedIT
[INFO] Running 
org.apache.phoenix.end2end.NonColumnEncodedImmutableNonTxStatsCollectorIT
[INFO] Running org.apache.phoenix.end2end.PartialResultServerConfigurationIT
[INFO] Running 
org.apache.phoenix.end2end.NonColumnEncodedImmutableTxStatsCollectorIT
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 334.621 
s - in org.apache.phoenix.end2end.CostBasedDecisionIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 38.419 s 
- in org.apache.phoenix.end2end.PartialResultServerConfigurationIT
[INFO] Running org.apache.phoenix.end2end.PhoenixDriverIT
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 211.422 
s - in org.apache.phoenix.end2end.MigrateSystemTablesToSystemNamespaceIT
[INFO] Running org.apache.phoenix.end2end.QueryTimeoutIT
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 45.115 s 
- in org.apache.phoenix.end2end.PhoenixDriverIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 14.36 s 
- in org.apache.phoenix.end2end.QueryTimeoutIT
[WARNING] Tests run: 26, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 
111.125 s - in 
org.apache.phoenix.end2end.NonColumnEncodedImmutableNonTxStatsCollectorIT
[WARNING] Tests run: 26, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 
110.882 s - in 
org.apache.phoenix.end2end.NonColumnEncodedImmutableTxStatsCollectorIT
[INFO] Running org.apache.phoenix.end2end.QueryWithLimitIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.464 s 
- in org.apache.phoenix.end2end.QueryWithLimitIT
[INFO] Running org.apache.phoenix.end2end.RebuildIndexConnectionPropsIT
[INFO] Running org.apache.phoenix.end2end.RegexBulkLoadToolIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.123 s 
- in org.apache.phoenix.end2end.RebuildIndexConnectionPropsIT
[INFO] Running org.apache.phoenix.end2end.RenewLeaseIT
[INFO] Running org.apache.phoenix.end2end.SystemTablePermissionsIT
[INFO] Running org.apache.phoenix.end2end.SpillableGroupByIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 28.512 s 
- in org.apache.phoenix.end2end.RenewLeaseIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 8.889 s 
- in org.apache.phoenix.end2end.SpillableGroupByIT
[INFO] Running 
org.apache.phoenix.end2end.SysTableNamespaceMappedStatsCollectorIT
[INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 589.611 
s - in 

[05/10] phoenix git commit: PHOENIX-4542 Use .sha256 and .sha512

2018-01-19 Thread elserj
PHOENIX-4542 Use .sha256 and .sha512


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

Branch: refs/heads/4.x-HBase-1.3
Commit: f62c7648ebdb540886e52324cb5d51e47e206d33
Parents: 0a141ed
Author: Josh Elser 
Authored: Fri Jan 19 11:36:43 2018 -0500
Committer: Josh Elser 
Committed: Fri Jan 19 16:41:54 2018 -0500

--
 dev/make_rc.sh | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f62c7648/dev/make_rc.sh
--
diff --git a/dev/make_rc.sh b/dev/make_rc.sh
index 638968c..d81786f 100755
--- a/dev/make_rc.sh
+++ b/dev/make_rc.sh
@@ -102,14 +102,14 @@ function_sign() {
   if [[ "$OSTYPE" == "darwin"* ]]; then
 gpg2 --armor --output $phoenix_tar.asc --detach-sig $phoenix_tar;
 openssl md5 $phoenix_tar > $phoenix_tar.md5;
-openssl dgst -sha512 $phoenix_tar > $phoenix_tar.sha;
-openssl dgst -sha256 $phoenix_tar >> $phoenix_tar.sha;
+openssl dgst -sha512 $phoenix_tar > $phoenix_tar.sha512;
+openssl dgst -sha256 $phoenix_tar >> $phoenix_tar.sha256;
   # all other OS
   else
 gpg --armor --output $phoenix_tar.asc --detach-sig $phoenix_tar;
 md5sum -b $phoenix_tar > $phoenix_tar.md5;
-sha512sum -b $phoenix_tar > $phoenix_tar.sha;
-sha256sum -b $phoenix_tar >> $phoenix_tar.sha;
+sha512sum -b $phoenix_tar > $phoenix_tar.sha512;
+sha256sum -b $phoenix_tar >> $phoenix_tar.sha256;
   fi
 }
 



[06/10] phoenix git commit: PHOENIX-4541 Fix apache-rat-check failures

2018-01-19 Thread elserj
PHOENIX-4541 Fix apache-rat-check failures


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

Branch: refs/heads/4.x-HBase-1.3
Commit: 0a141ed370f27d4cd3cf83b7fa8f49c8f1372e71
Parents: c42d90a
Author: Josh Elser 
Authored: Fri Jan 19 11:01:21 2018 -0500
Committer: Josh Elser 
Committed: Fri Jan 19 16:41:54 2018 -0500

--
 .../phoenix/schema/TablesNotInSyncException.java   | 17 +
 pom.xml|  3 +++
 2 files changed, 20 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/0a141ed3/phoenix-core/src/main/java/org/apache/phoenix/schema/TablesNotInSyncException.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/TablesNotInSyncException.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/TablesNotInSyncException.java
index e58df71..dac5b7f 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/TablesNotInSyncException.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/TablesNotInSyncException.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/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.phoenix.schema;
 
 import org.apache.phoenix.exception.SQLExceptionCode;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/0a141ed3/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 7b6b052..b875fa7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -473,6 +473,9 @@
 examples/pig/testdata
 
 **/patchprocess/**
+
+bin/argparse-1.4.0/argparse.py
   
 
   



[07/10] phoenix git commit: PHOENIX-4541 Fix apache-rat-check failures

2018-01-19 Thread elserj
PHOENIX-4541 Fix apache-rat-check failures


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

Branch: refs/heads/4.x-HBase-1.2
Commit: e19fe33971bd04e9dcbd7ccff6cbee7315f7fb25
Parents: 75a7a5d
Author: Josh Elser 
Authored: Fri Jan 19 11:01:21 2018 -0500
Committer: Josh Elser 
Committed: Fri Jan 19 17:44:24 2018 -0500

--
 .../phoenix/schema/TablesNotInSyncException.java   | 17 +
 pom.xml|  3 +++
 2 files changed, 20 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/e19fe339/phoenix-core/src/main/java/org/apache/phoenix/schema/TablesNotInSyncException.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/TablesNotInSyncException.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/TablesNotInSyncException.java
index e58df71..dac5b7f 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/TablesNotInSyncException.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/TablesNotInSyncException.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/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.phoenix.schema;
 
 import org.apache.phoenix.exception.SQLExceptionCode;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/e19fe339/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 749fba0..d3088d9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -473,6 +473,9 @@
 examples/pig/testdata
 
 **/patchprocess/**
+
+bin/argparse-1.4.0/argparse.py
   
 
   



[08/10] phoenix git commit: PHOENIX-4542 Use .sha256 and .sha512

2018-01-19 Thread elserj
PHOENIX-4542 Use .sha256 and .sha512


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

Branch: refs/heads/4.x-HBase-1.2
Commit: 0e9275859920db389915491268b021fe1f018a46
Parents: e19fe33
Author: Josh Elser 
Authored: Fri Jan 19 11:36:43 2018 -0500
Committer: Josh Elser 
Committed: Fri Jan 19 17:44:24 2018 -0500

--
 dev/make_rc.sh | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/0e927585/dev/make_rc.sh
--
diff --git a/dev/make_rc.sh b/dev/make_rc.sh
index 638968c..d81786f 100755
--- a/dev/make_rc.sh
+++ b/dev/make_rc.sh
@@ -102,14 +102,14 @@ function_sign() {
   if [[ "$OSTYPE" == "darwin"* ]]; then
 gpg2 --armor --output $phoenix_tar.asc --detach-sig $phoenix_tar;
 openssl md5 $phoenix_tar > $phoenix_tar.md5;
-openssl dgst -sha512 $phoenix_tar > $phoenix_tar.sha;
-openssl dgst -sha256 $phoenix_tar >> $phoenix_tar.sha;
+openssl dgst -sha512 $phoenix_tar > $phoenix_tar.sha512;
+openssl dgst -sha256 $phoenix_tar >> $phoenix_tar.sha256;
   # all other OS
   else
 gpg --armor --output $phoenix_tar.asc --detach-sig $phoenix_tar;
 md5sum -b $phoenix_tar > $phoenix_tar.md5;
-sha512sum -b $phoenix_tar > $phoenix_tar.sha;
-sha256sum -b $phoenix_tar >> $phoenix_tar.sha;
+sha512sum -b $phoenix_tar > $phoenix_tar.sha512;
+sha256sum -b $phoenix_tar >> $phoenix_tar.sha256;
   fi
 }
 



[01/10] phoenix git commit: PHOENIX-4541 Fix apache-rat-check failures

2018-01-19 Thread elserj
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 b978de2a9 -> 712aa28d8
  refs/heads/4.x-HBase-1.2 75a7a5d5e -> 0e9275859
  refs/heads/4.x-HBase-1.3 c42d90aa3 -> f62c7648e
  refs/heads/5.x-HBase-2.0 8ac5ec08d -> 42f4fed7e
  refs/heads/master e3faa9549 -> 5fb3f7fa8


PHOENIX-4541 Fix apache-rat-check failures


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

Branch: refs/heads/master
Commit: 0aa1cfb4e14f52c9770d5da5bae7f4868152ca7e
Parents: e3faa95
Author: Josh Elser 
Authored: Fri Jan 19 11:01:21 2018 -0500
Committer: Josh Elser 
Committed: Fri Jan 19 15:58:40 2018 -0500

--
 .../phoenix/schema/TablesNotInSyncException.java   | 17 +
 pom.xml|  3 +++
 2 files changed, 20 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/0aa1cfb4/phoenix-core/src/main/java/org/apache/phoenix/schema/TablesNotInSyncException.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/TablesNotInSyncException.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/TablesNotInSyncException.java
index e58df71..dac5b7f 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/TablesNotInSyncException.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/TablesNotInSyncException.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/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.phoenix.schema;
 
 import org.apache.phoenix.exception.SQLExceptionCode;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/0aa1cfb4/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 88bf3c3..6d7e3a9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -473,6 +473,9 @@
 examples/pig/testdata
 
 **/patchprocess/**
+
+bin/argparse-1.4.0/argparse.py
   
 
   



[10/10] phoenix git commit: PHOENIX-4542 Use .sha256 and .sha512

2018-01-19 Thread elserj
PHOENIX-4542 Use .sha256 and .sha512


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 712aa28d8730aa15e924a4e4e2ff5f020a45f284
Parents: 88ba82a
Author: Josh Elser 
Authored: Fri Jan 19 11:36:43 2018 -0500
Committer: Josh Elser 
Committed: Fri Jan 19 17:53:20 2018 -0500

--
 dev/make_rc.sh | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/712aa28d/dev/make_rc.sh
--
diff --git a/dev/make_rc.sh b/dev/make_rc.sh
index 638968c..d81786f 100755
--- a/dev/make_rc.sh
+++ b/dev/make_rc.sh
@@ -102,14 +102,14 @@ function_sign() {
   if [[ "$OSTYPE" == "darwin"* ]]; then
 gpg2 --armor --output $phoenix_tar.asc --detach-sig $phoenix_tar;
 openssl md5 $phoenix_tar > $phoenix_tar.md5;
-openssl dgst -sha512 $phoenix_tar > $phoenix_tar.sha;
-openssl dgst -sha256 $phoenix_tar >> $phoenix_tar.sha;
+openssl dgst -sha512 $phoenix_tar > $phoenix_tar.sha512;
+openssl dgst -sha256 $phoenix_tar >> $phoenix_tar.sha256;
   # all other OS
   else
 gpg --armor --output $phoenix_tar.asc --detach-sig $phoenix_tar;
 md5sum -b $phoenix_tar > $phoenix_tar.md5;
-sha512sum -b $phoenix_tar > $phoenix_tar.sha;
-sha256sum -b $phoenix_tar >> $phoenix_tar.sha;
+sha512sum -b $phoenix_tar > $phoenix_tar.sha512;
+sha256sum -b $phoenix_tar >> $phoenix_tar.sha256;
   fi
 }
 



[03/10] phoenix git commit: PHOENIX-4541 Fix apache-rat-check failures

2018-01-19 Thread elserj
PHOENIX-4541 Fix apache-rat-check failures


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

Branch: refs/heads/5.x-HBase-2.0
Commit: a995cc812fe3cd3db8367dbe1d271fe4923056a0
Parents: 8ac5ec0
Author: Josh Elser 
Authored: Fri Jan 19 11:01:21 2018 -0500
Committer: Josh Elser 
Committed: Fri Jan 19 16:04:59 2018 -0500

--
 pom.xml | 3 +++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/a995cc81/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 295c94d..0dba0c7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -472,6 +472,9 @@
 examples/pig/testdata
 
 **/patchprocess/**
+
+bin/argparse-1.4.0/argparse.py
   
 
   



[09/10] phoenix git commit: PHOENIX-4541 Fix apache-rat-check failures

2018-01-19 Thread elserj
PHOENIX-4541 Fix apache-rat-check failures


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 88ba82afe2899554109452cfd41a571b7db78810
Parents: b978de2
Author: Josh Elser 
Authored: Fri Jan 19 11:01:21 2018 -0500
Committer: Josh Elser 
Committed: Fri Jan 19 17:53:17 2018 -0500

--
 .../apache/phoenix/end2end/MutationStateIT.java| 17 +
 .../apache/phoenix/end2end/SystemCatalogIT.java| 17 +
 pom.xml|  3 +++
 3 files changed, 37 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/88ba82af/phoenix-core/src/it/java/org/apache/phoenix/end2end/MutationStateIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/MutationStateIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/MutationStateIT.java
index 2d5f360..36782c1 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/MutationStateIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/MutationStateIT.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/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.phoenix.end2end;
 
 import static org.junit.Assert.assertEquals;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/88ba82af/phoenix-core/src/it/java/org/apache/phoenix/end2end/SystemCatalogIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SystemCatalogIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SystemCatalogIT.java
index 7de9cbf..acc7873 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SystemCatalogIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SystemCatalogIT.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/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.phoenix.end2end;
 
 import static org.junit.Assert.assertEquals;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/88ba82af/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 824b05f..36a49c3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -474,6 +474,9 @@
 examples/pig/testdata
 
 **/patchprocess/**
+
+bin/argparse-1.4.0/argparse.py
   
 
   



[04/10] phoenix git commit: PHOENIX-4542 Use .sha256 and .sha512

2018-01-19 Thread elserj
PHOENIX-4542 Use .sha256 and .sha512


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

Branch: refs/heads/5.x-HBase-2.0
Commit: 42f4fed7e8826457dd0cca45d6199a2b7741524d
Parents: a995cc8
Author: Josh Elser 
Authored: Fri Jan 19 11:36:43 2018 -0500
Committer: Josh Elser 
Committed: Fri Jan 19 16:05:04 2018 -0500

--
 dev/make_rc.sh | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/42f4fed7/dev/make_rc.sh
--
diff --git a/dev/make_rc.sh b/dev/make_rc.sh
index 638968c..d81786f 100755
--- a/dev/make_rc.sh
+++ b/dev/make_rc.sh
@@ -102,14 +102,14 @@ function_sign() {
   if [[ "$OSTYPE" == "darwin"* ]]; then
 gpg2 --armor --output $phoenix_tar.asc --detach-sig $phoenix_tar;
 openssl md5 $phoenix_tar > $phoenix_tar.md5;
-openssl dgst -sha512 $phoenix_tar > $phoenix_tar.sha;
-openssl dgst -sha256 $phoenix_tar >> $phoenix_tar.sha;
+openssl dgst -sha512 $phoenix_tar > $phoenix_tar.sha512;
+openssl dgst -sha256 $phoenix_tar >> $phoenix_tar.sha256;
   # all other OS
   else
 gpg --armor --output $phoenix_tar.asc --detach-sig $phoenix_tar;
 md5sum -b $phoenix_tar > $phoenix_tar.md5;
-sha512sum -b $phoenix_tar > $phoenix_tar.sha;
-sha256sum -b $phoenix_tar >> $phoenix_tar.sha;
+sha512sum -b $phoenix_tar > $phoenix_tar.sha512;
+sha256sum -b $phoenix_tar >> $phoenix_tar.sha256;
   fi
 }
 



[02/10] phoenix git commit: PHOENIX-4542 Use .sha256 and .sha512

2018-01-19 Thread elserj
PHOENIX-4542 Use .sha256 and .sha512


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

Branch: refs/heads/master
Commit: 5fb3f7fa86bb9496f91f1f861f000c0089157340
Parents: 0aa1cfb
Author: Josh Elser 
Authored: Fri Jan 19 11:36:43 2018 -0500
Committer: Josh Elser 
Committed: Fri Jan 19 15:58:53 2018 -0500

--
 dev/make_rc.sh | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/5fb3f7fa/dev/make_rc.sh
--
diff --git a/dev/make_rc.sh b/dev/make_rc.sh
index 638968c..d81786f 100755
--- a/dev/make_rc.sh
+++ b/dev/make_rc.sh
@@ -102,14 +102,14 @@ function_sign() {
   if [[ "$OSTYPE" == "darwin"* ]]; then
 gpg2 --armor --output $phoenix_tar.asc --detach-sig $phoenix_tar;
 openssl md5 $phoenix_tar > $phoenix_tar.md5;
-openssl dgst -sha512 $phoenix_tar > $phoenix_tar.sha;
-openssl dgst -sha256 $phoenix_tar >> $phoenix_tar.sha;
+openssl dgst -sha512 $phoenix_tar > $phoenix_tar.sha512;
+openssl dgst -sha256 $phoenix_tar >> $phoenix_tar.sha256;
   # all other OS
   else
 gpg --armor --output $phoenix_tar.asc --detach-sig $phoenix_tar;
 md5sum -b $phoenix_tar > $phoenix_tar.md5;
-sha512sum -b $phoenix_tar > $phoenix_tar.sha;
-sha256sum -b $phoenix_tar >> $phoenix_tar.sha;
+sha512sum -b $phoenix_tar > $phoenix_tar.sha512;
+sha256sum -b $phoenix_tar >> $phoenix_tar.sha256;
   fi
 }
 



phoenix git commit: PHOENIX-4536 Change getWAL usage due HBASE-19751

2018-01-19 Thread ssa
Repository: phoenix
Updated Branches:
  refs/heads/5.x-HBase-2.0 7fa371977 -> 8ac5ec08d


PHOENIX-4536 Change getWAL usage due HBASE-19751


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

Branch: refs/heads/5.x-HBase-2.0
Commit: 8ac5ec08d6dac484a80d453b44ee2f69609ca6a5
Parents: 7fa3719
Author: Sergey Soldatov 
Authored: Thu Jan 18 13:06:34 2018 -0800
Committer: Sergey Soldatov 
Committed: Thu Jan 18 13:06:34 2018 -0800

--
 .../wal/WALReplayWithIndexWritesAndCompressedWALIT.java| 2 +-
 .../hbase/index/write/recovery/TestPerRegionIndexWriteCache.java   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/8ac5ec08/phoenix-core/src/it/java/org/apache/hadoop/hbase/regionserver/wal/WALReplayWithIndexWritesAndCompressedWALIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/hadoop/hbase/regionserver/wal/WALReplayWithIndexWritesAndCompressedWALIT.java
 
b/phoenix-core/src/it/java/org/apache/hadoop/hbase/regionserver/wal/WALReplayWithIndexWritesAndCompressedWALIT.java
index c8accfd..c0e822f 100644
--- 
a/phoenix-core/src/it/java/org/apache/hadoop/hbase/regionserver/wal/WALReplayWithIndexWritesAndCompressedWALIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/hadoop/hbase/regionserver/wal/WALReplayWithIndexWritesAndCompressedWALIT.java
@@ -267,7 +267,7 @@ public class WALReplayWithIndexWritesAndCompressedWALIT {
* @throws IOException
*/
   private WAL createWAL(final Configuration c, WALFactory walFactory) throws 
IOException {
-WAL wal = walFactory.getWAL(new byte[]{}, null);
+WAL wal = walFactory.getWAL(null);
 
 // Set down maximum recovery so we dfsclient doesn't linger retrying 
something
 // long gone.

http://git-wip-us.apache.org/repos/asf/phoenix/blob/8ac5ec08/phoenix-core/src/test/java/org/apache/phoenix/hbase/index/write/recovery/TestPerRegionIndexWriteCache.java
--
diff --git 
a/phoenix-core/src/test/java/org/apache/phoenix/hbase/index/write/recovery/TestPerRegionIndexWriteCache.java
 
b/phoenix-core/src/test/java/org/apache/phoenix/hbase/index/write/recovery/TestPerRegionIndexWriteCache.java
index c51ac99..2ec1a8d 100644
--- 
a/phoenix-core/src/test/java/org/apache/phoenix/hbase/index/write/recovery/TestPerRegionIndexWriteCache.java
+++ 
b/phoenix-core/src/test/java/org/apache/phoenix/hbase/index/write/recovery/TestPerRegionIndexWriteCache.java
@@ -106,7 +106,7 @@ public class TestPerRegionIndexWriteCache {
   Random rn = new Random();
   tableName = TableName.valueOf("TestPerRegion" + rn.nextInt());
   WALFactory walFactory = new WALFactory(TEST_UTIL.getConfiguration(), 
null, getClass().getSimpleName());
-  wal = walFactory.getWAL(Bytes.toBytes("logs"), null);
+  wal = 
walFactory.getWAL(RegionInfoBuilder.newBuilder(TableName.valueOf("logs")).build());
 TableDescriptor htd =
 TableDescriptorBuilder
 .newBuilder(tableName)



[06/50] [abbrv] phoenix git commit: Merge remote-tracking branch 'upstream/master' into PHOENIX-3534

2018-01-19 Thread tdsilva
Merge remote-tracking branch 'upstream/master' into PHOENIX-3534


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

Branch: refs/heads/system-catalog
Commit: 39c0d1d41ceca41bfb0257de6d18aab59f1c9566
Parents: 758efd9 2a8e1c7
Author: Thomas D'Silva 
Authored: Mon Nov 13 08:22:34 2017 -0800
Committer: Thomas D'Silva 
Committed: Mon Nov 13 08:22:34 2017 -0800

--
 LICENSE |  43 +-
 dev/make_rc.sh  |  26 +-
 dev/make_rc_on_mac.sh   | 121 
 dev/release_files/LICENSE   |   2 +
 phoenix-assembly/pom.xml|   2 +-
 phoenix-client/pom.xml  |   2 +-
 phoenix-core/pom.xml|   6 +-
 .../phoenix/end2end/CollationKeyFunctionIT.java | 181 +
 .../org/apache/phoenix/end2end/DeleteIT.java|  96 ++-
 .../end2end/ExplainPlanWithStatsEnabledIT.java  | 146 +++-
 .../phoenix/end2end/TableDDLPermissionsIT.java  | 694 +++
 phoenix-core/src/main/antlr3/PhoenixSQL.g   |  15 +-
 .../org/apache/hadoop/hbase/ipc/RpcUtil.java|  32 +
 .../apache/phoenix/compile/DeleteCompiler.java  |   5 +-
 .../BaseMetaDataEndpointObserver.java   | 111 +++
 .../coprocessor/MetaDataEndpointImpl.java   | 358 +++---
 .../coprocessor/MetaDataEndpointObserver.java   |  68 ++
 .../phoenix/coprocessor/MetaDataProtocol.java   |   8 +-
 .../coprocessor/MetaDataRegionObserver.java |  17 +-
 .../coprocessor/PhoenixAccessController.java| 628 +
 .../PhoenixMetaDataCoprocessorHost.java | 236 +++
 .../apache/phoenix/coprocessor/ViewFinder.java  |   5 +-
 .../phoenix/expression/ExpressionType.java  |   4 +-
 .../function/CollationKeyFunction.java  | 199 ++
 .../index/PhoenixIndexFailurePolicy.java| 109 +--
 .../phoenix/iterate/BaseResultIterators.java|  42 +-
 .../apache/phoenix/jdbc/PhoenixConnection.java  |   3 +
 .../query/ConnectionQueryServicesImpl.java  |  15 +-
 .../org/apache/phoenix/query/QueryServices.java |   4 +
 .../phoenix/query/QueryServicesOptions.java |  14 +-
 .../phoenix/schema/stats/StatisticsWriter.java  |  42 +-
 .../org/apache/phoenix/util/MetaDataUtil.java   |  18 +
 .../org/apache/phoenix/util/SchemaUtil.java |  12 +
 .../apache/phoenix/util/VarBinaryFormatter.java |  52 ++
 .../function/CollationKeyFunctionTest.java  | 243 +++
 .../apache/phoenix/parse/QueryParserTest.java   |  21 +
 phoenix-flume/pom.xml   |   2 +-
 phoenix-hive/pom.xml|   2 +-
 phoenix-kafka/pom.xml   |   2 +-
 phoenix-load-balancer/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  |   3 +-
 phoenix-spark/pom.xml   |   2 +-
 phoenix-tracing-webapp/pom.xml  |   2 +-
 pom.xml |   7 +-
 48 files changed, 3253 insertions(+), 357 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/39c0d1d4/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
--
diff --cc 
phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
index 000,971383b..2e78cce
mode 00,100644..100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
@@@ -1,0 -1,692 +1,694 @@@
+ /*
+  * Licensed to the Apache Software Foundation (ASF) under one or more
+  * contributor license agreements.  See the NOTICE file distributed with
+  * this work for additional information regarding copyright ownership.
+  * The ASF licenses this file to you under the Apache License, Version 2.0
+  * (the "License"); you may not use this file except in compliance with
+  * the License.  You may obtain a copy of the License at
+  *
+  * http://www.apache.org/licenses/LICENSE-2.0
+  *
+  * Unless required by applicable law or agreed to in writing, software
+  * distributed under the License is distributed on an "AS IS" BASIS,
+  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  * See the License for the specific language governing 

[18/50] [abbrv] phoenix git commit: Revert "PHOENIX-4386 Calculate the estimatedSize of MutationState using Map<TableRef, Map<ImmutableBytesPtr, RowMutationState>> mutations (addendum)"

2018-01-19 Thread tdsilva
Revert "PHOENIX-4386 Calculate the estimatedSize of MutationState using 
Map> mutations (addendum)"

This reverts commit 4e0c0a33ed8b401f7785dde8979041dd5ab9a1f4.


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

Branch: refs/heads/system-catalog
Commit: 355ee522c1d4ff07cf9fbb0a9a01e43e3f702730
Parents: d46d4e5
Author: Thomas D'Silva 
Authored: Tue Nov 28 18:37:55 2017 -0800
Committer: Thomas D'Silva 
Committed: Tue Nov 28 18:37:55 2017 -0800

--
 .../apache/phoenix/execute/PartialCommitIT.java |   5 +-
 .../apache/phoenix/compile/DeleteCompiler.java  |  11 +-
 .../apache/phoenix/compile/UpsertCompiler.java  |   7 +-
 .../apache/phoenix/execute/MutationState.java   | 127 +++
 .../java/org/apache/phoenix/util/IndexUtil.java |   4 +-
 .../org/apache/phoenix/util/KeyValueUtil.java   |   5 +-
 6 files changed, 61 insertions(+), 98 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/355ee522/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
index e5b57e3..10fd7f8 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
@@ -33,6 +33,7 @@ import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 import java.util.Map;
@@ -51,8 +52,8 @@ import 
org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver;
 import org.apache.hadoop.hbase.regionserver.wal.WALEdit;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.phoenix.end2end.BaseOwnClusterIT;
-import org.apache.phoenix.execute.MutationState.MultiRowMutationState;
 import org.apache.phoenix.hbase.index.Indexer;
+import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr;
 import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.monitoring.GlobalMetric;
 import org.apache.phoenix.monitoring.MetricType;
@@ -284,7 +285,7 @@ public class PartialCommitIT extends BaseOwnClusterIT {
 private PhoenixConnection 
getConnectionWithTableOrderPreservingMutationState() throws SQLException {
 Connection con = driver.connect(url, new Properties());
 PhoenixConnection phxCon = new 
PhoenixConnection(con.unwrap(PhoenixConnection.class));
-final Map mutations = 
Maps.newTreeMap(new TableRefComparator());
+final 
Map> mutations = 
Maps.newTreeMap(new TableRefComparator());
 // passing a null mutation state forces the 
connection.newMutationState() to be used to create the MutationState
 return new PhoenixConnection(phxCon, null) {
 @Override

http://git-wip-us.apache.org/repos/asf/phoenix/blob/355ee522/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
index a06e2ca..f9ca300 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
@@ -26,6 +26,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 import org.apache.hadoop.hbase.Cell;
@@ -42,7 +43,6 @@ import org.apache.phoenix.exception.SQLExceptionCode;
 import org.apache.phoenix.exception.SQLExceptionInfo;
 import org.apache.phoenix.execute.AggregatePlan;
 import org.apache.phoenix.execute.MutationState;
-import org.apache.phoenix.execute.MutationState.MultiRowMutationState;
 import org.apache.phoenix.execute.MutationState.RowMutationState;
 import org.apache.phoenix.filter.SkipScanFilter;
 import org.apache.phoenix.hbase.index.ValueGetter;
@@ -91,6 +91,7 @@ import org.apache.phoenix.util.ScanUtil;
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 import com.sun.istack.NotNull;
 
 public class DeleteCompiler {
@@ -120,14 +121,14 

[21/50] [abbrv] phoenix git commit: PHOENIX-4288 Indexes not used when ordering by primary key

2018-01-19 Thread tdsilva
PHOENIX-4288 Indexes not used when ordering by primary key


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

Branch: refs/heads/system-catalog
Commit: 6807dacce7d063e14f06bc57888e7d2a5f78863a
Parents: 88038a2
Author: maryannxue 
Authored: Tue Dec 5 10:52:46 2017 -0800
Committer: maryannxue 
Committed: Tue Dec 5 10:52:46 2017 -0800

--
 .../phoenix/end2end/CostBasedDecisionIT.java| 466 +++
 .../apache/phoenix/end2end/MutationStateIT.java |  17 +
 .../apache/phoenix/end2end/SystemCatalogIT.java |  17 +
 .../phoenix/compile/ListJarsQueryPlan.java  |   6 +
 .../org/apache/phoenix/compile/QueryPlan.java   |   5 +-
 .../apache/phoenix/compile/TraceQueryPlan.java  |   6 +
 .../apache/phoenix/execute/AggregatePlan.java   |  30 +-
 .../apache/phoenix/execute/BaseQueryPlan.java   |  21 +-
 .../phoenix/execute/ClientAggregatePlan.java|  28 ++
 .../apache/phoenix/execute/ClientScanPlan.java  |  25 +
 .../apache/phoenix/execute/CorrelatePlan.java   |  25 +
 .../phoenix/execute/DelegateQueryPlan.java  |   6 +
 .../apache/phoenix/execute/HashJoinPlan.java|  29 ++
 .../execute/LiteralResultIterationPlan.java |   6 +
 .../org/apache/phoenix/execute/ScanPlan.java|  25 +
 .../phoenix/execute/SortMergeJoinPlan.java  |  18 +
 .../org/apache/phoenix/execute/UnionPlan.java   |  10 +
 .../apache/phoenix/jdbc/PhoenixStatement.java   |   6 +
 .../java/org/apache/phoenix/optimize/Cost.java  | 123 +
 .../apache/phoenix/optimize/QueryOptimizer.java |  30 +-
 .../org/apache/phoenix/query/QueryServices.java |   3 +
 .../phoenix/query/QueryServicesOptions.java |   4 +
 .../java/org/apache/phoenix/util/CostUtil.java  |  90 
 .../query/ParallelIteratorsSplitTest.java   |   6 +
 24 files changed, 988 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/6807dacc/phoenix-core/src/it/java/org/apache/phoenix/end2end/CostBasedDecisionIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CostBasedDecisionIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CostBasedDecisionIT.java
new file mode 100644
index 000..a3584ce
--- /dev/null
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CostBasedDecisionIT.java
@@ -0,0 +1,466 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end;
+
+import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES;
+import static org.junit.Assert.assertTrue;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.phoenix.query.BaseTest;
+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;
+
+import com.google.common.collect.Maps;
+
+public class CostBasedDecisionIT extends BaseUniqueNamesOwnClusterIT {
+
+@BeforeClass
+public static void doSetup() throws Exception {
+Map props = Maps.newHashMapWithExpectedSize(1);
+props.put(QueryServices.STATS_GUIDEPOST_WIDTH_BYTES_ATTRIB, 
Long.toString(20));
+props.put(QueryServices.STATS_UPDATE_FREQ_MS_ATTRIB, Long.toString(5));
+props.put(QueryServices.USE_STATS_FOR_PARALLELIZATION, 
Boolean.toString(true));
+props.put(QueryServices.COST_BASED_OPTIMIZER_ENABLED, 
Boolean.toString(true));
+setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
+}
+
+@Test
+public void testCostOverridesStaticPlanOrdering1() throws Exception {
+Properties props = 

[39/50] [abbrv] phoenix git commit: PHOENIX-4437 Make QueryPlan.getEstimatedBytesToScan() independent of getExplainPlan() and pull optimize() out of getExplainPlan()

2018-01-19 Thread tdsilva
PHOENIX-4437 Make QueryPlan.getEstimatedBytesToScan() independent of 
getExplainPlan() and pull optimize() out of getExplainPlan()


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

Branch: refs/heads/system-catalog
Commit: 412329a7415302831954891285d291055328c28b
Parents: 9355a4d
Author: maryannxue 
Authored: Thu Dec 21 10:31:04 2017 -0800
Committer: maryannxue 
Committed: Thu Dec 21 10:31:04 2017 -0800

--
 .../end2end/ExplainPlanWithStatsEnabledIT.java  |  2 +-
 .../apache/phoenix/execute/BaseQueryPlan.java   | 45 ++
 .../apache/phoenix/execute/HashJoinPlan.java| 59 +-
 .../phoenix/execute/SortMergeJoinPlan.java  | 63 ++--
 .../org/apache/phoenix/execute/UnionPlan.java   | 53 
 .../apache/phoenix/jdbc/PhoenixStatement.java   |  9 ++-
 6 files changed, 119 insertions(+), 112 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/412329a7/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExplainPlanWithStatsEnabledIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExplainPlanWithStatsEnabledIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExplainPlanWithStatsEnabledIT.java
index 49efa97..f13510b 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExplainPlanWithStatsEnabledIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExplainPlanWithStatsEnabledIT.java
@@ -298,7 +298,7 @@ public class ExplainPlanWithStatsEnabledIT extends 
ParallelStatsEnabledIT {
 try (Connection conn = DriverManager.getConnection(getUrl())) {
 conn.setAutoCommit(false);
 Estimate info = getByteRowEstimates(conn, sql, binds);
-assertEquals((Long) 200l, info.estimatedBytes);
+assertEquals((Long) 176l, info.estimatedBytes);
 assertEquals((Long) 2l, info.estimatedRows);
 assertTrue(info.estimateInfoTs > 0);
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/412329a7/phoenix-core/src/main/java/org/apache/phoenix/execute/BaseQueryPlan.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/execute/BaseQueryPlan.java 
b/phoenix-core/src/main/java/org/apache/phoenix/execute/BaseQueryPlan.java
index 31f67b7..380037f 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/execute/BaseQueryPlan.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/execute/BaseQueryPlan.java
@@ -117,7 +117,7 @@ public abstract class BaseQueryPlan implements QueryPlan {
 protected Long estimatedRows;
 protected Long estimatedSize;
 protected Long estimateInfoTimestamp;
-private boolean explainPlanCalled;
+private boolean getEstimatesCalled;
 
 
 protected BaseQueryPlan(
@@ -498,32 +498,17 @@ public abstract class BaseQueryPlan implements QueryPlan {
 
 @Override
 public ExplainPlan getExplainPlan() throws SQLException {
-explainPlanCalled = true;
 if (context.getScanRanges() == ScanRanges.NOTHING) {
 return new ExplainPlan(Collections.singletonList("DEGENERATE SCAN 
OVER " + getTableRef().getTable().getName().getString()));
 }
 
-// If cost-based optimizer is enabled, we need to initialize a dummy 
iterator to
-// get the stats for computing costs.
-boolean costBased =
-
context.getConnection().getQueryServices().getConfiguration().getBoolean(
-QueryServices.COST_BASED_OPTIMIZER_ENABLED, 
QueryServicesOptions.DEFAULT_COST_BASED_OPTIMIZER_ENABLED);
-if (costBased) {
-ResultIterator iterator = iterator();
-iterator.close();
-}
-// Optimize here when getting explain plan, as queries don't get 
optimized until after compilation
-QueryPlan plan = 
context.getConnection().getQueryServices().getOptimizer().optimize(context.getStatement(),
 this);
-ExplainPlan exp = plan instanceof BaseQueryPlan ? new 
ExplainPlan(getPlanSteps(plan.iterator())) : plan.getExplainPlan();
-if (!costBased) { // do not override estimates if they are used for 
cost calculation.
-this.estimatedRows = plan.getEstimatedRowsToScan();
-this.estimatedSize = plan.getEstimatedBytesToScan();
-this.estimateInfoTimestamp = plan.getEstimateInfoTimestamp();
-}
-return exp;
+ResultIterator iterator = iterator();
+ExplainPlan explainPlan = new 

[30/50] [abbrv] phoenix git commit: PHOENIX-4446 Sequence table region opening failing because of property setting attempt on read-only configuration(Rajeshbabu)

2018-01-19 Thread tdsilva
PHOENIX-4446 Sequence table region opening failing because of property setting 
attempt on read-only configuration(Rajeshbabu)


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

Branch: refs/heads/system-catalog
Commit: 334eb15b4a7a80ce8d4e1c1dc09b7724663fc4da
Parents: c075a17
Author: Rajeshbabu Chintaguntla 
Authored: Sat Dec 9 09:48:59 2017 +0530
Committer: Rajeshbabu Chintaguntla 
Committed: Sat Dec 9 09:48:59 2017 +0530

--
 .../java/org/apache/phoenix/hbase/index/write/IndexWriter.java  | 3 ++-
 .../main/java/org/apache/phoenix/index/PhoenixIndexBuilder.java | 5 -
 2 files changed, 2 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/334eb15b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/IndexWriter.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/IndexWriter.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/IndexWriter.java
index 6b57025..4e5e182 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/IndexWriter.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/IndexWriter.java
@@ -33,6 +33,7 @@ import org.apache.hadoop.hbase.util.Pair;
 import org.apache.phoenix.hbase.index.exception.IndexWriteException;
 import org.apache.phoenix.hbase.index.table.HTableInterfaceReference;
 import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr;
+import org.apache.phoenix.index.PhoenixIndexFailurePolicy;
 
 import com.google.common.collect.ArrayListMultimap;
 import com.google.common.collect.Multimap;
@@ -88,7 +89,7 @@ public class IndexWriter implements Stoppable {
 Configuration conf = env.getConfiguration();
 try {
   IndexFailurePolicy committer =
-  conf.getClass(INDEX_FAILURE_POLICY_CONF_KEY, 
KillServerOnFailurePolicy.class,
+  conf.getClass(INDEX_FAILURE_POLICY_CONF_KEY, 
PhoenixIndexFailurePolicy.class,
 IndexFailurePolicy.class).newInstance();
   return committer;
 } catch (InstantiationException e) {

http://git-wip-us.apache.org/repos/asf/phoenix/blob/334eb15b/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixIndexBuilder.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixIndexBuilder.java 
b/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixIndexBuilder.java
index 679c5df..8b1e2f1 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixIndexBuilder.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixIndexBuilder.java
@@ -102,11 +102,6 @@ public class PhoenixIndexBuilder extends NonTxIndexBuilder 
{
 @Override
 public void setup(RegionCoprocessorEnvironment env) throws IOException {
 super.setup(env);
-Configuration conf = env.getConfiguration();
-// Install handler that will attempt to disable the index first before 
killing the region
-// server
-conf.setIfUnset(IndexWriter.INDEX_FAILURE_POLICY_CONF_KEY,
-PhoenixIndexFailurePolicy.class.getName());
 }
 
 @Override



[47/50] [abbrv] phoenix git commit: Merge remote-tracking branch 'upstream/master' into PHOENIX-3534

2018-01-19 Thread tdsilva
Merge remote-tracking branch 'upstream/master' into PHOENIX-3534


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

Branch: refs/heads/system-catalog
Commit: cb47eaecfd098e22c903ae8b3125b9e3f2508593
Parents: 7b4ccaf f714287
Author: Thomas D'Silva 
Authored: Thu Dec 28 23:30:35 2017 -0800
Committer: Thomas D'Silva 
Committed: Thu Dec 28 23:30:35 2017 -0800

--
 NOTICE  |2 +
 bin/argparse-1.4.0/argparse.py  | 2392 ++
 bin/daemon.py   |   16 +-
 bin/queryserver.py  |2 +-
 bin/sqlline-thin.py |9 +-
 bin/sqlline.py  |   14 +-
 phoenix-core/pom.xml|1 +
 ...ReplayWithIndexWritesAndCompressedWALIT.java |2 +
 .../apache/phoenix/end2end/AlterTableIT.java|2 +-
 .../phoenix/end2end/BasePermissionsIT.java  |  754 ++
 .../phoenix/end2end/ChangePermissionsIT.java|  270 ++
 .../phoenix/end2end/CostBasedDecisionIT.java|  466 
 .../apache/phoenix/end2end/CreateSchemaIT.java  |   64 +-
 .../phoenix/end2end/DefaultColumnValueIT.java   |9 +-
 .../end2end/ExplainPlanWithStatsEnabledIT.java  |   38 +-
 .../org/apache/phoenix/end2end/IndexToolIT.java |   40 +
 .../MigrateSystemTablesToSystemNamespaceIT.java |8 +
 .../apache/phoenix/end2end/MutationStateIT.java |  161 ++
 .../apache/phoenix/end2end/PhoenixDriverIT.java |  160 ++
 .../org/apache/phoenix/end2end/QueryMoreIT.java |   42 -
 .../org/apache/phoenix/end2end/SequenceIT.java  |   29 -
 .../org/apache/phoenix/end2end/SortOrderIT.java |   11 +-
 .../apache/phoenix/end2end/StoreNullsIT.java|6 +-
 .../apache/phoenix/end2end/SystemCatalogIT.java |   96 +
 .../end2end/SystemTablePermissionsIT.java   |  226 +-
 .../phoenix/end2end/TableDDLPermissionsIT.java  |  583 +
 .../org/apache/phoenix/end2end/UpgradeIT.java   |   73 +
 .../phoenix/end2end/UpsertBigValuesIT.java  |   64 +-
 .../phoenix/end2end/index/DropColumnIT.java |   19 +-
 .../phoenix/end2end/index/IndexMetadataIT.java  |   55 +
 .../phoenix/end2end/join/HashJoinMoreIT.java|5 +
 .../apache/phoenix/execute/PartialCommitIT.java |5 +-
 phoenix-core/src/main/antlr3/PhoenixSQL.g   |   37 +-
 .../phoenix/compile/BaseMutationPlan.java   |5 +
 .../phoenix/compile/DelegateMutationPlan.java   |5 +
 .../apache/phoenix/compile/DeleteCompiler.java  |  558 ++--
 .../apache/phoenix/compile/JoinCompiler.java|   19 +-
 .../phoenix/compile/ListJarsQueryPlan.java  |6 +
 .../apache/phoenix/compile/MutationPlan.java|5 +-
 .../phoenix/compile/ProjectionCompiler.java |6 +-
 .../apache/phoenix/compile/QueryCompiler.java   |6 +-
 .../org/apache/phoenix/compile/QueryPlan.java   |5 +-
 .../org/apache/phoenix/compile/ScanRanges.java  |   11 +-
 .../apache/phoenix/compile/TraceQueryPlan.java  |6 +
 .../apache/phoenix/compile/UpsertCompiler.java  |  687 ++---
 .../apache/phoenix/compile/WhereOptimizer.java  |5 -
 .../coprocessor/BaseScannerRegionObserver.java  |5 +-
 .../coprocessor/MetaDataEndpointImpl.java   |   30 +-
 .../coprocessor/PhoenixAccessController.java|   29 +-
 .../phoenix/exception/SQLExceptionCode.java |1 +
 .../apache/phoenix/execute/AggregatePlan.java   |   30 +-
 .../apache/phoenix/execute/BaseQueryPlan.java   |   38 +-
 .../phoenix/execute/ClientAggregatePlan.java|   28 +
 .../apache/phoenix/execute/ClientScanPlan.java  |   25 +
 .../apache/phoenix/execute/CorrelatePlan.java   |   25 +
 .../phoenix/execute/DelegateQueryPlan.java  |6 +
 .../apache/phoenix/execute/HashJoinPlan.java|   88 +-
 .../execute/LiteralResultIterationPlan.java |6 +
 .../apache/phoenix/execute/MutationState.java   |  154 +-
 .../org/apache/phoenix/execute/ScanPlan.java|   25 +
 .../phoenix/execute/SortMergeJoinPlan.java  |   81 +-
 .../org/apache/phoenix/execute/UnionPlan.java   |   63 +-
 .../RowValueConstructorExpression.java  |4 +-
 .../expression/SingleCellColumnExpression.java  |   35 +-
 .../phoenix/hbase/index/write/IndexWriter.java  |3 +-
 .../apache/phoenix/index/IndexMaintainer.java   |2 +-
 .../phoenix/index/PhoenixIndexBuilder.java  |5 -
 .../phoenix/iterate/BaseResultIterators.java|6 +-
 .../NonAggregateRegionScannerFactory.java   |2 +-
 .../apache/phoenix/jdbc/PhoenixStatement.java   |   74 +-
 .../phoenix/mapreduce/PhoenixOutputFormat.java  |   13 +-
 .../phoenix/mapreduce/PhoenixRecordWriter.java  |8 +-
 .../phoenix/mapreduce/util/ConnectionUtil.java  |   23 

[04/50] [abbrv] phoenix git commit: Store parent -> child view links in SYSTEM.CHILD_LINK table

2018-01-19 Thread tdsilva
Store parent -> child view links in SYSTEM.CHILD_LINK table


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

Branch: refs/heads/system-catalog
Commit: 758efd9b14e61bcb99ebbb0724a948b5f4e8ed11
Parents: 57d8bc4
Author: Thomas D'Silva 
Authored: Sat Nov 11 22:32:35 2017 -0800
Committer: Thomas D'Silva 
Committed: Sat Nov 11 22:32:35 2017 -0800

--
 .../phoenix/end2end/AlterTableWithViewsIT.java  |   2 +-
 .../org/apache/phoenix/end2end/BaseViewIT.java  |   2 +-
 .../MigrateSystemTablesToSystemNamespaceIT.java |   4 +-
 .../end2end/QueryDatabaseMetaDataIT.java|   5 +
 .../end2end/TenantSpecificTablesDDLIT.java  |   2 +
 .../java/org/apache/phoenix/end2end/ViewIT.java |   1 -
 .../SystemCatalogWALEntryFilterIT.java  |  18 +-
 .../apache/phoenix/coprocessor/CatalogInfo.java |  90 --
 .../coprocessor/MetaDataEndpointImpl.java   | 174 +++
 .../phoenix/coprocessor/MetaDataProtocol.java   |   3 +-
 .../phoenix/coprocessor/OrphanCleaner.java  |   3 +-
 .../apache/phoenix/coprocessor/ViewFinder.java  |   6 +-
 .../phoenix/jdbc/PhoenixDatabaseMetaData.java   |   5 +
 .../query/ConnectionQueryServicesImpl.java  |   8 +-
 .../query/ConnectionlessQueryServicesImpl.java  |   5 +
 .../apache/phoenix/query/QueryConstants.java|  17 ++
 .../SystemCatalogWALEntryFilter.java|   7 +-
 .../java/org/apache/phoenix/schema/PTable.java  |   5 +-
 .../org/apache/phoenix/util/MetaDataUtil.java   |  29 +++-
 .../org/apache/phoenix/util/SchemaUtil.java |   6 +
 .../org/apache/phoenix/util/UpgradeUtil.java|  29 
 .../coprocessor/MetaDataEndpointImplTest.java   |   6 +-
 22 files changed, 232 insertions(+), 195 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/758efd9b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableWithViewsIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableWithViewsIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableWithViewsIT.java
index 51e664b..94dc02d 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableWithViewsIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableWithViewsIT.java
@@ -792,7 +792,7 @@ public class AlterTableWithViewsIT extends 
ParallelStatsDisabledIT {
 
// PK2 should be in both views
sql = "SELECT PK2 FROM " + view1;
-   viewConn2.createStatement().execute(sql);
+   viewConn.createStatement().execute(sql);
sql = "SELECT PK2 FROM " + view2;
viewConn2.createStatement().execute(sql);
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/758efd9b/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 de5d993..478b234 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
@@ -74,7 +74,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 
 @Parameters(name="transactional = {0}")
 public static Collection data() {
-return Arrays.asList(new Boolean[] { /*false, */true });
+return Arrays.asList(new Boolean[] { false, true });
 }
 
 protected void testUpdatableViewWithIndex(Integer saltBuckets, boolean 
localIndex) throws Exception {

http://git-wip-us.apache.org/repos/asf/phoenix/blob/758efd9b/phoenix-core/src/it/java/org/apache/phoenix/end2end/MigrateSystemTablesToSystemNamespaceIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/MigrateSystemTablesToSystemNamespaceIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/MigrateSystemTablesToSystemNamespaceIT.java
index 91e34be..ebd4c35 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/MigrateSystemTablesToSystemNamespaceIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/MigrateSystemTablesToSystemNamespaceIT.java
@@ -58,10 +58,10 @@ public class MigrateSystemTablesToSystemNamespaceIT extends 
BaseTest {
 
 private static final Set PHOENIX_SYSTEM_TABLES = new 
HashSet<>(Arrays.asList(
 "SYSTEM.CATALOG", 

[50/50] [abbrv] phoenix git commit: Merge branch 'PHOENIX-3534' into system-catalog

2018-01-19 Thread tdsilva
Merge branch 'PHOENIX-3534' into system-catalog


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

Branch: refs/heads/system-catalog
Commit: 15d4dace4169009ac4fd11261d6c8cc72905fcec
Parents: ae359fe 41f8142
Author: Thomas D'Silva 
Authored: Fri Jan 19 10:00:46 2018 -0800
Committer: Thomas D'Silva 
Committed: Fri Jan 19 10:00:46 2018 -0800

--
 .gitignore  |2 +
 LICENSE |   43 +-
 NOTICE  |2 +
 bin/argparse-1.4.0/argparse.py  | 2392 
 bin/daemon.py   |   16 +-
 bin/queryserver.py  |2 +-
 bin/sqlline-thin.py |9 +-
 bin/sqlline.py  |   14 +-
 dev/make_rc.sh  |   26 +-
 dev/release_files/LICENSE   |2 +
 dev/release_files/NOTICE|8 +
 dev/test-patch.properties   |7 +-
 dev/test-patch.sh   |   66 +-
 phoenix-assembly/pom.xml|2 +-
 phoenix-client/pom.xml  |2 +-
 phoenix-core/pom.xml|   19 +-
 .../wal/ReadWriteKeyValuesWithCodecIT.java  |  184 -
 .../wal/WALRecoveryRegionPostOpenIT.java|  330 ++
 ...ReplayWithIndexWritesAndCompressedWALIT.java |   18 +-
 .../org/apache/phoenix/end2end/AggregateIT.java | 1012 +
 .../phoenix/end2end/AggregateQueryIT.java   |   23 +-
 .../AlterMultiTenantTableWithViewsIT.java   |  118 +-
 .../apache/phoenix/end2end/AlterTableIT.java| 1249 +--
 .../phoenix/end2end/AlterTableWithViewsIT.java  |  223 +-
 .../org/apache/phoenix/end2end/Array1IT.java| 1004 +
 .../org/apache/phoenix/end2end/Array2IT.java|  815 +
 .../org/apache/phoenix/end2end/Array3IT.java|  770 
 .../phoenix/end2end/ArrayAppendFunctionIT.java  |   42 +-
 .../phoenix/end2end/ArrayConcatFunctionIT.java  |   39 +-
 .../org/apache/phoenix/end2end/ArrayIT.java | 2731 +-
 .../phoenix/end2end/AutoPartitionViewsIT.java   |   22 +-
 .../phoenix/end2end/AutomaticRebuildIT.java |  219 --
 .../end2end/BaseClientManagedTimeIT.java|   79 -
 .../org/apache/phoenix/end2end/BaseJoinIT.java  |  456 ---
 .../phoenix/end2end/BasePermissionsIT.java  |  754 
 .../org/apache/phoenix/end2end/BaseQueryIT.java |  169 +-
 .../end2end/BaseUniqueNamesOwnClusterIT.java|5 -
 .../apache/phoenix/end2end/CaseStatementIT.java |   56 +-
 .../apache/phoenix/end2end/CastAndCoerceIT.java |   20 +-
 .../phoenix/end2end/ChangePermissionsIT.java|  270 ++
 .../phoenix/end2end/ClientManagedTimeTest.java  |   42 -
 .../end2end/ClientTimeArithmeticQueryIT.java|  808 
 .../phoenix/end2end/CoalesceFunctionIT.java |   76 +-
 .../phoenix/end2end/CollationKeyFunctionIT.java |  181 +
 ...mnEncodedImmutableNonTxStatsCollectorIT.java |   39 +
 ...olumnEncodedImmutableTxStatsCollectorIT.java |   38 +
 ...lumnEncodedMutableNonTxStatsCollectorIT.java |   38 +
 .../ColumnEncodedMutableTxStatsCollectorIT.java |   38 +
 .../end2end/ColumnProjectionOptimizationIT.java |   70 +-
 .../phoenix/end2end/ConcurrentMutationsIT.java  |  730 
 .../ConnectionQueryServicesTestImpl.java|4 +-
 .../phoenix/end2end/ConnectionUtilIT.java   |   10 -
 .../phoenix/end2end/ContextClassloaderIT.java   |9 -
 .../phoenix/end2end/CostBasedDecisionIT.java|  466 +++
 .../CountDistinctApproximateHyperLogLogIT.java  |  154 +
 .../apache/phoenix/end2end/CreateSchemaIT.java  |   86 +-
 .../apache/phoenix/end2end/CreateTableIT.java   |  924 +++--
 .../phoenix/end2end/CsvBulkLoadToolIT.java  |   38 +
 .../CursorWithRowValueConstructorIT.java|  672 
 .../phoenix/end2end/CustomEntityDataIT.java |   75 +-
 .../phoenix/end2end/DateArithmeticIT.java   |  309 ++
 .../org/apache/phoenix/end2end/DateTimeIT.java  |  347 +-
 .../phoenix/end2end/DefaultColumnValueIT.java   |   10 +-
 .../org/apache/phoenix/end2end/DeleteIT.java|  216 +-
 .../apache/phoenix/end2end/DerivedTableIT.java  |  340 +-
 .../apache/phoenix/end2end/DistinctCountIT.java |  118 +-
 .../apache/phoenix/end2end/DropSchemaIT.java|   80 +-
 .../phoenix/end2end/EncodeFunctionIT.java   |   20 +
 .../phoenix/end2end/ExecuteStatementsIT.java|4 +-
 .../end2end/ExplainPlanWithStatsDisabledIT.java |  259 ++
 .../end2end/ExplainPlanWithStatsEnabledIT.java  | 1107 ++
 .../phoenix/end2end/ExtendedQueryExecIT.java|   30 +-
 

[13/50] [abbrv] phoenix git commit: PHOENIX-4384 Phoenix server jar doesn't include icu4j jars (Shehzaad Nakhoda)

2018-01-19 Thread tdsilva
PHOENIX-4384 Phoenix server jar doesn't include icu4j jars (Shehzaad Nakhoda)


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

Branch: refs/heads/system-catalog
Commit: 03fc3314219f364bf91dd09921e51ecf94a41aff
Parents: 4944081
Author: James Taylor 
Authored: Sat Nov 18 11:31:46 2017 -0800
Committer: James Taylor 
Committed: Sat Nov 18 11:31:46 2017 -0800

--
 phoenix-core/pom.xml   | 1 +
 phoenix-server/pom.xml | 3 +++
 pom.xml| 3 ++-
 3 files changed, 6 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/03fc3314/phoenix-core/pom.xml
--
diff --git a/phoenix-core/pom.xml b/phoenix-core/pom.xml
index fbda221..c90946a 100644
--- a/phoenix-core/pom.xml
+++ b/phoenix-core/pom.xml
@@ -474,6 +474,7 @@
 
   com.salesforce.i18n
   i18n-util
+  ${i18n-util.version}
 
   
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/03fc3314/phoenix-server/pom.xml
--
diff --git a/phoenix-server/pom.xml b/phoenix-server/pom.xml
index e67927e..e0baeb1 100644
--- a/phoenix-server/pom.xml
+++ b/phoenix-server/pom.xml
@@ -135,6 +135,9 @@
   org.apache.thrift:libthrift
   com.clearspring.analytics:stream
   com.salesforce.i18n:i18n-util
+  com.ibm.icu:icu4j
+  com.ibm.icu:icu4j-charset
+  com.ibm.icu:icu4j-localespi
 
   
 org.apache.phoenix:phoenix-server

http://git-wip-us.apache.org/repos/asf/phoenix/blob/03fc3314/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 2327c80..7b6b052 100644
--- a/pom.xml
+++ b/pom.xml
@@ -105,6 +105,7 @@
 2.11.8
 2.11
 2.9.5
+1.0.1
 
 1.8.5
 4.12
@@ -930,7 +931,7 @@
   
 com.salesforce.i18n
 i18n-util
-1.0.1
+${i18n-util.version}
   
 
   



[48/50] [abbrv] phoenix git commit: fix test

2018-01-19 Thread tdsilva
fix test


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

Branch: refs/heads/system-catalog
Commit: 338c650e879604ac6670625852dd88e8a4ee04dd
Parents: cb47eae
Author: Thomas D'Silva 
Authored: Thu Dec 28 23:41:30 2017 -0800
Committer: Thomas D'Silva 
Committed: Thu Dec 28 23:42:20 2017 -0800

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


http://git-wip-us.apache.org/repos/asf/phoenix/blob/338c650e/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
index dc55400..8666bb8 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
@@ -201,8 +201,6 @@ public class TableDDLPermissionsIT extends 
BasePermissionsIT {
 verifyAllowed(readTable(phoenixTableName, indexName1), 
unprivilegedUser);
 verifyAllowed(readTable(phoenixTableName, indexName2), 
unprivilegedUser);
 verifyAllowed(rebuildIndex(indexName2, phoenixTableName), 
unprivilegedUser);
-verifyAllowed(dropView(viewName3), regularUser);
-verifyAllowed(dropView(viewName4), regularUser);
 
 // data table user should be able to read new index
 verifyAllowed(rebuildIndex(indexName2, phoenixTableName), 
regularUser1);



[36/50] [abbrv] phoenix git commit: PHOENIX-4460 High GC / RS shutdown when we use select query with IN clause using 4.10 phoenix client on 4.13 phoenix server

2018-01-19 Thread tdsilva
PHOENIX-4460 High GC / RS shutdown when we use select query with IN clause 
using 4.10 phoenix client on 4.13 phoenix server


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

Branch: refs/heads/system-catalog
Commit: 9d8be0e9214ba3680a81c399c5da316c1b91c99b
Parents: 5cb02da
Author: Thomas D'Silva 
Authored: Thu Dec 14 15:41:42 2017 -0800
Committer: Thomas D'Silva 
Committed: Mon Dec 18 20:28:15 2017 -0800

--
 .../apache/phoenix/coprocessor/BaseScannerRegionObserver.java   | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/9d8be0e9/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/BaseScannerRegionObserver.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/BaseScannerRegionObserver.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/BaseScannerRegionObserver.java
index 519e419..316a286 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/BaseScannerRegionObserver.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/BaseScannerRegionObserver.java
@@ -366,7 +366,10 @@ abstract public class BaseScannerRegionObserver extends 
BaseRegionObserver {
   if (scan.isRaw() || ScanInfoUtil.isKeepDeletedCells(store.getScanInfo()) 
|| scan.getTimeRange().getMax() == HConstants.LATEST_TIMESTAMP || 
TransactionUtil.isTransactionalTimestamp(scan.getTimeRange().getMax())) {
 return s;
   }
-
+  
+  if (s!=null) {
+  s.close();
+  }
   ScanInfo scanInfo = 
ScanInfoUtil.cloneScanInfoWithKeepDeletedCells(store.getScanInfo());
   return new StoreScanner(store, scanInfo, scan, targetCols,
   
c.getEnvironment().getRegion().getReadpoint(scan.getIsolationLevel()));



[11/50] [abbrv] phoenix git commit: PHOENIX-4361: Remove redundant argument in separateAndValidateProperties in CQSI

2018-01-19 Thread tdsilva
PHOENIX-4361: Remove redundant argument in separateAndValidateProperties in CQSI

Signed-off-by: aertoria 


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

Branch: refs/heads/system-catalog
Commit: ddd3ef28d36f963b295cef74db372f13040ea22a
Parents: ef3bce1
Author: Chinmay Kulkarni 
Authored: Wed Nov 15 18:31:20 2017 -0800
Committer: aertoria 
Committed: Fri Nov 17 11:26:00 2017 -0800

--
 .../org/apache/phoenix/query/ConnectionQueryServicesImpl.java   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/ddd3ef28/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
index f8f8501..7a255a1 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
@@ -1722,7 +1722,7 @@ public class ConnectionQueryServicesImpl extends 
DelegateQueryServices implement
 Set tableDescriptors = Collections.emptySet();
 Set origTableDescriptors = Collections.emptySet();
 boolean nonTxToTx = false;
-Pair tableDescriptorPair = 
separateAndValidateProperties(table, stmtProperties, 
colFamiliesForPColumnsToBeAdded, families, tableProps);
+Pair tableDescriptorPair = 
separateAndValidateProperties(table, stmtProperties, 
colFamiliesForPColumnsToBeAdded, tableProps);
 HTableDescriptor tableDescriptor = tableDescriptorPair.getSecond();
 HTableDescriptor origTableDescriptor = tableDescriptorPair.getFirst();
 if (tableDescriptor != null) {
@@ -1940,7 +1940,8 @@ public class ConnectionQueryServicesImpl extends 
DelegateQueryServices implement
 this.addCoprocessors(tableDescriptor.getName(), tableDescriptor, 
tableType, tableProps);
 }
 
-private Pair 
separateAndValidateProperties(PTable table, Map>> properties, Set colFamiliesForPColumnsToBeAdded, 
List>> families, Map 
tableProps) throws SQLException {
+private Pair 
separateAndValidateProperties(PTable table, Map>> properties,
+  Set colFamiliesForPColumnsToBeAdded, Map 
tableProps) throws SQLException {
 Map> stmtFamiliesPropsMap = new 
HashMap<>(properties.size());
 Map commonFamilyProps = new HashMap<>();
 boolean addingColumns = colFamiliesForPColumnsToBeAdded != null && 
!colFamiliesForPColumnsToBeAdded.isEmpty();



[27/50] [abbrv] phoenix git commit: PHOENIX-4415 Ignore CURRENT_SCN property if set in Pig Storer

2018-01-19 Thread tdsilva
PHOENIX-4415 Ignore CURRENT_SCN property if set in Pig Storer


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

Branch: refs/heads/system-catalog
Commit: d6e61af807f7a4e605c61217bac556ffe00ea237
Parents: 1c3387d
Author: James Taylor 
Authored: Thu Dec 7 19:13:25 2017 -0800
Committer: James Taylor 
Committed: Thu Dec 7 19:13:25 2017 -0800

--
 .../phoenix/mapreduce/PhoenixOutputFormat.java  | 13 ++-
 .../phoenix/mapreduce/PhoenixRecordWriter.java  |  8 ++-
 .../phoenix/mapreduce/util/ConnectionUtil.java  | 23 
 .../org/apache/phoenix/util/PropertiesUtil.java |  9 +++-
 .../java/org/apache/phoenix/pig/BasePigIT.java  |  4 
 .../apache/phoenix/pig/PhoenixHBaseStorage.java | 12 ++
 6 files changed, 58 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d6e61af8/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixOutputFormat.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixOutputFormat.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixOutputFormat.java
index e55b977..4217e40 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixOutputFormat.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixOutputFormat.java
@@ -19,6 +19,8 @@ package org.apache.phoenix.mapreduce;
 
 import java.io.IOException;
 import java.sql.SQLException;
+import java.util.Collections;
+import java.util.Set;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -36,6 +38,15 @@ import org.apache.hadoop.mapreduce.lib.db.DBWritable;
  */
 public class PhoenixOutputFormat  extends 
OutputFormat {
 private static final Log LOG = 
LogFactory.getLog(PhoenixOutputFormat.class);
+private final Set propsToIgnore;
+
+public PhoenixOutputFormat() {
+this(Collections.emptySet());
+}
+
+public PhoenixOutputFormat(Set propsToIgnore) {
+this.propsToIgnore = propsToIgnore;
+}
 
 @Override
 public void checkOutputSpecs(JobContext jobContext) throws IOException, 
InterruptedException {  
@@ -52,7 +63,7 @@ public class PhoenixOutputFormat  
extends OutputFormat getRecordWriter(TaskAttemptContext 
context) throws IOException, InterruptedException {
 try {
-return new PhoenixRecordWriter(context.getConfiguration());
+return new PhoenixRecordWriter(context.getConfiguration(), 
propsToIgnore);
 } catch (SQLException e) {
 LOG.error("Error calling PhoenixRecordWriter "  + e.getMessage());
 throw new RuntimeException(e);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d6e61af8/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixRecordWriter.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixRecordWriter.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixRecordWriter.java
index 70ee3f5..52f2fe3 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixRecordWriter.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixRecordWriter.java
@@ -21,6 +21,8 @@ import java.io.IOException;
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
+import java.util.Collections;
+import java.util.Set;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -46,7 +48,11 @@ public class PhoenixRecordWriter  
extends RecordWriteremptySet());
+}
+
+public PhoenixRecordWriter(final Configuration configuration, Set 
propsToIgnore) throws SQLException {
+this.conn = 
ConnectionUtil.getOutputConnectionWithoutTheseProps(configuration, 
propsToIgnore);
 this.batchSize = PhoenixConfigurationUtil.getBatchSize(configuration);
 final String upsertQuery = 
PhoenixConfigurationUtil.getUpsertStatement(configuration);
 this.statement = this.conn.prepareStatement(upsertQuery);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d6e61af8/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/ConnectionUtil.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/ConnectionUtil.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/ConnectionUtil.java
index 

[29/50] [abbrv] phoenix git commit: PHOENIX-4424 Allow users to create "DEFAULT" and "HBASE" Schema (Uppercase Schema Names)

2018-01-19 Thread tdsilva
PHOENIX-4424 Allow users to create "DEFAULT" and "HBASE" Schema (Uppercase 
Schema Names)


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

Branch: refs/heads/system-catalog
Commit: c075a17879309fe4def5a621951d72929fb10c3a
Parents: 72bc819
Author: Karan Mehta 
Authored: Mon Dec 4 10:44:13 2017 -0800
Committer: Thomas D'Silva 
Committed: Fri Dec 8 14:52:33 2017 -0800

--
 .../phoenix/end2end/ChangePermissionsIT.java|  5 +-
 .../apache/phoenix/end2end/CreateSchemaIT.java  | 64 ++--
 phoenix-core/src/main/antlr3/PhoenixSQL.g   |  2 +-
 .../phoenix/parse/CreateSchemaStatement.java|  2 +-
 .../apache/phoenix/query/QueryConstants.java|  1 -
 .../apache/phoenix/schema/MetaDataClient.java   |  8 ++-
 .../org/apache/phoenix/util/SchemaUtil.java |  5 +-
 .../apache/phoenix/parse/QueryParserTest.java   | 13 
 8 files changed, 73 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/c075a178/phoenix-core/src/it/java/org/apache/phoenix/end2end/ChangePermissionsIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ChangePermissionsIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ChangePermissionsIT.java
index c023440..2bf7fe1 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ChangePermissionsIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ChangePermissionsIT.java
@@ -23,6 +23,7 @@ import org.apache.hadoop.hbase.security.User;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.query.QueryConstants;
 import org.apache.phoenix.schema.TableNotFoundException;
+import org.apache.phoenix.util.SchemaUtil;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -144,7 +145,7 @@ public class ChangePermissionsIT extends BasePermissionsIT {
 verifyAllowed(createSchema(SCHEMA_NAME), superUser1);
 verifyAllowed(grantPermissions("C", regularUser1, SCHEMA_NAME, 
true), superUser1);
 } else {
-verifyAllowed(grantPermissions("C", regularUser1, "\"" + 
QueryConstants.HBASE_DEFAULT_SCHEMA_NAME + "\"", true), superUser1);
+verifyAllowed(grantPermissions("C", regularUser1, "\"" + 
SchemaUtil.SCHEMA_FOR_DEFAULT_NAMESPACE + "\"", true), superUser1);
 }
 
 // Create new table. Create indexes, views and view indexes on top of 
it. Verify the contents by querying it
@@ -235,7 +236,7 @@ public class ChangePermissionsIT extends BasePermissionsIT {
 verifyAllowed(createSchema(SCHEMA_NAME), superUser1);
 verifyAllowed(grantPermissions("C", regularUser1, SCHEMA_NAME, 
true), superUser1);
 } else {
-verifyAllowed(grantPermissions("C", regularUser1, "\"" + 
QueryConstants.HBASE_DEFAULT_SCHEMA_NAME + "\"", true), superUser1);
+verifyAllowed(grantPermissions("C", regularUser1, "\"" + 
SchemaUtil.SCHEMA_FOR_DEFAULT_NAMESPACE + "\"", true), superUser1);
 }
 
 // Create MultiTenant Table (View Index Table should be automatically 
created)

http://git-wip-us.apache.org/repos/asf/phoenix/blob/c075a178/phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateSchemaIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateSchemaIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateSchemaIT.java
index fe09dcd..8002dc1 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateSchemaIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateSchemaIT.java
@@ -43,31 +43,61 @@ public class CreateSchemaIT extends ParallelStatsDisabledIT 
{
 Properties props = PropertiesUtil.deepCopy(TestUtil.TEST_PROPERTIES);
 props.setProperty(QueryServices.IS_NAMESPACE_MAPPING_ENABLED, 
Boolean.toString(true));
 String schemaName = generateUniqueName();
-String ddl = "CREATE SCHEMA " + schemaName;
+String schemaName1 = schemaName.toLowerCase();
+String schemaName2 = schemaName.toLowerCase();
+// Create unique name schema and verify that it exists
+// ddl1 should create lowercase schemaName since it is passed in with 
double-quotes
+// ddl2 should create uppercase schemaName since Phoenix upper-cases 
identifiers without quotes
+// Both the statements should succeed
+String ddl1 = "CREATE SCHEMA \"" + schemaName1 + "\"";
+String ddl2 = "CREATE SCHEMA " + 

[33/50] [abbrv] phoenix git commit: PHOENIX-4449 Bundle a copy of Argparse-1.4.0 for installations that need it

2018-01-19 Thread tdsilva
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5cb02da7/bin/sqlline-thin.py
--
diff --git a/bin/sqlline-thin.py b/bin/sqlline-thin.py
index 47384d8..fecc96c 100755
--- a/bin/sqlline-thin.py
+++ b/bin/sqlline-thin.py
@@ -25,7 +25,14 @@ import sys
 import phoenix_utils
 import atexit
 import urlparse
-import argparse
+
+# import argparse
+try:
+import argparse
+except ImportError:
+current_dir = os.path.dirname(os.path.abspath(__file__))
+sys.path.append(os.path.join(current_dir, 'argparse-1.4.0'))
+import argparse
 
 global childProc
 childProc = None

http://git-wip-us.apache.org/repos/asf/phoenix/blob/5cb02da7/bin/sqlline.py
--
diff --git a/bin/sqlline.py b/bin/sqlline.py
index 7a724de..4a676ee 100755
--- a/bin/sqlline.py
+++ b/bin/sqlline.py
@@ -24,7 +24,14 @@ import subprocess
 import sys
 import phoenix_utils
 import atexit
-import argparse
+
+# import argparse
+try:
+import argparse
+except ImportError:
+current_dir = os.path.dirname(os.path.abspath(__file__))
+sys.path.append(os.path.join(current_dir, 'argparse-1.4.0'))
+import argparse
 
 global childProc
 childProc = None
@@ -39,8 +46,9 @@ atexit.register(kill_child)
 phoenix_utils.setPath()
 
 parser = argparse.ArgumentParser(description='Launches the Apache Phoenix 
Client.')
-# Positional argument 'zookeepers' is optional
-parser.add_argument('zookeepers', nargs='?', help='The ZooKeeper quorum 
string', default='localhost:2181:/hbase')
+# Positional argument 'zookeepers' is optional. The PhoenixDriver will 
automatically populate
+# this if it's not provided by the user (so, we want to leave a default value 
of empty)
+parser.add_argument('zookeepers', nargs='?', help='The ZooKeeper quorum 
string', default='')
 # Positional argument 'sqlfile' is optional
 parser.add_argument('sqlfile', nargs='?', help='A file of SQL commands to 
execute', default='')
 # Common arguments across sqlline.py and sqlline-thin.py



[19/50] [abbrv] phoenix git commit: PHOENIX-672 Add GRANT and REVOKE commands using HBase AccessController

2018-01-19 Thread tdsilva
http://git-wip-us.apache.org/repos/asf/phoenix/blob/88038a2d/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
index 971383b..8666bb8 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
@@ -16,144 +16,53 @@
  */
 package org.apache.phoenix.end2end;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.IOException;
-import java.lang.reflect.UndeclaredThrowableException;
 import java.security.PrivilegedExceptionAction;
 import java.sql.Connection;
-import java.sql.DriverManager;
-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.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.AuthUtil;
-import org.apache.hadoop.hbase.HBaseTestingUtility;
-import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.NamespaceDescriptor;
-import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.security.AccessDeniedException;
 import org.apache.hadoop.hbase.security.access.AccessControlClient;
 import org.apache.hadoop.hbase.security.access.Permission.Action;
-import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.hadoop.security.UserGroupInformation;
-import org.apache.phoenix.exception.PhoenixIOException;
-import org.apache.phoenix.query.QueryServices;
-import org.apache.phoenix.util.MetaDataUtil;
 import org.apache.phoenix.util.SchemaUtil;
-import org.junit.After;
-import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-
-import com.google.common.collect.Maps;
 
 /**
  * Test that verifies a user can read Phoenix tables with a minimal set of 
permissions.
  */
 @Category(NeedsOwnMiniClusterTest.class)
-@RunWith(Parameterized.class)
-public class TableDDLPermissionsIT{
-private static String SUPERUSER;
-
-private static HBaseTestingUtility testUtil;
-
-private static final Set PHOENIX_SYSTEM_TABLES = new 
HashSet<>(Arrays.asList(
-"SYSTEM.CATALOG", "SYSTEM.SEQUENCE", "SYSTEM.STATS", 
"SYSTEM.FUNCTION",
-"SYSTEM.MUTEX"));
-// PHOENIX- SYSTEM.MUTEX isn't being created in the SYSTEM namespace 
as it should be.
-private static final Set PHOENIX_NAMESPACE_MAPPED_SYSTEM_TABLES = 
new HashSet<>(
-Arrays.asList("SYSTEM:CATALOG", "SYSTEM:SEQUENCE", "SYSTEM:STATS", 
"SYSTEM:FUNCTION",
-"SYSTEM.MUTEX"));
-private static final String GROUP_SYSTEM_ACCESS = "group_system_access";
-final UserGroupInformation superUser = 
UserGroupInformation.createUserForTesting(SUPERUSER, new String[0]);
-final UserGroupInformation superUser2 = 
UserGroupInformation.createUserForTesting("superuser", new String[0]);
-final UserGroupInformation regularUser = 
UserGroupInformation.createUserForTesting("user",  new String[0]);
-final UserGroupInformation groupUser = 
UserGroupInformation.createUserForTesting("user2", new String[] { 
GROUP_SYSTEM_ACCESS });
-final UserGroupInformation unprivilegedUser = 
UserGroupInformation.createUserForTesting("unprivilegedUser",
-new String[0]);
-
+public class TableDDLPermissionsIT extends BasePermissionsIT {
 
-private static final int NUM_RECORDS = 5;
-
-private boolean isNamespaceMapped;
-
-public TableDDLPermissionsIT(final boolean isNamespaceMapped) throws 
Exception {
-this.isNamespaceMapped = isNamespaceMapped;
-Map clientProps = Maps.newHashMapWithExpectedSize(1);
-clientProps.put(QueryServices.IS_NAMESPACE_MAPPING_ENABLED, "true");
+public TableDDLPermissionsIT(boolean isNamespaceMapped) throws Exception {
+super(isNamespaceMapped);
 }
 
-private void startNewMiniCluster(Configuration overrideConf) throws 
Exception{
-if (null != testUtil) {
-testUtil.shutdownMiniCluster();
-testUtil = null;
-}
-testUtil = new HBaseTestingUtility();
-
-Configuration config = testUtil.getConfiguration();
-
-config.set("hbase.coprocessor.master.classes",
-

[28/50] [abbrv] phoenix git commit: PHOENIX-4397 Incorrect query results when with stats are disabled on a salted table

2018-01-19 Thread tdsilva
PHOENIX-4397 Incorrect query results when with stats are disabled on a salted 
table


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

Branch: refs/heads/system-catalog
Commit: 72bc8190272480fae17475398ef492a3071a3a44
Parents: d6e61af
Author: Samarth Jain 
Authored: Fri Dec 8 14:40:22 2017 -0800
Committer: Samarth Jain 
Committed: Fri Dec 8 14:40:22 2017 -0800

--
 .../end2end/ExplainPlanWithStatsEnabledIT.java  | 36 
 .../phoenix/iterate/BaseResultIterators.java|  6 +---
 2 files changed, 37 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/72bc8190/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExplainPlanWithStatsEnabledIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExplainPlanWithStatsEnabledIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExplainPlanWithStatsEnabledIT.java
index bfc6819..49efa97 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExplainPlanWithStatsEnabledIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExplainPlanWithStatsEnabledIT.java
@@ -1068,4 +1068,40 @@ public class ExplainPlanWithStatsEnabledIT extends 
ParallelStatsEnabledIT {
 .getQueryPlan().getScans().get(0).size());
 }
 }
+
+@Test
+public void testQueryingWithUseStatsForParallelizationOnOff() throws 
SQLException {
+testUseStatsForParallelizationOnSaltedTable(true, true);
+testUseStatsForParallelizationOnSaltedTable(true, false);
+testUseStatsForParallelizationOnSaltedTable(false, true);
+testUseStatsForParallelizationOnSaltedTable(false, false);
+}
+
+private void testUseStatsForParallelizationOnSaltedTable(boolean 
useStatsFlag, boolean salted)
+throws SQLException {
+String tableName = generateUniqueName();
+Connection conn = DriverManager.getConnection(getUrl());
+conn.createStatement().execute(
+"create table " + tableName + "(k varchar not null primary key, v 
varchar) "
++ (salted ? " SALT_BUCKETS=2," : "") + " 
USE_STATS_FOR_PARALLELIZATION="
++ useStatsFlag);
+conn.createStatement().execute("upsert into " + tableName + " values 
('1', 'B')");
+conn.createStatement().execute("upsert into " + tableName + " values 
('2', 'A')");
+conn.commit();
+String query = "SELECT V FROM " + tableName + " ORDER BY V";
+ResultSet rs = conn.createStatement().executeQuery(query);
+assertTrue(rs.next());
+assertEquals("A", rs.getString(1));
+assertTrue(rs.next());
+assertEquals("B", rs.getString(1));
+
+// Collect stats and make sure query still works correctly
+conn.createStatement().execute("UPDATE STATISTICS " + tableName);
+rs = conn.createStatement().executeQuery(query);
+assertTrue(rs.next());
+assertEquals("A", rs.getString(1));
+assertTrue(rs.next());
+assertEquals("B", rs.getString(1));
+}
+
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/72bc8190/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
 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
index eb09813..bd67fa8 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
@@ -607,11 +607,7 @@ public abstract class BaseResultIterators extends 
ExplainTable implements Result
 estimate.bytesEstimate += gpsBytes;
 }
 }
-if (startNewScan && !scans.isEmpty() && useStatsForParallelization) {
-/*
- * Note that even if region boundary was crossed, if we are not 
using stats for
- * parallelization, nothing gets added to the parallel scans.
- */
+if (startNewScan && !scans.isEmpty()) {
 parallelScans.add(scans);
 scans = Lists.newArrayListWithExpectedSize(1);
 }



[02/50] [abbrv] phoenix git commit: PHOENIX-4198 Remove the need for users to have access to the Phoenix SYSTEM tables to create tables

2018-01-19 Thread tdsilva
PHOENIX-4198 Remove the need for users to have access to the Phoenix SYSTEM 
tables to create tables


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

Branch: refs/heads/system-catalog
Commit: 217867c78108b29d991794726c01c1eefb49b828
Parents: 4a1f0df
Author: Ankit Singhal 
Authored: Thu Nov 9 11:27:11 2017 +0530
Committer: Ankit Singhal 
Committed: Thu Nov 9 11:27:11 2017 +0530

--
 .../phoenix/end2end/TableDDLPermissionsIT.java  | 692 +++
 .../org/apache/hadoop/hbase/ipc/RpcUtil.java|  32 +
 .../BaseMetaDataEndpointObserver.java   | 111 +++
 .../coprocessor/MetaDataEndpointImpl.java   | 339 +++--
 .../coprocessor/MetaDataEndpointObserver.java   |  68 ++
 .../coprocessor/MetaDataRegionObserver.java |  17 +-
 .../coprocessor/PhoenixAccessController.java| 628 +
 .../PhoenixMetaDataCoprocessorHost.java | 236 +++
 .../index/PhoenixIndexFailurePolicy.java| 109 +--
 .../query/ConnectionQueryServicesImpl.java  |  15 +-
 .../org/apache/phoenix/query/QueryServices.java |   4 +
 .../phoenix/query/QueryServicesOptions.java |  14 +-
 .../phoenix/schema/stats/StatisticsWriter.java  |  42 +-
 .../org/apache/phoenix/util/MetaDataUtil.java   |  18 +
 .../org/apache/phoenix/util/SchemaUtil.java |  12 +
 15 files changed, 2196 insertions(+), 141 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/217867c7/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
new file mode 100644
index 000..971383b
--- /dev/null
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
@@ -0,0 +1,692 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.lang.reflect.UndeclaredThrowableException;
+import java.security.PrivilegedExceptionAction;
+import java.sql.Connection;
+import java.sql.DriverManager;
+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.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.AuthUtil;
+import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.NamespaceDescriptor;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.security.AccessDeniedException;
+import org.apache.hadoop.hbase.security.access.AccessControlClient;
+import org.apache.hadoop.hbase.security.access.Permission.Action;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.apache.phoenix.exception.PhoenixIOException;
+import org.apache.phoenix.query.QueryServices;
+import org.apache.phoenix.util.MetaDataUtil;
+import org.apache.phoenix.util.SchemaUtil;
+import org.junit.After;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import 

[45/50] [abbrv] phoenix git commit: PHOENIX-4473 Exception when Adding new columns to base table and view diverge (addendum)

2018-01-19 Thread tdsilva
PHOENIX-4473 Exception when Adding new columns to base table and view diverge 
(addendum)


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

Branch: refs/heads/system-catalog
Commit: f7142879f33cae236e0530a8ed4eeaad1542d66a
Parents: ae21f87
Author: Thomas D'Silva 
Authored: Thu Dec 28 15:34:22 2017 -0800
Committer: Thomas D'Silva 
Committed: Thu Dec 28 15:35:53 2017 -0800

--
 .../java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f7142879/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
index 18b1ee5..47ad7cf 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
@@ -3077,7 +3077,7 @@ public class MetaDataEndpointImpl extends 
MetaDataProtocol implements Coprocesso
 PhoenixDatabaseMetaData.ORDINAL_POSITION_BYTES, 
ordinalPositionBytes);
 
 // New PK columns have to be nullable after the first DDL
-byte[] isNullableBytes = 
PBoolean.INSTANCE.toBytes(ResultSetMetaData.columnNullable);
+byte[] isNullableBytes = 
PInteger.INSTANCE.toBytes(ResultSetMetaData.columnNullable);
 
indexColumnDefinitionPut.add(PhoenixDatabaseMetaData.TABLE_FAMILY_BYTES,
 PhoenixDatabaseMetaData.NULLABLE_BYTES, 
isNullableBytes);
 



[12/50] [abbrv] phoenix git commit: PHOENIX-4386 Calculate the estimatedSize of MutationState using Map<TableRef, Map<ImmutableBytesPtr, RowMutationState>> mutations

2018-01-19 Thread tdsilva
PHOENIX-4386 Calculate the estimatedSize of MutationState using Map> mutations


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

Branch: refs/heads/system-catalog
Commit: 4944081ec093204a859d8c9ba57606e4e59bd0fb
Parents: ddd3ef2
Author: Thomas D'Silva 
Authored: Fri Nov 17 11:11:43 2017 -0800
Committer: Thomas D'Silva 
Committed: Fri Nov 17 15:43:58 2017 -0800

--
 .../apache/phoenix/end2end/MutationStateIT.java | 144 +++
 .../org/apache/phoenix/end2end/QueryMoreIT.java |  42 --
 .../apache/phoenix/compile/DeleteCompiler.java  |   6 +-
 .../apache/phoenix/compile/UpsertCompiler.java  |   4 +-
 .../apache/phoenix/execute/MutationState.java   |  50 +--
 .../org/apache/phoenix/util/KeyValueUtil.java   |  51 ++-
 6 files changed, 201 insertions(+), 96 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/4944081e/phoenix-core/src/it/java/org/apache/phoenix/end2end/MutationStateIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/MutationStateIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/MutationStateIT.java
new file mode 100644
index 000..2d5f360
--- /dev/null
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/MutationStateIT.java
@@ -0,0 +1,144 @@
+package org.apache.phoenix.end2end;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.Properties;
+
+import org.apache.phoenix.exception.SQLExceptionCode;
+import org.apache.phoenix.execute.MutationState;
+import org.apache.phoenix.jdbc.PhoenixConnection;
+import org.apache.phoenix.query.QueryServices;
+import org.junit.Test;
+
+public class MutationStateIT extends ParallelStatsDisabledIT {
+
+private static final String DDL =
+" (ORGANIZATION_ID CHAR(15) NOT NULL, SCORE DOUBLE, "
++ "ENTITY_ID CHAR(15) NOT NULL, TAGS VARCHAR, CONSTRAINT 
PAGE_SNAPSHOT_PK "
++ "PRIMARY KEY (ORGANIZATION_ID, ENTITY_ID DESC)) 
MULTI_TENANT=TRUE";
+
+private void upsertRows(PhoenixConnection conn, String fullTableName) 
throws SQLException {
+PreparedStatement stmt =
+conn.prepareStatement("upsert into " + fullTableName
++ " (organization_id, entity_id, score) values 
(?,?,?)");
+for (int i = 0; i < 1; i++) {
+stmt.setString(1, "" + i);
+stmt.setString(2, "" + i);
+stmt.setInt(3, 1);
+stmt.execute();
+}
+}
+
+@Test
+public void testMaxMutationSize() throws Exception {
+Properties connectionProperties = new Properties();
+
connectionProperties.setProperty(QueryServices.MAX_MUTATION_SIZE_ATTRIB, "3");
+
connectionProperties.setProperty(QueryServices.MAX_MUTATION_SIZE_BYTES_ATTRIB, 
"100");
+PhoenixConnection connection =
+(PhoenixConnection) DriverManager.getConnection(getUrl(), 
connectionProperties);
+String fullTableName = generateUniqueName();
+try (Statement stmt = connection.createStatement()) {
+stmt.execute(
+"CREATE TABLE " + fullTableName + DDL);
+}
+try {
+upsertRows(connection, fullTableName);
+fail();
+} catch (SQLException e) {
+
assertEquals(SQLExceptionCode.MAX_MUTATION_SIZE_EXCEEDED.getErrorCode(),
+e.getErrorCode());
+}
+
+// set the max mutation size (bytes) to a low value
+
connectionProperties.setProperty(QueryServices.MAX_MUTATION_SIZE_ATTRIB, 
"1000");
+
connectionProperties.setProperty(QueryServices.MAX_MUTATION_SIZE_BYTES_ATTRIB, 
"4");
+connection =
+(PhoenixConnection) DriverManager.getConnection(getUrl(), 
connectionProperties);
+try {
+upsertRows(connection, fullTableName);
+fail();
+} catch (SQLException e) {
+
assertEquals(SQLExceptionCode.MAX_MUTATION_SIZE_BYTES_EXCEEDED.getErrorCode(),
+e.getErrorCode());
+}
+}
+
+@Test
+public void testMutationEstimatedSize() throws Exception {
+PhoenixConnection conn = (PhoenixConnection) 
DriverManager.getConnection(getUrl());
+conn.setAutoCommit(false);
+String fullTableName = 

[43/50] [abbrv] phoenix git commit: Immutable table SINGLE_CELL_ARRAY_WITH_OFFSETS values starting with separator byte return null in query results

2018-01-19 Thread tdsilva
Immutable table SINGLE_CELL_ARRAY_WITH_OFFSETS values starting with separator 
byte return null in query results


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

Branch: refs/heads/system-catalog
Commit: edc9d12dc056640526e388d7ccb1a6e2c6d3c51c
Parents: 2759727
Author: Vincent Poon 
Authored: Wed Dec 27 15:34:32 2017 -0800
Committer: Vincent Poon 
Committed: Wed Dec 27 15:34:32 2017 -0800

--
 .../apache/phoenix/end2end/StoreNullsIT.java|   6 +-
 .../phoenix/end2end/UpsertBigValuesIT.java  |  64 -
 .../phoenix/end2end/index/DropColumnIT.java |  19 +-
 .../phoenix/compile/ProjectionCompiler.java |   6 +-
 .../expression/SingleCellColumnExpression.java  |  35 ++-
 .../apache/phoenix/index/IndexMaintainer.java   |   2 +-
 .../NonAggregateRegionScannerFactory.java   |   2 +-
 .../org/apache/phoenix/schema/ColumnRef.java|   4 +-
 .../java/org/apache/phoenix/schema/PTable.java  |  21 +-
 .../phoenix/schema/types/PArrayDataType.java|  18 +-
 .../schema/types/PArrayDataTypeDecoder.java |  79 +-
 .../schema/types/PArrayDataTypeEncoder.java |  10 +-
 .../java/org/apache/phoenix/util/IndexUtil.java |   3 +-
 .../schema/ImmutableStorageSchemeTest.java  | 241 +--
 14 files changed, 452 insertions(+), 58 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/edc9d12d/phoenix-core/src/it/java/org/apache/phoenix/end2end/StoreNullsIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/StoreNullsIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/StoreNullsIT.java
index 378a9ed..d1aee9f 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/StoreNullsIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/StoreNullsIT.java
@@ -145,7 +145,11 @@ public class StoreNullsIT extends ParallelStatsDisabledIT {
 byte[] qualifier = table.getImmutableStorageScheme()== 
ImmutableStorageScheme.SINGLE_CELL_ARRAY_WITH_OFFSETS ? 
QueryConstants.SINGLE_KEYVALUE_COLUMN_QUALIFIER_BYTES : 
nameColumn.getColumnQualifierBytes();
 
assertTrue(rs.containsColumn(QueryConstants.DEFAULT_COLUMN_FAMILY_BYTES, 
qualifier));
 assertTrue(rs.size() == 2); // 2 because it also includes the empty 
key value column
-KeyValueColumnExpression colExpression = 
table.getImmutableStorageScheme() == 
ImmutableStorageScheme.SINGLE_CELL_ARRAY_WITH_OFFSETS ? new 
SingleCellColumnExpression(nameColumn, "NAME", table.getEncodingScheme()) : new 
KeyValueColumnExpression(nameColumn);
+KeyValueColumnExpression colExpression =
+table.getImmutableStorageScheme() == 
ImmutableStorageScheme.SINGLE_CELL_ARRAY_WITH_OFFSETS
+? new SingleCellColumnExpression(nameColumn, "NAME",
+table.getEncodingScheme(), 
table.getImmutableStorageScheme())
+: new KeyValueColumnExpression(nameColumn);
 ImmutableBytesPtr ptr = new ImmutableBytesPtr();
 colExpression.evaluate(new ResultTuple(rs), ptr);
 assertEquals(new ImmutableBytesPtr(PVarchar.INSTANCE.toBytes("v1")), 
ptr);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/edc9d12d/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertBigValuesIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertBigValuesIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertBigValuesIT.java
index ceb76d0..9842434 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertBigValuesIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertBigValuesIT.java
@@ -25,10 +25,16 @@ import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
+import java.util.Arrays;
+import java.util.List;
 import java.util.Properties;
 
+import org.apache.phoenix.schema.types.PDataType;
+import org.apache.phoenix.schema.types.PLong;
+import org.apache.phoenix.schema.types.PSmallint;
 import org.junit.Test;
 
+import com.google.common.collect.Lists;
 
 public class UpsertBigValuesIT extends ParallelStatsDisabledIT {
 
@@ -374,4 +380,60 @@ public class UpsertBigValuesIT extends 
ParallelStatsDisabledIT {
 */
 conn.close();
 }
-}
+
+@Test
+public void testShort() throws Exception {
+List testData =
+Arrays.asList(Short.MIN_VALUE, Short.MAX_VALUE, (short) 
(Short.MIN_VALUE + 1),
+

[34/50] [abbrv] phoenix git commit: PHOENIX-4449 Bundle a copy of Argparse-1.4.0 for installations that need it

2018-01-19 Thread tdsilva
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5cb02da7/bin/argparse-1.4.0/argparse.py
--
diff --git a/bin/argparse-1.4.0/argparse.py b/bin/argparse-1.4.0/argparse.py
new file mode 100644
index 000..70a77cc
--- /dev/null
+++ b/bin/argparse-1.4.0/argparse.py
@@ -0,0 +1,2392 @@
+# Author: Steven J. Bethard .
+# Maintainer: Thomas Waldmann 
+
+"""Command-line parsing library
+
+This module is an optparse-inspired command-line parsing library that:
+
+- handles both optional and positional arguments
+- produces highly informative usage messages
+- supports parsers that dispatch to sub-parsers
+
+The following is a simple usage example that sums integers from the
+command-line and writes the result to a file::
+
+parser = argparse.ArgumentParser(
+description='sum the integers at the command line')
+parser.add_argument(
+'integers', metavar='int', nargs='+', type=int,
+help='an integer to be summed')
+parser.add_argument(
+'--log', default=sys.stdout, type=argparse.FileType('w'),
+help='the file where the sum should be written')
+args = parser.parse_args()
+args.log.write('%s' % sum(args.integers))
+args.log.close()
+
+The module contains the following public classes:
+
+- ArgumentParser -- The main entry point for command-line parsing. As the
+example above shows, the add_argument() method is used to populate
+the parser with actions for optional and positional arguments. Then
+the parse_args() method is invoked to convert the args at the
+command-line into an object with attributes.
+
+- ArgumentError -- The exception raised by ArgumentParser objects when
+there are errors with the parser's actions. Errors raised while
+parsing the command-line are caught by ArgumentParser and emitted
+as command-line messages.
+
+- FileType -- A factory for defining types of files to be created. As the
+example above shows, instances of FileType are typically passed as
+the type= argument of add_argument() calls.
+
+- Action -- The base class for parser actions. Typically actions are
+selected by passing strings like 'store_true' or 'append_const' to
+the action= argument of add_argument(). However, for greater
+customization of ArgumentParser actions, subclasses of Action may
+be defined and passed as the action= argument.
+
+- HelpFormatter, RawDescriptionHelpFormatter, RawTextHelpFormatter,
+ArgumentDefaultsHelpFormatter -- Formatter classes which
+may be passed as the formatter_class= argument to the
+ArgumentParser constructor. HelpFormatter is the default,
+RawDescriptionHelpFormatter and RawTextHelpFormatter tell the parser
+not to change the formatting for help text, and
+ArgumentDefaultsHelpFormatter adds information about argument defaults
+to the help.
+
+All other classes in this module are considered implementation details.
+(Also note that HelpFormatter and RawDescriptionHelpFormatter are only
+considered public as object names -- the API of the formatter objects is
+still considered an implementation detail.)
+"""
+
+__version__ = '1.4.0'  # we use our own version number independant of the
+   # one in stdlib and we release this on pypi.
+
+__external_lib__ = True  # to make sure the tests really test THIS lib,
+ # not the builtin one in Python stdlib
+
+__all__ = [
+'ArgumentParser',
+'ArgumentError',
+'ArgumentTypeError',
+'FileType',
+'HelpFormatter',
+'ArgumentDefaultsHelpFormatter',
+'RawDescriptionHelpFormatter',
+'RawTextHelpFormatter',
+'Namespace',
+'Action',
+'ONE_OR_MORE',
+'OPTIONAL',
+'PARSER',
+'REMAINDER',
+'SUPPRESS',
+'ZERO_OR_MORE',
+]
+
+
+import copy as _copy
+import os as _os
+import re as _re
+import sys as _sys
+import textwrap as _textwrap
+
+from gettext import gettext as _
+
+try:
+set
+except NameError:
+# for python < 2.4 compatibility (sets module is there since 2.3):
+from sets import Set as set
+
+try:
+basestring
+except NameError:
+basestring = str
+
+try:
+sorted
+except NameError:
+# for python < 2.4 compatibility:
+def sorted(iterable, reverse=False):
+result = list(iterable)
+result.sort()
+if reverse:
+result.reverse()
+return result
+
+
+def _callable(obj):
+return hasattr(obj, '__call__') or hasattr(obj, '__bases__')
+
+
+SUPPRESS = '==SUPPRESS=='
+
+OPTIONAL = '?'
+ZERO_OR_MORE = '*'
+ONE_OR_MORE = '+'
+PARSER = 'A...'
+REMAINDER = '...'
+_UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args'
+
+# =
+# Utility functions and classes
+# =
+
+class 

[09/50] [abbrv] phoenix git commit: PHOENIX-4379 Upgrade code to create CHILD links should only create the links for views and not for indexes

2018-01-19 Thread tdsilva
PHOENIX-4379 Upgrade code to create CHILD links should only create the links 
for views and not for indexes


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

Branch: refs/heads/system-catalog
Commit: 2053905683409225ffdc1c0ae4fc6c759604a80d
Parents: b2d5b4d
Author: Thomas D'Silva 
Authored: Tue Nov 14 15:28:01 2017 -0800
Committer: Thomas D'Silva 
Committed: Tue Nov 14 15:28:01 2017 -0800

--
 .../org/apache/phoenix/end2end/UpgradeIT.java   | 73 
 .../org/apache/phoenix/util/UpgradeUtil.java|  1 +
 2 files changed, 74 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/20539056/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 4cb4642..b71dd7c 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
@@ -39,12 +39,14 @@ import java.sql.SQLException;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Properties;
+import java.util.Set;
 import java.util.concurrent.Callable;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.FutureTask;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import org.apache.curator.shaded.com.google.common.collect.Sets;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTableInterface;
@@ -67,6 +69,7 @@ import org.apache.phoenix.schema.PMetaData;
 import org.apache.phoenix.schema.PName;
 import org.apache.phoenix.schema.PNameFactory;
 import org.apache.phoenix.schema.PTable;
+import org.apache.phoenix.schema.PTable.LinkType;
 import org.apache.phoenix.schema.PTableType;
 import org.apache.phoenix.util.MetaDataUtil;
 import org.apache.phoenix.util.PhoenixRuntime;
@@ -838,4 +841,74 @@ public class UpgradeIT extends ParallelStatsDisabledIT {
 return DriverManager.getConnection(getUrl());
 }
 
+@Test
+public void testAddParentChildLinks() throws Exception {
+String schema = "S_" + generateUniqueName();
+String table1 = "T_" + generateUniqueName();
+String table2 = "T_" + generateUniqueName();
+String tableName = SchemaUtil.getTableName(schema, table1);
+String multiTenantTableName = SchemaUtil.getTableName(schema, table2);
+String viewName1 = "VIEW_" + generateUniqueName();
+String viewIndexName1 = "VIDX_" + generateUniqueName();
+String viewName2 = "VIEW_" + generateUniqueName();
+String viewIndexName2 = "VIDX_" + generateUniqueName();
+try (Connection conn = getConnection(false, null);
+Connection tenantConn = getConnection(true, "tenant1");
+Connection metaConn = getConnection(false, null)) {
+// create a non multi-tenant and multi-tenant table
+conn.createStatement()
+.execute("CREATE TABLE IF NOT EXISTS " + tableName + " ("
++ " TENANT_ID CHAR(15) NOT NULL, " + " PK1 integer 
NOT NULL, "
++ "PK2 bigint NOT NULL, " + "V1 VARCHAR, " + "V2 
VARCHAR "
++ " CONSTRAINT NAME_PK PRIMARY KEY (TENANT_ID, 
PK1, PK2))");
+conn.createStatement()
+.execute("CREATE TABLE IF NOT EXISTS " + 
multiTenantTableName + " ("
++ " TENANT_ID CHAR(15) NOT NULL, " + " PK1 integer 
NOT NULL, "
++ "PK2 bigint NOT NULL, " + "V1 VARCHAR, " + "V2 
VARCHAR "
++ " CONSTRAINT NAME_PK PRIMARY KEY (TENANT_ID, 
PK1, PK2)"
++ " ) MULTI_TENANT= true");
+// create tenant and global view
+conn.createStatement().execute(
+"CREATE VIEW " + viewName1 + " (col VARCHAR) AS SELECT * FROM 
" + tableName);
+tenantConn.createStatement().execute("CREATE VIEW " + viewName2
++ "(col VARCHAR) AS SELECT * FROM " + 
multiTenantTableName);
+// create index on the above views
+conn.createStatement()
+.execute("create index " + viewIndexName1 + "  on " + 
viewName1 + "(col)");
+tenantConn.createStatement()
+.execute("create index " + 

[08/50] [abbrv] phoenix git commit: PHOENIX-4373 Local index variable length key can have trailing nulls while upserting

2018-01-19 Thread tdsilva
PHOENIX-4373 Local index variable length key can have trailing nulls while 
upserting


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

Branch: refs/heads/system-catalog
Commit: b2d5b4d75d4698981b291fecfac3efa3fb6e2649
Parents: 1d8a6bc
Author: Vincent Poon 
Authored: Tue Nov 14 10:47:46 2017 -0800
Committer: Vincent Poon 
Committed: Tue Nov 14 10:47:46 2017 -0800

--
 .../org/apache/phoenix/end2end/IndexToolIT.java | 40 
 .../org/apache/phoenix/compile/ScanRanges.java  | 11 --
 .../apache/phoenix/compile/UpsertCompiler.java  |  3 +-
 3 files changed, 50 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/b2d5b4d7/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexToolIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexToolIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexToolIT.java
index 913a147..a9128ab 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexToolIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexToolIT.java
@@ -209,6 +209,46 @@ public class IndexToolIT extends BaseTest {
 }
 }
 
+@Test
+public void testSaltedVariableLengthPK() throws Exception {
+String schemaName = generateUniqueName();
+String dataTableName = generateUniqueName();
+String dataTableFullName = SchemaUtil.getTableName(schemaName, 
dataTableName);
+String indexTableName = generateUniqueName();
+try (Connection conn =
+DriverManager.getConnection(getUrl(), 
PropertiesUtil.deepCopy(TEST_PROPERTIES))) {
+String dataDDL =
+"CREATE TABLE " + dataTableFullName + "(\n"
++ "ID VARCHAR NOT NULL PRIMARY KEY,\n"
++ "\"info\".CAR_NUM VARCHAR(18) NULL,\n"
++ "\"info\".CAP_DATE VARCHAR NULL,\n" + 
"\"info\".ORG_ID BIGINT NULL,\n"
++ "\"info\".ORG_NAME VARCHAR(255) NULL\n" + ") 
SALT_BUCKETS=3";
+conn.createStatement().execute(dataDDL);
+
+String upsert =
+"UPSERT INTO " + dataTableFullName
++ "(ID,CAR_NUM,CAP_DATE,ORG_ID,ORG_NAME) 
VALUES('1','car1','2016-01-01 00:00:00',11,'orgname1')";
+conn.createStatement().execute(upsert);
+conn.commit();
+
+String indexDDL =
+String.format(
+"CREATE %s INDEX %s on %s 
(\"info\".CAR_NUM,\"info\".CAP_DATE) ASYNC",
+(localIndex ? "LOCAL" : ""), indexTableName, 
dataTableFullName);
+conn.createStatement().execute(indexDDL);
+
+runIndexTool(directApi, useSnapshot, schemaName, dataTableName, 
indexTableName);
+
+ResultSet rs =
+conn.createStatement().executeQuery(
+"SELECT ORG_ID,CAP_DATE,CAR_NUM,ORG_NAME FROM " + 
dataTableFullName
++ " WHERE CAR_NUM='car1' AND 
CAP_DATE>='2016-01-01' AND CAP_DATE<='2016-05-02' LIMIT 10");
+assertTrue(rs.next());
+int orgId = rs.getInt(1);
+assertEquals(11, orgId);
+}
+}
+
 public static void assertExplainPlan(boolean localIndex, String 
actualExplainPlan,
 String dataTableFullName, String indexTableFullName) {
 String expectedExplainPlan;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/b2d5b4d7/phoenix-core/src/main/java/org/apache/phoenix/compile/ScanRanges.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/ScanRanges.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/ScanRanges.java
index 1b94cff..817c1bc 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/ScanRanges.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/ScanRanges.java
@@ -207,13 +207,18 @@ public class ScanRanges {
 }
 
 public static byte[] prefixKey(byte[] key, int keyOffset, byte[] 
prefixKey, int prefixKeyOffset) {
-if (key.length > 0) {
-byte[] newKey = new byte[key.length + prefixKeyOffset];
+return prefixKey(key, keyOffset, key.length, prefixKey, 
prefixKeyOffset);
+}
+
+public static byte[] prefixKey(byte[] key, int keyOffset, int keyLength, 
byte[] prefixKey,
+int prefixKeyOffset) {
+if (keyLength > 0) {
+  

[37/50] [abbrv] phoenix git commit: PHOENIX-4468 Looking up a parent index table of a child view from a different client fails

2018-01-19 Thread tdsilva
PHOENIX-4468 Looking up a parent index table of a child view from a different 
client fails


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

Branch: refs/heads/system-catalog
Commit: c935f57f5e7afb42ff8b62a4712ad7d8ffed17cc
Parents: 9d8be0e
Author: Thomas D'Silva 
Authored: Mon Dec 18 11:48:39 2017 -0800
Committer: Thomas D'Silva 
Committed: Wed Dec 20 10:41:12 2017 -0800

--
 .../apache/phoenix/end2end/PhoenixDriverIT.java | 160 +++
 .../org/apache/phoenix/end2end/SequenceIT.java  |  29 
 phoenix-core/src/main/antlr3/PhoenixSQL.g   |   1 +
 .../apache/phoenix/schema/MetaDataClient.java   |   4 +-
 .../org/apache/phoenix/schema/PTableImpl.java   |   2 +-
 .../org/apache/phoenix/util/PhoenixRuntime.java |  32 +++-
 6 files changed, 189 insertions(+), 39 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/c935f57f/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java
new file mode 100644
index 000..216653c
--- /dev/null
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Properties;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.HBaseConfiguration;
+import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.phoenix.jdbc.PhoenixDriver;
+import org.apache.phoenix.jdbc.PhoenixStatement;
+import org.apache.phoenix.query.QueryConstants;
+import org.apache.phoenix.query.QueryServices;
+import org.apache.phoenix.query.QueryServicesOptions;
+import org.apache.phoenix.schema.PTable;
+import org.apache.phoenix.util.PhoenixRuntime;
+import org.apache.phoenix.util.SchemaUtil;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class PhoenixDriverIT extends BaseUniqueNamesOwnClusterIT {
+
+private static HBaseTestingUtility hbaseTestUtil;
+private static String zkQuorum;
+
+@BeforeClass
+public static void setUp() throws Exception {
+Configuration conf = HBaseConfiguration.create();
+hbaseTestUtil = new HBaseTestingUtility(conf);
+setUpConfigForMiniCluster(conf);
+conf.set(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB, 
QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS);
+hbaseTestUtil.startMiniCluster();
+// establish url and quorum. Need to use PhoenixDriver and not 
PhoenixTestDriver
+zkQuorum = "localhost:" + hbaseTestUtil.getZkCluster().getClientPort();
+url = PhoenixRuntime.JDBC_PROTOCOL + 
PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum;
+DriverManager.registerDriver(PhoenixDriver.INSTANCE);
+}
+
+public Connection createConnection(boolean isMultiTenant, boolean 
isDifferentClient) throws SQLException {
+Properties props = new Properties();
+props.setProperty(QueryServices.RETURN_SEQUENCE_VALUES_ATTRIB, 
"false");
+// force the use of ConnectionQueryServicesImpl instead of 
ConnectionQueryServicesTestImpl
+props.put(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB,
+QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS);
+if (isMultiTenant)
+props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, "tenant1");
+StringBuilder sb 

[40/50] [abbrv] phoenix git commit: PHOENIX-4466 Relocate Avatica and hadoop-common in thin-client jar (Toshihiro Suzuki)

2018-01-19 Thread tdsilva
PHOENIX-4466 Relocate Avatica and hadoop-common in thin-client jar (Toshihiro 
Suzuki)

When using the thin-client in Spark, we encounter problems in that Spark
is placing its own version of avatica on the classpath as well. We can
relocate most of Avatica (all but the protobuf generated messages as
their classnames are required to be 'org.apache.calcite.avatica.proto'
presently) and hadoop-common to avoid future problems.


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

Branch: refs/heads/system-catalog
Commit: 34693843abe4490b54fbd30512bf7d98d0f59c0d
Parents: 412329a
Author: Josh Elser 
Authored: Fri Dec 22 13:28:12 2017 -0500
Committer: Josh Elser 
Committed: Fri Dec 22 13:28:12 2017 -0500

--
 phoenix-queryserver-client/pom.xml | 16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/34693843/phoenix-queryserver-client/pom.xml
--
diff --git a/phoenix-queryserver-client/pom.xml 
b/phoenix-queryserver-client/pom.xml
index 6c21cc7..486d89b 100644
--- a/phoenix-queryserver-client/pom.xml
+++ b/phoenix-queryserver-client/pom.xml
@@ -123,9 +123,19 @@
   
${shaded.package}.com.google.protobuf
 
 
-
+
+  org.apache.calcite.avatica
+  
${shaded.package}.org.apache.calcite.avatica
+  
+  
+org.apache.calcite.avatica.proto.*
+  
+
+
+  org.apache.hadoop
+  
${shaded.package}.org.apache.hadoop
+
 
   org.apache.commons
   
${shaded.package}.org.apache.commons



[46/50] [abbrv] phoenix git commit: use htable to process mutations that aren't on the current region server

2018-01-19 Thread tdsilva
use htable to process mutations that aren't on the current region server


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

Branch: refs/heads/system-catalog
Commit: 7b4ccaf7798956a75c0ff4df542ded5259172690
Parents: 39c0d1d
Author: Thomas D'Silva 
Authored: Thu Dec 28 20:12:29 2017 -0800
Committer: Thomas D'Silva 
Committed: Thu Dec 28 20:12:29 2017 -0800

--
 .../end2end/ExplainPlanWithStatsEnabledIT.java  |   2 +-
 .../phoenix/end2end/TableDDLPermissionsIT.java  |   2 +-
 .../coprocessor/MetaDataEndpointImpl.java   | 208 +--
 .../apache/phoenix/coprocessor/ViewFinder.java  |   9 +-
 .../coprocessor/MetaDataEndpointImplTest.java   |   4 +-
 5 files changed, 155 insertions(+), 70 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/7b4ccaf7/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExplainPlanWithStatsEnabledIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExplainPlanWithStatsEnabledIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExplainPlanWithStatsEnabledIT.java
index bfc6819..bcf8cd8 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExplainPlanWithStatsEnabledIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExplainPlanWithStatsEnabledIT.java
@@ -604,7 +604,7 @@ public class ExplainPlanWithStatsEnabledIT extends 
ParallelStatsEnabledIT {
 assertTrue(info.getEstimateInfoTs() > 0);
 
 conn.createStatement()
-.execute("ALTER TABLE " + viewName + " SET 
USE_STATS_FOR_PARALLELIZATION=true");
+.execute("ALTER VIEW " + viewName + " SET 
USE_STATS_FOR_PARALLELIZATION=true");
 sql = "SELECT COUNT(*) FROM " + viewName;
 // query the view
 rs = conn.createStatement().executeQuery(sql);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/7b4ccaf7/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
index 2e78cce..0130f35 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TableDDLPermissionsIT.java
@@ -167,7 +167,7 @@ public class TableDDLPermissionsIT{
 
 @Parameters(name = "isNamespaceMapped={0}") // name is used by failsafe as 
file name in reports
 public static Collection data() {
-return Arrays.asList(true/*, false*/);
+return Arrays.asList(true, false);
 }
 
 @BeforeClass

http://git-wip-us.apache.org/repos/asf/phoenix/blob/7b4ccaf7/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
index b9dbc20..cb08b2f 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
@@ -55,6 +55,7 @@ import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.MULTI_TENANT_BYTES
 import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.NULLABLE_BYTES;
 import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.NUM_ARGS_BYTES;
 import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.ORDINAL_POSITION_BYTES;
+import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.PARENT_TENANT_ID_BYTES;
 import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.PK_NAME_BYTES;
 import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.RETURN_TYPE_BYTES;
 import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SALT_BUCKETS_BYTES;
@@ -118,6 +119,7 @@ import org.apache.hadoop.hbase.client.HTableInterface;
 import org.apache.hadoop.hbase.client.Mutation;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Result;
+import org.apache.hadoop.hbase.client.ResultScanner;
 import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.coprocessor.CoprocessorException;
 import org.apache.hadoop.hbase.coprocessor.CoprocessorService;
@@ -2246,6 +2248,81 @@ public class MetaDataEndpointImpl 

[44/50] [abbrv] phoenix git commit: PHOENIX-4473 Exception when Adding new columns to base table and view diverge (Ankit Singhal)

2018-01-19 Thread tdsilva
PHOENIX-4473 Exception when Adding new columns to base table and view diverge 
(Ankit Singhal)


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

Branch: refs/heads/system-catalog
Commit: ae21f87338de5c80efd8e89b256415faad0e00a3
Parents: edc9d12
Author: Thomas D'Silva 
Authored: Thu Dec 28 11:22:26 2017 -0800
Committer: Thomas D'Silva 
Committed: Thu Dec 28 11:22:53 2017 -0800

--
 .../java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/ae21f873/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
index 7ad9028..18b1ee5 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
@@ -3077,7 +3077,7 @@ public class MetaDataEndpointImpl extends 
MetaDataProtocol implements Coprocesso
 PhoenixDatabaseMetaData.ORDINAL_POSITION_BYTES, 
ordinalPositionBytes);
 
 // New PK columns have to be nullable after the first DDL
-byte[] isNullableBytes = PBoolean.INSTANCE.toBytes(true);
+byte[] isNullableBytes = 
PBoolean.INSTANCE.toBytes(ResultSetMetaData.columnNullable);
 
indexColumnDefinitionPut.add(PhoenixDatabaseMetaData.TABLE_FAMILY_BYTES,
 PhoenixDatabaseMetaData.NULLABLE_BYTES, 
isNullableBytes);
 



[15/50] [abbrv] phoenix git commit: PHOENIX-4360 Prevent System.Catalog from splitting.

2018-01-19 Thread tdsilva
PHOENIX-4360 Prevent System.Catalog from splitting.


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

Branch: refs/heads/system-catalog
Commit: c216b667a8da568f768c0d26f46fa1a9c0994a04
Parents: ca1e17b
Author: Lars Hofhansl 
Authored: Mon Nov 20 14:08:44 2017 -0800
Committer: Lars Hofhansl 
Committed: Mon Nov 20 14:08:44 2017 -0800

--
 .../apache/phoenix/end2end/SystemCatalogIT.java | 79 
 .../phoenix/schema/MetaDataSplitPolicy.java | 23 +-
 2 files changed, 82 insertions(+), 20 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/c216b667/phoenix-core/src/it/java/org/apache/phoenix/end2end/SystemCatalogIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SystemCatalogIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SystemCatalogIT.java
new file mode 100644
index 000..8a9bca2
--- /dev/null
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SystemCatalogIT.java
@@ -0,0 +1,79 @@
+package org.apache.phoenix.end2end;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.Properties;
+
+import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.RegionLocator;
+import org.apache.phoenix.util.PhoenixRuntime;
+import org.junit.After;
+import org.junit.Test;
+
+public class SystemCatalogIT {
+private HBaseTestingUtility testUtil = null;
+
+@After
+public void cleanup() throws Exception {
+if (null != testUtil) {
+  testUtil.shutdownMiniCluster();
+  testUtil = null;
+}
+}
+
+/**
+ * Make sure that SYSTEM.CATALOG cannot be split, even with schemas and 
multi-tenant views
+ */
+@Test
+public void testSystemTableSplit() throws Exception {
+testUtil = new HBaseTestingUtility();
+testUtil.startMiniCluster(1);
+for (int i=0; i<10; i++) {
+createTable("schema"+i+".table_"+i);
+}
+TableName systemCatalog = TableName.valueOf("SYSTEM.CATALOG");
+RegionLocator rl = 
testUtil.getConnection().getRegionLocator(systemCatalog);
+assertEquals(rl.getAllRegionLocations().size(), 1);
+
+// now attempt to split SYSTEM.CATALOG
+testUtil.getHBaseAdmin().split(systemCatalog);
+
+// make sure the split finishes (there's no synchronous splitting 
before HBase 2.x)
+testUtil.getHBaseAdmin().disableTable(systemCatalog);
+testUtil.getHBaseAdmin().enableTable(systemCatalog);
+
+// test again... Must still be exactly one region.
+rl = testUtil.getConnection().getRegionLocator(systemCatalog);
+assertEquals(1, rl.getAllRegionLocations().size());
+}
+
+private void createTable(String tableName) throws Exception {
+try (Connection conn = DriverManager.getConnection(getJdbcUrl());
+Statement stmt = conn.createStatement();) {
+stmt.execute("DROP TABLE IF EXISTS " + tableName);
+stmt.execute("CREATE TABLE " + tableName
++ " (TENANT_ID VARCHAR NOT NULL, PK1 VARCHAR NOT NULL, V1 
VARCHAR CONSTRAINT PK PRIMARY KEY(TENANT_ID, PK1)) MULTI_TENANT=true");
+try (Connection tenant1Conn = getTenantConnection("tenant1")) {
+String view1DDL = "CREATE VIEW " + tableName + "_view AS 
SELECT * FROM " + tableName;
+tenant1Conn.createStatement().execute(view1DDL);
+}
+conn.commit();
+}
+}
+
+private String getJdbcUrl() {
+return "jdbc:phoenix:localhost:" + 
testUtil.getZkCluster().getClientPort() + ":/hbase";
+}
+
+private Connection getTenantConnection(String tenantId) throws 
SQLException {
+Properties tenantProps = new Properties();
+tenantProps.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId);
+return DriverManager.getConnection(getJdbcUrl(), tenantProps);
+}
+}

http://git-wip-us.apache.org/repos/asf/phoenix/blob/c216b667/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataSplitPolicy.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataSplitPolicy.java 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataSplitPolicy.java
index 90fb8fb..154a9c2 100644
--- 

[31/50] [abbrv] phoenix git commit: PHOENIX-4446 Sequence table region opening failing because of property setting attempt on read-only configuration-addendum(Rajeshbabu)

2018-01-19 Thread tdsilva
PHOENIX-4446 Sequence table region opening failing because of property setting 
attempt on read-only configuration-addendum(Rajeshbabu)


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

Branch: refs/heads/system-catalog
Commit: 1a19d1ecbd38f2b7ee406df8efa05d29f685ef57
Parents: 334eb15
Author: Rajeshbabu Chintaguntla 
Authored: Tue Dec 12 15:29:20 2017 +0530
Committer: Rajeshbabu Chintaguntla 
Committed: Tue Dec 12 15:29:20 2017 +0530

--
 .../wal/WALReplayWithIndexWritesAndCompressedWALIT.java| 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/1a19d1ec/phoenix-core/src/it/java/org/apache/hadoop/hbase/regionserver/wal/WALReplayWithIndexWritesAndCompressedWALIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/hadoop/hbase/regionserver/wal/WALReplayWithIndexWritesAndCompressedWALIT.java
 
b/phoenix-core/src/it/java/org/apache/hadoop/hbase/regionserver/wal/WALReplayWithIndexWritesAndCompressedWALIT.java
index 042dd88..e2ddd4e 100644
--- 
a/phoenix-core/src/it/java/org/apache/hadoop/hbase/regionserver/wal/WALReplayWithIndexWritesAndCompressedWALIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/hadoop/hbase/regionserver/wal/WALReplayWithIndexWritesAndCompressedWALIT.java
@@ -60,6 +60,7 @@ import org.apache.phoenix.hbase.index.covered.ColumnGroup;
 import org.apache.phoenix.hbase.index.covered.CoveredColumn;
 import 
org.apache.phoenix.hbase.index.covered.CoveredColumnIndexSpecifierBuilder;
 import org.apache.phoenix.hbase.index.util.TestIndexManagementUtil;
+import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.util.ConfigUtil;
 import org.junit.After;
 import org.junit.Before;
@@ -100,6 +101,7 @@ public class WALReplayWithIndexWritesAndCompressedWALIT {
 setupCluster();
 Path hbaseRootDir = UTIL.getDataTestDir();
 this.conf = HBaseConfiguration.create(UTIL.getConfiguration());
+this.conf.setBoolean(QueryServices.INDEX_FAILURE_THROW_EXCEPTION_ATTRIB, 
false);
 this.fs = UTIL.getDFSCluster().getFileSystem();
 this.hbaseRootDir = new Path(this.conf.get(HConstants.HBASE_DIR));
 this.oldLogDir = new Path(this.hbaseRootDir, 
HConstants.HREGION_OLDLOGDIR_NAME);



[32/50] [abbrv] phoenix git commit: PHOENIX-4456 queryserver script doesn't perform as expected.

2018-01-19 Thread tdsilva
PHOENIX-4456 queryserver script doesn't perform as expected.


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

Branch: refs/heads/system-catalog
Commit: 90c7241611667e3cd3689ce6a72762c6315231ef
Parents: 1a19d1e
Author: Sergey Soldatov 
Authored: Tue Dec 12 23:20:48 2017 -0800
Committer: Sergey Soldatov 
Committed: Wed Dec 13 10:16:54 2017 -0800

--
 bin/daemon.py | 16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/90c72416/bin/daemon.py
--
diff --git a/bin/daemon.py b/bin/daemon.py
index aeebae3..bb64148 100644
--- a/bin/daemon.py
+++ b/bin/daemon.py
@@ -57,6 +57,7 @@ import signal
 import socket
 import atexit
 import fcntl
+import time
 try:
 # Python 2 has both ‘str’ (bytes) and ‘unicode’ (text).
 basestring = basestring
@@ -386,7 +387,7 @@ class DaemonContext:
 change_process_owner(self.uid, self.gid)
 
 if self.detach_process:
-detach_process_context()
+detach_process_context(self.pidfile)
 
 signal_handler_map = self._make_signal_handler_map()
 set_signal_handlers(signal_handler_map)
@@ -657,7 +658,7 @@ def prevent_core_dump():
 resource.setrlimit(core_resource, core_limit)
 
 
-def detach_process_context():
+def detach_process_context(pidfile):
 """ Detach the process context from parent and session.
 
 :return: ``None``.
@@ -683,6 +684,8 @@ def detach_process_context():
 try:
 pid = os.fork()
 if pid > 0:
+while not os.path.exists(pidfile.path):
+time.sleep(0.1)
 os._exit(0)
 except OSError as exc:
 error = DaemonProcessDetachError(
@@ -959,7 +962,14 @@ found at [1].
 def __init__(self, path, enter_err_msg=None):
 self.path = path
 self.enter_err_msg = enter_err_msg
-self.pidfile = None
+self.pidfile = open(self.path, 'a+')
+try:
+fcntl.flock(self.pidfile.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
+fcntl.flock(self.pidfile.fileno(), fcntl.LOCK_UN)
+self.pidfile.close()
+os.remove(self.path)
+except IOError:
+sys.exit(self.enter_err_msg)
 
 def __enter__(self):
 self.pidfile = open(self.path, 'a+')



[38/50] [abbrv] phoenix git commit: PHOENIX-4468 Looking up a parent index table of a child view from a different client fails (addendum)

2018-01-19 Thread tdsilva
PHOENIX-4468 Looking up a parent index table of a child view from a different 
client fails (addendum)


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

Branch: refs/heads/system-catalog
Commit: 9355a4d262d31d8d65e1467bcc351bb99760e11d
Parents: c935f57
Author: Thomas D'Silva 
Authored: Wed Dec 20 15:47:19 2017 -0800
Committer: Thomas D'Silva 
Committed: Wed Dec 20 15:48:58 2017 -0800

--
 phoenix-core/src/main/antlr3/PhoenixSQL.g  | 1 -
 .../src/main/java/org/apache/phoenix/schema/PTableImpl.java| 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/9355a4d2/phoenix-core/src/main/antlr3/PhoenixSQL.g
--
diff --git a/phoenix-core/src/main/antlr3/PhoenixSQL.g 
b/phoenix-core/src/main/antlr3/PhoenixSQL.g
index 5e64984..87153cd 100644
--- a/phoenix-core/src/main/antlr3/PhoenixSQL.g
+++ b/phoenix-core/src/main/antlr3/PhoenixSQL.g
@@ -1114,7 +1114,6 @@ from_table_name returns [TableName ret]
 table_identifier returns [String ret]
 :   c=identifier {
if (c.contains(QueryConstants.NAMESPACE_SEPARATOR) ) { throw new 
RuntimeException("Table or schema name cannot contain colon"); }
-   if (c.contains(QueryConstants.CHILD_VIEW_INDEX_NAME_SEPARATOR) ) { 
throw new RuntimeException("Table or schema name cannot contain hash"); }
$ret = c;
 }
 ;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/9355a4d2/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 7df2458..9525127 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
@@ -267,7 +267,7 @@ public class PTableImpl implements PTable {
 
 public static PTableImpl makePTable(PTable table, PName tableName, long 
timeStamp, List physicalNames, List indexes, String 
viewStatement, long updateCacheFrequency, PName tenantId) throws SQLException {
 return new PTableImpl(
-tenantId, PNameImpl.EMPTY_NAME, tableName, 
table.getType(), table.getIndexState(), timeStamp,
+tenantId, table.getSchemaName(), tableName, 
table.getType(), table.getIndexState(), timeStamp,
 table.getSequenceNumber(), table.getPKName(), 
table.getBucketNum(), getColumnsToClone(table), table.getParentSchemaName(), 
table.getParentTableName(),
 indexes, table.isImmutableRows(), physicalNames, 
table.getDefaultFamilyName(), viewStatement,
 table.isWALDisabled(), table.isMultiTenant(), 
table.getStoreNulls(), table.getViewType(), table.getViewIndexId(), 
table.getIndexType(),



[41/50] [abbrv] phoenix git commit: PHOENIX-4488 Cache config parameters for MetaDataEndPointImpl during initialization

2018-01-19 Thread tdsilva
PHOENIX-4488 Cache config parameters for MetaDataEndPointImpl during 
initialization


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

Branch: refs/heads/system-catalog
Commit: 1636f6182ae89e9c4b97c877aa919a6edac5bbc2
Parents: 3469384
Author: James Taylor 
Authored: Fri Dec 22 11:36:44 2017 -0800
Committer: James Taylor 
Committed: Tue Dec 26 13:21:09 2017 -0800

--
 .../coprocessor/MetaDataEndpointImplTest.java   | 44 
 .../coprocessor/MetaDataEndpointImpl.java   | 30 ++---
 2 files changed, 16 insertions(+), 58 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/1636f618/phoenix-core/src/it/java/org/apache/phoenix/coprocessor/MetaDataEndpointImplTest.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/coprocessor/MetaDataEndpointImplTest.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/coprocessor/MetaDataEndpointImplTest.java
deleted file mode 100644
index 2c558d8..000
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/coprocessor/MetaDataEndpointImplTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.phoenix.coprocessor;
-
-import com.google.common.collect.Lists;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.phoenix.query.QueryServices;
-import org.apache.phoenix.schema.PTable;
-import org.apache.phoenix.schema.PTableType;
-import org.junit.Test;
-
-import java.util.List;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-public class MetaDataEndpointImplTest {
-
-@Test
-public void testExceededIndexQuota() throws Exception {
-PTable parentTable = mock(PTable.class);
-List indexes = Lists.newArrayList(mock(PTable.class), 
mock(PTable.class));
-when(parentTable.getIndexes()).thenReturn(indexes);
-Configuration configuration = new Configuration();
-assertFalse(MetaDataEndpointImpl.execeededIndexQuota(PTableType.INDEX, 
parentTable, configuration));
-configuration.setInt(QueryServices.MAX_INDEXES_PER_TABLE, 1);
-assertTrue(MetaDataEndpointImpl.execeededIndexQuota(PTableType.INDEX, 
parentTable, configuration));
-}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1636f618/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
index afbd63f..7ad9028 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
@@ -242,7 +242,6 @@ import org.apache.phoenix.util.UpgradeUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.annotations.VisibleForTesting;
 import com.google.common.cache.Cache;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
@@ -472,6 +471,10 @@ public class MetaDataEndpointImpl extends MetaDataProtocol 
implements Coprocesso
 
 private PhoenixMetaDataCoprocessorHost phoenixAccessCoprocessorHost;
 private boolean accessCheckEnabled;
+private boolean blockWriteRebuildIndex;
+private int maxIndexesPerTable;
+private boolean isTablesMappingEnabled;
+
 
 /**
  * Stores a reference to the coprocessor environment provided by the
@@ -492,8 +495,16 @@ public class MetaDataEndpointImpl extends MetaDataProtocol 
implements 

[07/50] [abbrv] phoenix git commit: PHOENIX-4342 - Surface QueryPlan in MutationPlan

2018-01-19 Thread tdsilva
PHOENIX-4342 - Surface QueryPlan in MutationPlan


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

Branch: refs/heads/system-catalog
Commit: 1d8a6bc3a6a277d9e3201066b753fa9fd7018545
Parents: 2a8e1c7
Author: Geoffrey Jacoby 
Authored: Thu Nov 2 13:41:02 2017 -0700
Committer: Geoffrey Jacoby 
Committed: Mon Nov 13 11:47:50 2017 -0800

--
 .../phoenix/compile/BaseMutationPlan.java   |   5 +
 .../phoenix/compile/DelegateMutationPlan.java   |   5 +
 .../apache/phoenix/compile/DeleteCompiler.java  | 545 ---
 .../apache/phoenix/compile/MutationPlan.java|   5 +-
 .../apache/phoenix/compile/UpsertCompiler.java  | 675 +++
 .../apache/phoenix/jdbc/PhoenixStatement.java   |   9 +-
 6 files changed, 733 insertions(+), 511 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/1d8a6bc3/phoenix-core/src/main/java/org/apache/phoenix/compile/BaseMutationPlan.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/BaseMutationPlan.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/BaseMutationPlan.java
index 0e45682..60eb59a 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/BaseMutationPlan.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/BaseMutationPlan.java
@@ -79,4 +79,9 @@ public abstract class BaseMutationPlan implements 
MutationPlan {
 return 0l;
 }
 
+@Override
+public QueryPlan getQueryPlan() {
+return null;
+}
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1d8a6bc3/phoenix-core/src/main/java/org/apache/phoenix/compile/DelegateMutationPlan.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/DelegateMutationPlan.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/DelegateMutationPlan.java
index 343ec32..90eef61 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/DelegateMutationPlan.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/DelegateMutationPlan.java
@@ -42,6 +42,11 @@ public class DelegateMutationPlan implements MutationPlan {
 }
 
 @Override
+public QueryPlan getQueryPlan() {
+return plan.getQueryPlan();
+}
+
+@Override
 public ParameterMetaData getParameterMetaData() {
 return plan.getParameterMetaData();
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1d8a6bc3/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
index f038cda..8d9a5b6 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
@@ -303,14 +303,16 @@ public class DeleteCompiler {
 return Collections.emptyList();
 }
 
-private class MultiDeleteMutationPlan implements MutationPlan {
+private class MultiRowDeleteMutationPlan implements MutationPlan {
 private final List plans;
 private final MutationPlan firstPlan;
-
-public MultiDeleteMutationPlan(@NotNull List plans) {
+private final QueryPlan dataPlan;
+
+public MultiRowDeleteMutationPlan(QueryPlan dataPlan, @NotNull 
List plans) {
 Preconditions.checkArgument(!plans.isEmpty());
 this.plans = plans;
 this.firstPlan = plans.get(0);
+this.dataPlan = dataPlan;
 }
 
 @Override
@@ -348,8 +350,8 @@ public class DeleteCompiler {
 return firstPlan.getSourceRefs();
 }
 
-   @Override
-   public Operation getOperation() {
+   @Override
+   public Operation getOperation() {
return operation;
}
 
@@ -401,6 +403,11 @@ public class DeleteCompiler {
 }
 return estInfoTimestamp;
 }
+
+@Override
+public QueryPlan getQueryPlan() {
+return dataPlan;
+}
 }
 
 public MutationPlan compile(DeleteStatement delete) throws SQLException {
@@ -548,69 +555,9 @@ public class DeleteCompiler {
 List mutationPlans = 
Lists.newArrayListWithExpectedSize(queryPlans.size());
 for (final 

[20/50] [abbrv] phoenix git commit: PHOENIX-672 Add GRANT and REVOKE commands using HBase AccessController

2018-01-19 Thread tdsilva
PHOENIX-672 Add GRANT and REVOKE commands using HBase AccessController


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

Branch: refs/heads/system-catalog
Commit: 88038a2dacb7aa1a90015163d4d75d04793e4e11
Parents: 355ee52
Author: Karan Mehta 
Authored: Wed Nov 29 12:04:06 2017 -0800
Committer: Thomas D'Silva 
Committed: Wed Nov 29 20:39:19 2017 -0800

--
 .../phoenix/end2end/BasePermissionsIT.java  | 754 +++
 .../phoenix/end2end/ChangePermissionsIT.java| 269 +++
 .../end2end/SystemTablePermissionsIT.java   | 226 +-
 .../phoenix/end2end/TableDDLPermissionsIT.java  | 583 ++
 phoenix-core/src/main/antlr3/PhoenixSQL.g   |  30 +-
 .../coprocessor/PhoenixAccessController.java|  29 +-
 .../phoenix/exception/SQLExceptionCode.java |   1 +
 .../apache/phoenix/jdbc/PhoenixStatement.java   |  40 +-
 .../phoenix/parse/ChangePermsStatement.java | 102 +++
 .../apache/phoenix/parse/ParseNodeFactory.java  |   7 +-
 .../query/ConnectionQueryServicesImpl.java  |  24 +-
 .../apache/phoenix/query/QueryConstants.java|   1 +
 .../org/apache/phoenix/query/QueryServices.java |   2 -
 .../phoenix/query/QueryServicesOptions.java |   8 +-
 .../apache/phoenix/schema/MetaDataClient.java   | 138 
 .../schema/TablesNotInSyncException.java|  22 +
 .../org/apache/phoenix/util/SchemaUtil.java |  25 +-
 .../apache/phoenix/parse/QueryParserTest.java   |  46 +-
 18 files changed, 1544 insertions(+), 763 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/88038a2d/phoenix-core/src/it/java/org/apache/phoenix/end2end/BasePermissionsIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BasePermissionsIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BasePermissionsIT.java
new file mode 100644
index 000..9d7ef1b
--- /dev/null
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BasePermissionsIT.java
@@ -0,0 +1,754 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end;
+
+import com.google.common.base.Joiner;
+import com.google.common.base.Throwables;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.AuthUtil;
+import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.security.AccessDeniedException;
+import org.apache.hadoop.hbase.security.User;
+import org.apache.hadoop.hbase.security.access.AccessControlClient;
+import org.apache.hadoop.hbase.security.access.Permission;
+import org.apache.phoenix.jdbc.PhoenixConnection;
+import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
+import org.apache.phoenix.jdbc.PhoenixStatement;
+import org.apache.phoenix.query.BaseTest;
+import org.apache.phoenix.query.QueryConstants;
+import org.apache.phoenix.query.QueryServices;
+import org.apache.phoenix.util.PhoenixRuntime;
+import org.apache.phoenix.util.QueryUtil;
+import org.junit.After;
+import org.junit.BeforeClass;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.io.IOException;
+import java.lang.reflect.UndeclaredThrowableException;
+import java.security.PrivilegedExceptionAction;
+import java.sql.Connection;
+import java.sql.DriverManager;
+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.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import static org.junit.Assert.assertEquals;

[35/50] [abbrv] phoenix git commit: PHOENIX-4449 Bundle a copy of Argparse-1.4.0 for installations that need it

2018-01-19 Thread tdsilva
PHOENIX-4449 Bundle a copy of Argparse-1.4.0 for installations that need it


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

Branch: refs/heads/system-catalog
Commit: 5cb02da74c15b0ae7c0fb4c880d60a2d1b6d18aa
Parents: 90c7241
Author: Josh Elser 
Authored: Mon Dec 11 19:18:25 2017 -0500
Committer: Josh Elser 
Committed: Wed Dec 13 15:39:47 2017 -0500

--
 NOTICE |2 +
 bin/argparse-1.4.0/argparse.py | 2392 +++
 bin/sqlline-thin.py|9 +-
 bin/sqlline.py |   14 +-
 4 files changed, 2413 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/5cb02da7/NOTICE
--
diff --git a/NOTICE b/NOTICE
index eb2eef5..8b2b647 100644
--- a/NOTICE
+++ b/NOTICE
@@ -19,3 +19,5 @@ The file bin/daemon.py is based on the file of the same name 
in python-daemon 2.
 # Copyright © 2003 Clark Evans
 # Copyright © 2002 Noah Spurrier
 # Copyright © 2001 Jürgen Hermann
+
+The file bin/argparse-1.4.0/argparse.py is (c) 2006-2009 Steven J. Bethard 
.



[22/50] [abbrv] phoenix git commit: PHOENIX-4322 DESC primary key column with variable length does not work in SkipScanFilter

2018-01-19 Thread tdsilva
PHOENIX-4322 DESC primary key column with variable length does not work in 
SkipScanFilter


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

Branch: refs/heads/system-catalog
Commit: d77c237b560900671c3a9c58f6f2398342655e8a
Parents: 6807dac
Author: maryannxue 
Authored: Tue Dec 5 10:59:41 2017 -0800
Committer: maryannxue 
Committed: Tue Dec 5 10:59:41 2017 -0800

--
 .../it/java/org/apache/phoenix/end2end/SortOrderIT.java  | 11 ++-
 .../expression/RowValueConstructorExpression.java|  4 ++--
 2 files changed, 12 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d77c237b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortOrderIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortOrderIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortOrderIT.java
index 655dbb1..3f749c1 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortOrderIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SortOrderIT.java
@@ -167,7 +167,16 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
 runQueryTest(ddl, upsert("oid", "code"), insertedRows, new 
Object[][]{{"o2", 2}}, new WhereCondition("oid", "IN", "('o2')"),
 table);
 }
-
+
+@Test
+public void inDescCompositePK3() throws Exception {
+String table = generateUniqueName();
+String ddl = "CREATE table " + table + " (oid VARCHAR NOT NULL, code 
VARCHAR NOT NULL constraint pk primary key (oid DESC, code DESC))";
+Object[][] insertedRows = new Object[][]{{"o1", "1"}, {"o2", "2"}, 
{"o3", "3"}};
+runQueryTest(ddl, upsert("oid", "code"), insertedRows, new 
Object[][]{{"o2", "2"}, {"o1", "1"}}, new WhereCondition("(oid, code)", "IN", 
"(('o2', '2'), ('o1', '1'))"),
+table);
+}
+
 @Test
 public void likeDescCompositePK1() throws Exception {
 String table = generateUniqueName();

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d77c237b/phoenix-core/src/main/java/org/apache/phoenix/expression/RowValueConstructorExpression.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/RowValueConstructorExpression.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/RowValueConstructorExpression.java
index 15f6e3e..9bb7234 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/RowValueConstructorExpression.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/RowValueConstructorExpression.java
@@ -199,8 +199,8 @@ public class RowValueConstructorExpression extends 
BaseCompoundExpression {
 // as otherwise we need it to ensure sort order is correct
 for (int k = expressionCount -1 ; 
 k >=0 &&  getChildren().get(k).getDataType() != 
null 
-  && 
!getChildren().get(k).getDataType().isFixedWidth() 
-  && outputBytes[outputSize-1] == 
QueryConstants.SEPARATOR_BYTE ; k--) {
+  && 
!getChildren().get(k).getDataType().isFixedWidth()
+  && outputBytes[outputSize-1] == 
SchemaUtil.getSeparatorByte(true, false, getChildren().get(k)) ; k--) {
 outputSize--;
 }
 ptr.set(outputBytes, 0, outputSize);



[23/50] [abbrv] phoenix git commit: PHOENIX-3050 Handle DESC columns in child/parent join optimization

2018-01-19 Thread tdsilva
PHOENIX-3050 Handle DESC columns in child/parent join optimization


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

Branch: refs/heads/system-catalog
Commit: 071fbce499c5303ffdcd4bbe25c1cda788aced0c
Parents: d77c237
Author: maryannxue 
Authored: Wed Dec 6 12:07:16 2017 -0800
Committer: maryannxue 
Committed: Wed Dec 6 12:07:16 2017 -0800

--
 .../phoenix/end2end/join/HashJoinMoreIT.java |  5 +
 .../org/apache/phoenix/compile/JoinCompiler.java | 19 +--
 .../apache/phoenix/compile/QueryCompiler.java|  6 +++---
 .../apache/phoenix/compile/WhereOptimizer.java   |  5 -
 4 files changed, 21 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/071fbce4/phoenix-core/src/it/java/org/apache/phoenix/end2end/join/HashJoinMoreIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/join/HashJoinMoreIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/join/HashJoinMoreIT.java
index 37ffd02..f09f1d3 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/join/HashJoinMoreIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/join/HashJoinMoreIT.java
@@ -895,6 +895,11 @@ public class HashJoinMoreIT extends 
ParallelStatsDisabledIT {
 + "FROM ( SELECT ACCOUNT_ID, BUCKET_ID, OBJECT_ID, 
MAX(OBJECT_VERSION) AS MAXVER "
 + "   FROM test2961 GROUP BY ACCOUNT_ID, BUCKET_ID, 
OBJECT_ID) AS X "
 + "   INNER JOIN test2961 AS OBJ ON X.ACCOUNT_ID = 
OBJ.ACCOUNT_ID AND X.BUCKET_ID = OBJ.BUCKET_ID AND X.OBJECT_ID = OBJ.OBJECT_ID 
AND  X.MAXVER = OBJ.OBJECT_VERSION";
+rs = conn.createStatement().executeQuery("explain " + q);
+String plan = QueryUtil.getExplainPlan(rs);
+String dynamicFilter = "DYNAMIC SERVER FILTER BY (OBJ.ACCOUNT_ID, 
OBJ.BUCKET_ID, OBJ.OBJECT_ID, OBJ.OBJECT_VERSION) IN ((X.ACCOUNT_ID, 
X.BUCKET_ID, X.OBJECT_ID, X.MAXVER))";
+assertTrue("Expected '" + dynamicFilter + "' to be used for the 
query, but got:\n" + plan,
+plan.contains(dynamicFilter));
 rs = conn.createStatement().executeQuery(q);
 assertTrue(rs.next());
 assertEquals("", rs.getString(4));

http://git-wip-us.apache.org/repos/asf/phoenix/blob/071fbce4/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java
index 887e2d2..439a79b 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java
@@ -110,6 +110,12 @@ import com.google.common.collect.Sets;
 
 public class JoinCompiler {
 
+public enum Strategy {
+HASH_BUILD_LEFT,
+HASH_BUILD_RIGHT,
+SORT_MERGE,
+}
+
 public enum ColumnRefType {
 JOINLOCAL,
 GENERAL,
@@ -489,7 +495,7 @@ public class JoinCompiler {
 return dependencies;
 }
 
-public Pair 
compileJoinConditions(StatementContext lhsCtx, StatementContext rhsCtx, boolean 
sortExpressions) throws SQLException {
+public Pair 
compileJoinConditions(StatementContext lhsCtx, StatementContext rhsCtx, 
Strategy strategy) throws SQLException {
 if (onConditions.isEmpty()) {
 return new Pair(
 Collections. 
singletonList(LiteralExpression.newConstant(1)),
@@ -505,15 +511,16 @@ public class JoinCompiler {
 rhsCompiler.reset();
 Expression right = condition.getRHS().accept(rhsCompiler);
 PDataType toType = getCommonType(left.getDataType(), 
right.getDataType());
-if (left.getDataType() != toType || left.getSortOrder() == 
SortOrder.DESC) {
-left = CoerceExpression.create(left, toType, 
SortOrder.ASC, left.getMaxLength());
+SortOrder toSortOrder = strategy == Strategy.SORT_MERGE ? 
SortOrder.ASC : (strategy == Strategy.HASH_BUILD_LEFT ? right.getSortOrder() : 
left.getSortOrder());
+if (left.getDataType() != toType || left.getSortOrder() != 
toSortOrder) {
+left = CoerceExpression.create(left, toType, toSortOrder, 
left.getMaxLength());
 }
-   

[42/50] [abbrv] phoenix git commit: PHOENIX-4487 Missing SYSTEM.MUTEX table upgrading from 4.7 to 4.13

2018-01-19 Thread tdsilva
PHOENIX-4487 Missing SYSTEM.MUTEX table upgrading from 4.7 to 4.13


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

Branch: refs/heads/system-catalog
Commit: 2759727e444ef8ae7475d25979be84bfe89895f5
Parents: 1636f61
Author: James Taylor 
Authored: Fri Dec 22 10:58:55 2017 -0800
Committer: James Taylor 
Committed: Tue Dec 26 13:21:09 2017 -0800

--
 .../query/ConnectionQueryServicesImpl.java  | 29 
 1 file changed, 24 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/2759727e/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
index 072bf28..38be6af 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
@@ -2640,11 +2640,23 @@ public class ConnectionQueryServicesImpl extends 
DelegateQueryServices implement
 } catch (TableAlreadyExistsException e) {
 long currentServerSideTableTimeStamp = 
e.getTable().getTimeStamp();
 sysCatalogTableName = 
e.getTable().getPhysicalName().getString();
-if (currentServerSideTableTimeStamp < 
MIN_SYSTEM_TABLE_TIMESTAMP
-&& (acquiredMutexLock = 
acquireUpgradeMutex(currentServerSideTableTimeStamp, mutexRowKey))) {
-snapshotName = 
getSysCatalogSnapshotName(currentServerSideTableTimeStamp);
-createSnapshot(snapshotName, sysCatalogTableName);
-snapshotCreated = true;
+if (currentServerSideTableTimeStamp < 
MIN_SYSTEM_TABLE_TIMESTAMP) {
+// Ensure that the SYSTEM.MUTEX table has been created 
prior
+// to attempting to acquire the upgrade mutex. If namespace
+// mapping is enabled, we've already done this earlier in 
the
+// upgrade, so no need for a bunch of wasted RPCs.
+if (currentServerSideTableTimeStamp <= 
MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP_4_10_0 &&
+
!SchemaUtil.isNamespaceMappingEnabled(PTableType.SYSTEM,
+
ConnectionQueryServicesImpl.this.getProps())) {
+try (HBaseAdmin admin = getAdmin()) {
+createSysMutexTable(admin, this.getProps());
+}
+}
+if (acquiredMutexLock = 
acquireUpgradeMutex(currentServerSideTableTimeStamp, mutexRowKey)) {
+snapshotName = 
getSysCatalogSnapshotName(currentServerSideTableTimeStamp);
+createSnapshot(snapshotName, sysCatalogTableName);
+snapshotCreated = true;
+}
 }
 String columnsToAdd = "";
 // This will occur if we have an older SYSTEM.CATALOG and we 
need to update it to
@@ -3191,6 +3203,13 @@ public class ConnectionQueryServicesImpl extends 
DelegateQueryServices implement
 // Try acquiring a lock in SYSMUTEX table before migrating the 
tables since it involves disabling the table
 // If we cannot acquire lock, it means some old client is either 
migrating SYSCAT or trying to upgrade the
 // schema of SYSCAT table and hence it should not be interrupted
+// Create mutex if not already created
+if 
(!tableNames.contains(PhoenixDatabaseMetaData.SYSTEM_MUTEX_HBASE_TABLE_NAME)) {
+TableName mutexName = 
SchemaUtil.getPhysicalTableName(PhoenixDatabaseMetaData.SYSTEM_MUTEX_NAME, 
props);
+if 
(PhoenixDatabaseMetaData.SYSTEM_MUTEX_HBASE_TABLE_NAME.equals(mutexName) || 
!tableNames.contains(mutexName)) {
+createSysMutexTable(admin, props);
+}
+}
 acquiredMutexLock = 
acquireUpgradeMutex(MetaDataProtocol.MIN_SYSTEM_TABLE_MIGRATION_TIMESTAMP, 
mutexRowKey);
 if(acquiredMutexLock) {
 logger.debug("Acquired lock in SYSMUTEX table for migrating 
SYSTEM tables to SYSTEM namespace");



[17/50] [abbrv] phoenix git commit: PHOENIX-4389 Flapping tests SystemTablePermissionsIT and MigrateSystemTablesToSystemNamespaceIT

2018-01-19 Thread tdsilva
PHOENIX-4389 Flapping tests SystemTablePermissionsIT and 
MigrateSystemTablesToSystemNamespaceIT


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

Branch: refs/heads/system-catalog
Commit: d46d4e564d94077b637ad8f34d8785a4ac3486a5
Parents: 4e0c0a3
Author: Karan Mehta 
Authored: Tue Nov 28 15:39:03 2017 -0800
Committer: Thomas D'Silva 
Committed: Tue Nov 28 18:33:15 2017 -0800

--
 .../end2end/MigrateSystemTablesToSystemNamespaceIT.java  | 8 
 1 file changed, 8 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d46d4e56/phoenix-core/src/it/java/org/apache/phoenix/end2end/MigrateSystemTablesToSystemNamespaceIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/MigrateSystemTablesToSystemNamespaceIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/MigrateSystemTablesToSystemNamespaceIT.java
index 91e34be..c36cdd3 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/MigrateSystemTablesToSystemNamespaceIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/MigrateSystemTablesToSystemNamespaceIT.java
@@ -18,6 +18,7 @@ package org.apache.phoenix.end2end;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.phoenix.coprocessor.MetaDataProtocol;
@@ -87,6 +88,7 @@ public class MigrateSystemTablesToSystemNamespaceIT extends 
BaseTest {
 testUtil = new HBaseTestingUtility();
 Configuration conf = testUtil.getConfiguration();
 enableNamespacesOnServer(conf);
+configureRandomHMasterPort(conf);
 testUtil.startMiniCluster(1);
 }
 
@@ -289,6 +291,12 @@ public class MigrateSystemTablesToSystemNamespaceIT 
extends BaseTest {
 conf.set(QueryServices.IS_NAMESPACE_MAPPING_ENABLED, 
Boolean.TRUE.toString());
 }
 
+// For PHOENIX-4389 (Flapping tests SystemTablePermissionsIT and 
MigrateSystemTablesToSystemNamespaceIT)
+private void configureRandomHMasterPort(Configuration conf) {
+// Avoid multiple clusters trying to bind the master's info port 
(16010)
+conf.setInt(HConstants.MASTER_INFO_PORT, -1);
+}
+
 private Properties getClientPropertiesWithSystemMappingEnabled() {
 Properties clientProps = new Properties();
 clientProps.setProperty(QueryServices.IS_NAMESPACE_MAPPING_ENABLED, 
Boolean.TRUE.toString());



[25/50] [abbrv] phoenix git commit: PHOENIX-4439 QueryServer pid file name doesn't comply the usual schema we are using in hadoop ecosystem

2018-01-19 Thread tdsilva
PHOENIX-4439 QueryServer pid file name doesn't comply the usual schema we are 
using in hadoop ecosystem


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

Branch: refs/heads/system-catalog
Commit: ee728a4d19c004ad456b24cd228fb2351362472d
Parents: 25359a9
Author: Sergey Soldatov 
Authored: Wed Dec 6 11:23:48 2017 -0800
Committer: Sergey Soldatov 
Committed: Wed Dec 6 14:03:26 2017 -0800

--
 bin/queryserver.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/ee728a4d/bin/queryserver.py
--
diff --git a/bin/queryserver.py b/bin/queryserver.py
index fefe0a5..711bcc4 100755
--- a/bin/queryserver.py
+++ b/bin/queryserver.py
@@ -76,7 +76,7 @@ hadoop_config_path = phoenix_utils.hadoop_conf
 hadoop_classpath = phoenix_utils.hadoop_classpath
 
 # TODO: add windows support
-phoenix_file_basename = '%s-queryserver' % getpass.getuser()
+phoenix_file_basename = 'phoenix-%s-queryserver' % getpass.getuser()
 phoenix_log_file = '%s.log' % phoenix_file_basename
 phoenix_out_file = '%s.out' % phoenix_file_basename
 phoenix_pid_file = '%s.pid' % phoenix_file_basename



[10/50] [abbrv] phoenix git commit: PHOENIX-4381 Calculate the estimatedSize of MutationState incrementally

2018-01-19 Thread tdsilva
PHOENIX-4381 Calculate the estimatedSize of MutationState incrementally


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

Branch: refs/heads/system-catalog
Commit: ef3bce18fe7373b66136d933cc364001dff2c3f8
Parents: 2053905
Author: Thomas D'Silva 
Authored: Wed Nov 15 18:54:04 2017 -0800
Committer: Thomas D'Silva 
Committed: Wed Nov 15 20:59:53 2017 -0800

--
 .../apache/phoenix/execute/MutationState.java   | 15 -
 .../org/apache/phoenix/util/KeyValueUtil.java   | 65 +---
 2 files changed, 43 insertions(+), 37 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/ef3bce18/phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java 
b/phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java
index 1f47a33..0cdb010 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java
@@ -127,6 +127,7 @@ public class MutationState implements SQLCloseable {
 
 private long sizeOffset;
 private int numRows = 0;
+private long estimatedSize = 0;
 private int[] uncommittedStatementIndexes = EMPTY_STATEMENT_INDEX_ARRAY;
 private boolean isExternalTxContext = false;
 private Map> txMutations 
= Collections.emptyMap();
@@ -193,6 +194,7 @@ public class MutationState implements SQLCloseable {
 this.mutations.put(table, mutations);
 }
 this.numRows = mutations.size();
+this.estimatedSize = KeyValueUtil.getEstimatedRowSize(table, 
mutations);
 throwIfTooBig();
 }
 
@@ -354,7 +356,6 @@ public class MutationState implements SQLCloseable {
 throw new 
SQLExceptionInfo.Builder(SQLExceptionCode.MAX_MUTATION_SIZE_EXCEEDED).build()
 .buildException();
 }
-long estimatedSize = KeyValueUtil.getEstimatedRowSize(mutations);
 if (estimatedSize > maxSizeBytes) {
 resetState();
 throw new 
SQLExceptionInfo.Builder(SQLExceptionCode.MAX_MUTATION_SIZE_BYTES_EXCEEDED)
@@ -433,7 +434,12 @@ public class MutationState implements SQLCloseable {
 
phoenixTransactionContext.join(newMutationState.getPhoenixTransactionContext());
 
 this.sizeOffset += newMutationState.sizeOffset;
+int oldNumRows = this.numRows;
 joinMutationState(newMutationState.mutations, this.mutations);
+// here we increment the estimated size by the fraction of new rows we 
added from the newMutationState 
+if (newMutationState.numRows>0) {
+this.estimatedSize += 
((double)(this.numRows-oldNumRows)/newMutationState.numRows) * 
newMutationState.estimatedSize;
+}
 if (!newMutationState.txMutations.isEmpty()) {
 if (txMutations.isEmpty()) {
 txMutations = 
Maps.newHashMapWithExpectedSize(mutations.size());
@@ -968,6 +974,8 @@ public class MutationState implements SQLCloseable {
 long mutationCommitTime = 0;
 long numFailedMutations = 0;;
 long startTime = 0;
+long startNumRows = numRows;
+long startEstimatedSize = estimatedSize;
 do {
 TableRef origTableRef = tableInfo.getOrigTableRef();
 PTable table = origTableRef.getTable();
@@ -1004,8 +1012,8 @@ public class MutationState implements SQLCloseable {
 for (List mutationBatch : mutationBatchList) 
{
 hTable.batch(mutationBatch);
 batchCount++;
+if (logger.isDebugEnabled()) logger.debug("Sent 
batch of " + mutationBatch.size() + " for " + Bytes.toString(htableName));
 }
-if (logger.isDebugEnabled()) logger.debug("Sent batch 
of " + numMutations + " for " + Bytes.toString(htableName));
 child.stop();
 child.stop();
 shouldRetry = false;
@@ -1015,6 +1023,8 @@ public class MutationState implements SQLCloseable {
 
 if (tableInfo.isDataTable()) {
 numRows -= numMutations;
+// decrement estimated size by the fraction of 
rows we sent to hbase
+

[05/50] [abbrv] phoenix git commit: Merge remote-tracking branch 'upstream/master' into PHOENIX-3534

2018-01-19 Thread tdsilva
http://git-wip-us.apache.org/repos/asf/phoenix/blob/39c0d1d4/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/ViewFinder.java
--
diff --cc 
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/ViewFinder.java
index 36a3f9c,000..cde7a01
mode 100644,00..100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/ViewFinder.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/ViewFinder.java
@@@ -1,223 -1,0 +1,224 @@@
 +/**
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + * http://www.apache.org/licenses/LICENSE-2.0
 + * Unless required by applicable law or agreed to in writing, software
 + * distributed under the License is distributed on an "AS IS" BASIS,
 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 + * See the License for the specific language governing permissions and
 + * limitations under the License.
 + */
 +package org.apache.phoenix.coprocessor;
 +
 +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.LINK_TYPE_BYTES;
 +import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.PARENT_TENANT_ID_BYTES;
 +import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_FAMILY_BYTES;
 +import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_TYPE_BYTES;
++import static org.apache.phoenix.query.QueryConstants.SEPARATOR_BYTE_ARRAY;
 +import static org.apache.phoenix.util.SchemaUtil.getVarChars;
 +
 +import java.io.IOException;
 +import java.util.LinkedHashSet;
 +import java.util.List;
 +import java.util.Set;
 +
 +import org.apache.hadoop.hbase.HConstants;
 +import org.apache.hadoop.hbase.client.Result;
 +import org.apache.hadoop.hbase.client.ResultScanner;
 +import org.apache.hadoop.hbase.client.Scan;
 +import org.apache.hadoop.hbase.client.Table;
 +import org.apache.hadoop.hbase.filter.CompareFilter;
 +import org.apache.hadoop.hbase.filter.FilterList;
 +import org.apache.hadoop.hbase.filter.SingleColumnValueFilter;
 +import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 +import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 +import org.apache.phoenix.schema.PTable;
 +import org.apache.phoenix.schema.tuple.ResultTuple;
 +import org.apache.phoenix.util.ByteUtil;
 +import org.apache.phoenix.util.SchemaUtil;
 +
 +import com.google.common.collect.LinkedHashMultimap;
 +import com.google.common.collect.Lists;
 +import com.google.common.collect.Sets;
 +
 +class ViewFinder {
 +
-   // The PHYSICAL_TABLE link from view to the base table overwrites the 
PARENT_TABLE link 
++  // The PHYSICAL_TABLE link from view to the base table overwrites the 
PARENT_TABLE link (when namespace mapping is disabled)
 +static TableViewFinderResult findBaseTable(Table systemCatalog, byte[] 
tenantId, byte[] schema, byte[] table)
 +throws IOException {
 +return findRelatedViews(systemCatalog, tenantId, schema, table, 
PTable.LinkType.PHYSICAL_TABLE,
 +HConstants.LATEST_TIMESTAMP);
 +}
 +
 +static TableViewFinderResult findParentViewofIndex(Table systemCatalog, 
byte[] tenantId, byte[] schema, byte[] table)
 +throws IOException {
 +return findRelatedViews(systemCatalog, tenantId, schema, table, 
PTable.LinkType.VIEW_INDEX_PARENT_TABLE,
 +HConstants.LATEST_TIMESTAMP);
 +}
 +
 +static void findAllRelatives(Table systemTable, byte[] tenantId, byte[] 
schema, byte[] table,
 +PTable.LinkType linkType, TableViewFinderResult result) throws 
IOException {
 +findAllRelatives(systemTable, tenantId, schema, table, linkType, 
HConstants.LATEST_TIMESTAMP, result);
 +}
 +
 +static void findAllRelatives(Table systemCatalog, byte[] tenantId, byte[] 
schema, byte[] table,
 +PTable.LinkType linkType, long timestamp, TableViewFinderResult 
result) throws IOException {
 +TableViewFinderResult currentResult =
 +findRelatedViews(systemCatalog, tenantId, schema, table, 
linkType, timestamp);
 +result.addResult(currentResult);
 +for (TableInfo viewInfo : currentResult.getResults()) {
 +findAllRelatives(systemCatalog, viewInfo.getTenantId(), 
viewInfo.getSchemaName(), viewInfo.getTableName(), linkType, timestamp, result);
 +}
 +}
 +
 +static TableViewFinderResult findRelatedViews(Table systemCatalog, byte[] 
tenantId, byte[] schema, byte[] table,
 +PTable.LinkType linkType, long timestamp) throws IOException {
 +if (linkType==PTable.LinkType.INDEX_TABLE || 

[03/50] [abbrv] phoenix git commit: Set version to 4.14.0-HBase-1.3-SNAPSHOT after release

2018-01-19 Thread tdsilva
Set version to 4.14.0-HBase-1.3-SNAPSHOT after release


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

Branch: refs/heads/system-catalog
Commit: 2a8e1c750f081f7f020d4321f8d76ae02c074aa5
Parents: 217867c
Author: Mujtaba 
Authored: Fri Nov 10 15:35:46 2017 -0800
Committer: Mujtaba 
Committed: Fri Nov 10 15:35:46 2017 -0800

--
 phoenix-assembly/pom.xml   | 2 +-
 phoenix-client/pom.xml | 2 +-
 phoenix-core/pom.xml   | 2 +-
 phoenix-flume/pom.xml  | 2 +-
 phoenix-hive/pom.xml   | 2 +-
 phoenix-kafka/pom.xml  | 2 +-
 phoenix-load-balancer/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 +-
 15 files changed, 15 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/2a8e1c75/phoenix-assembly/pom.xml
--
diff --git a/phoenix-assembly/pom.xml b/phoenix-assembly/pom.xml
index 8ec4ebb..2ce4871 100644
--- a/phoenix-assembly/pom.xml
+++ b/phoenix-assembly/pom.xml
@@ -27,7 +27,7 @@
   
 org.apache.phoenix
 phoenix
-4.13.0-HBase-1.3
+4.14.0-HBase-1.3-SNAPSHOT
   
   phoenix-assembly
   Phoenix Assembly

http://git-wip-us.apache.org/repos/asf/phoenix/blob/2a8e1c75/phoenix-client/pom.xml
--
diff --git a/phoenix-client/pom.xml b/phoenix-client/pom.xml
index 77df4ca..c209435 100644
--- a/phoenix-client/pom.xml
+++ b/phoenix-client/pom.xml
@@ -27,7 +27,7 @@
   
 org.apache.phoenix
 phoenix
-4.13.0-HBase-1.3
+4.14.0-HBase-1.3-SNAPSHOT
   
   phoenix-client
   Phoenix Client

http://git-wip-us.apache.org/repos/asf/phoenix/blob/2a8e1c75/phoenix-core/pom.xml
--
diff --git a/phoenix-core/pom.xml b/phoenix-core/pom.xml
index 936aca3..fbda221 100644
--- a/phoenix-core/pom.xml
+++ b/phoenix-core/pom.xml
@@ -4,7 +4,7 @@
   
 org.apache.phoenix
 phoenix
-4.13.0-HBase-1.3
+4.14.0-HBase-1.3-SNAPSHOT
   
   phoenix-core
   Phoenix Core

http://git-wip-us.apache.org/repos/asf/phoenix/blob/2a8e1c75/phoenix-flume/pom.xml
--
diff --git a/phoenix-flume/pom.xml b/phoenix-flume/pom.xml
index bd1cd7e..cd957b2 100644
--- a/phoenix-flume/pom.xml
+++ b/phoenix-flume/pom.xml
@@ -26,7 +26,7 @@
   
 org.apache.phoenix
 phoenix
-4.13.0-HBase-1.3
+4.14.0-HBase-1.3-SNAPSHOT
   
   phoenix-flume
   Phoenix - Flume

http://git-wip-us.apache.org/repos/asf/phoenix/blob/2a8e1c75/phoenix-hive/pom.xml
--
diff --git a/phoenix-hive/pom.xml b/phoenix-hive/pom.xml
index a2531e0..0e55812 100644
--- a/phoenix-hive/pom.xml
+++ b/phoenix-hive/pom.xml
@@ -27,7 +27,7 @@
   
 org.apache.phoenix
 phoenix
-4.13.0-HBase-1.3
+4.14.0-HBase-1.3-SNAPSHOT
   
   phoenix-hive
   Phoenix - Hive

http://git-wip-us.apache.org/repos/asf/phoenix/blob/2a8e1c75/phoenix-kafka/pom.xml
--
diff --git a/phoenix-kafka/pom.xml b/phoenix-kafka/pom.xml
index 610bb01..a1b7251 100644
--- a/phoenix-kafka/pom.xml
+++ b/phoenix-kafka/pom.xml
@@ -26,7 +26,7 @@

org.apache.phoenix
phoenix
-   4.13.0-HBase-1.3
+   4.14.0-HBase-1.3-SNAPSHOT

phoenix-kafka
Phoenix - Kafka

http://git-wip-us.apache.org/repos/asf/phoenix/blob/2a8e1c75/phoenix-load-balancer/pom.xml
--
diff --git a/phoenix-load-balancer/pom.xml b/phoenix-load-balancer/pom.xml
index 7b819e1..8aa2b04 100644
--- a/phoenix-load-balancer/pom.xml
+++ b/phoenix-load-balancer/pom.xml
@@ -27,7 +27,7 @@
   
 org.apache.phoenix
 phoenix
-4.13.0-HBase-1.3
+4.14.0-HBase-1.3-SNAPSHOT
   
   phoenix-load-balancer
   Phoenix Load Balancer

http://git-wip-us.apache.org/repos/asf/phoenix/blob/2a8e1c75/phoenix-pherf/pom.xml
--
diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml
index edd9a27..304469e 100644
--- a/phoenix-pherf/pom.xml
+++ 

[24/50] [abbrv] phoenix git commit: PHOENIX-4386 Calculate the estimatedSize of MutationState using Map<TableRef, Map<ImmutableBytesPtr, RowMutationState>> mutations (addendum)

2018-01-19 Thread tdsilva
PHOENIX-4386 Calculate the estimatedSize of MutationState using Map> mutations (addendum)


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

Branch: refs/heads/system-catalog
Commit: 25359a95f1a8c5aa6e852e750fd6da6e10249387
Parents: 071fbce
Author: Thomas D'Silva 
Authored: Mon Nov 20 19:13:53 2017 -0800
Committer: Thomas D'Silva 
Committed: Wed Dec 6 12:26:15 2017 -0800

--
 .../apache/phoenix/execute/PartialCommitIT.java |   5 +-
 .../apache/phoenix/compile/DeleteCompiler.java  |  11 +-
 .../apache/phoenix/compile/UpsertCompiler.java  |   7 +-
 .../apache/phoenix/execute/MutationState.java   | 127 ---
 .../java/org/apache/phoenix/util/IndexUtil.java |   4 +-
 .../org/apache/phoenix/util/KeyValueUtil.java   |   5 +-
 6 files changed, 98 insertions(+), 61 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/25359a95/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
index 10fd7f8..e5b57e3 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
@@ -33,7 +33,6 @@ import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 import java.util.Map;
@@ -52,8 +51,8 @@ import 
org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver;
 import org.apache.hadoop.hbase.regionserver.wal.WALEdit;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.phoenix.end2end.BaseOwnClusterIT;
+import org.apache.phoenix.execute.MutationState.MultiRowMutationState;
 import org.apache.phoenix.hbase.index.Indexer;
-import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr;
 import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.monitoring.GlobalMetric;
 import org.apache.phoenix.monitoring.MetricType;
@@ -285,7 +284,7 @@ public class PartialCommitIT extends BaseOwnClusterIT {
 private PhoenixConnection 
getConnectionWithTableOrderPreservingMutationState() throws SQLException {
 Connection con = driver.connect(url, new Properties());
 PhoenixConnection phxCon = new 
PhoenixConnection(con.unwrap(PhoenixConnection.class));
-final 
Map> mutations = 
Maps.newTreeMap(new TableRefComparator());
+final Map mutations = 
Maps.newTreeMap(new TableRefComparator());
 // passing a null mutation state forces the 
connection.newMutationState() to be used to create the MutationState
 return new PhoenixConnection(phxCon, null) {
 @Override

http://git-wip-us.apache.org/repos/asf/phoenix/blob/25359a95/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
index f9ca300..a06e2ca 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
@@ -26,7 +26,6 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 
 import org.apache.hadoop.hbase.Cell;
@@ -43,6 +42,7 @@ import org.apache.phoenix.exception.SQLExceptionCode;
 import org.apache.phoenix.exception.SQLExceptionInfo;
 import org.apache.phoenix.execute.AggregatePlan;
 import org.apache.phoenix.execute.MutationState;
+import org.apache.phoenix.execute.MutationState.MultiRowMutationState;
 import org.apache.phoenix.execute.MutationState.RowMutationState;
 import org.apache.phoenix.filter.SkipScanFilter;
 import org.apache.phoenix.hbase.index.ValueGetter;
@@ -91,7 +91,6 @@ import org.apache.phoenix.util.ScanUtil;
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
 import com.sun.istack.NotNull;
 
 public class DeleteCompiler {
@@ -121,14 +120,14 @@ public class DeleteCompiler {
 final int maxSize = 

[26/50] [abbrv] phoenix git commit: PHOENIX-3837 Feature enabling to set property on an index with Alter statement

2018-01-19 Thread tdsilva
PHOENIX-3837 Feature enabling to set property on an index with Alter statement

Signed-off-by: aertoria 


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

Branch: refs/heads/system-catalog
Commit: 1c3387d0eb2fcec2423dda029aa65ca66f547416
Parents: ee728a4
Author: aertoria 
Authored: Mon Nov 27 11:58:01 2017 -0800
Committer: aertoria 
Committed: Thu Dec 7 11:51:17 2017 -0800

--
 .../apache/phoenix/end2end/AlterTableIT.java|   2 +-
 .../phoenix/end2end/index/IndexMetadataIT.java  |  55 ++
 phoenix-core/src/main/antlr3/PhoenixSQL.g   |   5 +-
 .../apache/phoenix/jdbc/PhoenixStatement.java   |  10 +-
 .../phoenix/parse/AddColumnStatement.java   |   2 +-
 .../phoenix/parse/AlterIndexStatement.java  |  14 +
 .../apache/phoenix/parse/ParseNodeFactory.java  |   6 +-
 .../phoenix/query/ConnectionQueryServices.java  |   2 +
 .../query/ConnectionQueryServicesImpl.java  |  20 +
 .../query/ConnectionlessQueryServicesImpl.java  |   7 +
 .../query/DelegateConnectionQueryServices.java  |   8 +-
 .../apache/phoenix/schema/MetaDataClient.java   | 566 +--
 12 files changed, 520 insertions(+), 177 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/1c3387d0/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
index 5265b09..17f08c4 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
@@ -1080,7 +1080,7 @@ public class AlterTableIT extends ParallelStatsDisabledIT 
{
} catch (SQLException e) {

assertEquals(SQLExceptionCode.CANNOT_CREATE_TXN_TABLE_IF_TXNS_DISABLED.getErrorCode(),
 e.getErrorCode());
}
-   // altering a table to be transactional  should fail if 
transactions are disabled
+   // altering a table to be transactional should fail if 
transactions are disabled
conn.createStatement().execute("CREATE TABLE " + 
dataTableFullName + "(k INTEGER PRIMARY KEY, v VARCHAR)");
try {
conn.createStatement().execute("ALTER TABLE " + 
dataTableFullName + " SET TRANSACTIONAL=true");

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1c3387d0/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
index 0ce36dd..986c317 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
@@ -674,4 +674,59 @@ public class IndexMetadataIT extends 
ParallelStatsDisabledIT {
 conn.close();
 }
 }
+
+
+
+@Test
+public void testIndexAlterPhoenixProperty() throws Exception {
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String testTable = generateUniqueName();
+
+
+String ddl = "create table " + testTable  + " (k varchar primary key, 
v1 varchar)";
+Statement stmt = conn.createStatement();
+stmt.execute(ddl);
+String indexName = "IDX_" + generateUniqueName();
+
+ddl = "CREATE INDEX " + indexName + " ON " + testTable  + " (v1) ";
+stmt.execute(ddl);
+conn.createStatement().execute("ALTER INDEX "+indexName+" ON " + 
testTable +" ACTIVE SET GUIDE_POSTS_WIDTH = 10");
+
+ResultSet rs = conn.createStatement().executeQuery(
+"select GUIDE_POSTS_WIDTH from SYSTEM.\"CATALOG\" where 
TABLE_NAME='" + indexName + "'");assertTrue(rs.next());
+assertEquals(10,rs.getInt(1));
+
+conn.createStatement().execute("ALTER INDEX "+indexName+" ON " + 
testTable +" ACTIVE SET GUIDE_POSTS_WIDTH = 20");
+rs = conn.createStatement().executeQuery(
+"select GUIDE_POSTS_WIDTH from SYSTEM.\"CATALOG\" where 
TABLE_NAME='" + indexName + "'");assertTrue(rs.next());
+assertEquals(20,rs.getInt(1));
+}
+
+
+@Test
+public void 

[14/50] [abbrv] phoenix git commit: PHOENIX-4387 DefaultColumnValueIT failing in non-US build environments (Pedro Boado)

2018-01-19 Thread tdsilva
PHOENIX-4387 DefaultColumnValueIT failing in non-US build environments (Pedro 
Boado)


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

Branch: refs/heads/system-catalog
Commit: ca1e17b75ced1e618869ad2c2ada019fcc336c02
Parents: 03fc331
Author: James Taylor 
Authored: Sat Nov 18 11:36:53 2017 -0800
Committer: James Taylor 
Committed: Sat Nov 18 11:36:53 2017 -0800

--
 .../org/apache/phoenix/end2end/DefaultColumnValueIT.java| 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/ca1e17b7/phoenix-core/src/it/java/org/apache/phoenix/end2end/DefaultColumnValueIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DefaultColumnValueIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DefaultColumnValueIT.java
index 62d79bc..59b15d8 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DefaultColumnValueIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DefaultColumnValueIT.java
@@ -32,6 +32,7 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Time;
 import java.sql.Timestamp;
+import java.text.DecimalFormatSymbols;
 
 import org.apache.phoenix.exception.SQLExceptionCode;
 import org.apache.phoenix.util.ByteUtil;
@@ -44,6 +45,8 @@ public class DefaultColumnValueIT extends 
ParallelStatsDisabledIT {
 private String sharedTable1;
 private String sharedTable2;
 
+private String DEFAULT_CURRENCY_SYMBOL = 
DecimalFormatSymbols.getInstance().getCurrencySymbol();
+
 @Before
 public void init() {
 sharedTable1 = generateUniqueName();
@@ -583,7 +586,7 @@ public class DefaultColumnValueIT extends 
ParallelStatsDisabledIT {
 "pk INTEGER PRIMARY KEY,"
 + "c1 INTEGER DEFAULT 1 + 9,"
 + "c2 DOUBLE DEFAULT SQRT(91506.25),"
-+ "c3 DECIMAL DEFAULT TO_NUMBER('$123.33', '\u00A4###.##'),"
++ "c3 DECIMAL DEFAULT TO_NUMBER('" + DEFAULT_CURRENCY_SYMBOL + 
"123.33', '\u00A4###.##'),"
 + "c4 VARCHAR DEFAULT 'AB' || 'CD',"
 + "c5 CHAR(5) DEFAULT 'E' || 'F',"
 + "c6 INTEGER DEFAULT \"MONTH\"(TO_TIMESTAMP('2015-6-05'))"
@@ -599,7 +602,7 @@ public class DefaultColumnValueIT extends 
ParallelStatsDisabledIT {
 "pk INTEGER NOT NULL,"
 + "c1 INTEGER NOT NULL DEFAULT 1 + 9,"
 + "c2 DOUBLE NOT NULL DEFAULT SQRT(91506.25),"
-+ "c3 DECIMAL NOT NULL DEFAULT TO_NUMBER('$123.33', 
'\u00A4###.##'),"
++ "c3 DECIMAL NOT NULL DEFAULT TO_NUMBER('" + 
DEFAULT_CURRENCY_SYMBOL + "123.33', '\u00A4###.##'),"
 + "c4 VARCHAR NOT NULL DEFAULT 'AB' || 'CD',"
 + "c5 CHAR(5) NOT NULL DEFAULT 'E' || 'F',"
 + "c6 INTEGER NOT NULL DEFAULT 
\"MONTH\"(TO_TIMESTAMP('2015-6-05')),"
@@ -1045,7 +1048,7 @@ public class DefaultColumnValueIT extends 
ParallelStatsDisabledIT {
 "pk INTEGER PRIMARY KEY,"
 + "c1 INTEGER DEFAULT 1 + 9,"
 + "c2 DOUBLE DEFAULT SQRT(91506.25),"
-+ "c3 DECIMAL DEFAULT TO_NUMBER('$123.33', '\u00A4###.##'),"
++ "c3 DECIMAL DEFAULT TO_NUMBER('" + DEFAULT_CURRENCY_SYMBOL + 
"123.33', '\u00A4###.##'),"
 + "c4 VARCHAR DEFAULT 'AB' || 'CD',"
 + "c5 CHAR(5) DEFAULT 'E' || 'F',"
 + "c6 INTEGER DEFAULT \"MONTH\"(TO_TIMESTAMP('2015-6-05'))"



[16/50] [abbrv] phoenix git commit: PHOENIX-4386 Calculate the estimatedSize of MutationState using Map<TableRef, Map<ImmutableBytesPtr, RowMutationState>> mutations (addendum)

2018-01-19 Thread tdsilva
PHOENIX-4386 Calculate the estimatedSize of MutationState using Map> mutations (addendum)


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

Branch: refs/heads/system-catalog
Commit: 4e0c0a33ed8b401f7785dde8979041dd5ab9a1f4
Parents: c216b66
Author: Thomas D'Silva 
Authored: Mon Nov 20 19:13:53 2017 -0800
Committer: Thomas D'Silva 
Committed: Tue Nov 21 12:26:13 2017 -0800

--
 .../apache/phoenix/execute/PartialCommitIT.java |   5 +-
 .../apache/phoenix/compile/DeleteCompiler.java  |  11 +-
 .../apache/phoenix/compile/UpsertCompiler.java  |   7 +-
 .../apache/phoenix/execute/MutationState.java   | 127 ---
 .../java/org/apache/phoenix/util/IndexUtil.java |   4 +-
 .../org/apache/phoenix/util/KeyValueUtil.java   |   5 +-
 6 files changed, 98 insertions(+), 61 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/4e0c0a33/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
index 10fd7f8..e5b57e3 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
@@ -33,7 +33,6 @@ import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 import java.util.Map;
@@ -52,8 +51,8 @@ import 
org.apache.hadoop.hbase.coprocessor.SimpleRegionObserver;
 import org.apache.hadoop.hbase.regionserver.wal.WALEdit;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.phoenix.end2end.BaseOwnClusterIT;
+import org.apache.phoenix.execute.MutationState.MultiRowMutationState;
 import org.apache.phoenix.hbase.index.Indexer;
-import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr;
 import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.monitoring.GlobalMetric;
 import org.apache.phoenix.monitoring.MetricType;
@@ -285,7 +284,7 @@ public class PartialCommitIT extends BaseOwnClusterIT {
 private PhoenixConnection 
getConnectionWithTableOrderPreservingMutationState() throws SQLException {
 Connection con = driver.connect(url, new Properties());
 PhoenixConnection phxCon = new 
PhoenixConnection(con.unwrap(PhoenixConnection.class));
-final 
Map> mutations = 
Maps.newTreeMap(new TableRefComparator());
+final Map mutations = 
Maps.newTreeMap(new TableRefComparator());
 // passing a null mutation state forces the 
connection.newMutationState() to be used to create the MutationState
 return new PhoenixConnection(phxCon, null) {
 @Override

http://git-wip-us.apache.org/repos/asf/phoenix/blob/4e0c0a33/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
index f9ca300..a06e2ca 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
@@ -26,7 +26,6 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 
 import org.apache.hadoop.hbase.Cell;
@@ -43,6 +42,7 @@ import org.apache.phoenix.exception.SQLExceptionCode;
 import org.apache.phoenix.exception.SQLExceptionInfo;
 import org.apache.phoenix.execute.AggregatePlan;
 import org.apache.phoenix.execute.MutationState;
+import org.apache.phoenix.execute.MutationState.MultiRowMutationState;
 import org.apache.phoenix.execute.MutationState.RowMutationState;
 import org.apache.phoenix.filter.SkipScanFilter;
 import org.apache.phoenix.hbase.index.ValueGetter;
@@ -91,7 +91,6 @@ import org.apache.phoenix.util.ScanUtil;
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
 import com.sun.istack.NotNull;
 
 public class DeleteCompiler {
@@ -121,14 +120,14 @@ public class DeleteCompiler {
 final int maxSize = 

[01/50] [abbrv] phoenix git commit: PHOENIX-4198 Remove the need for users to have access to the Phoenix SYSTEM tables to create tables

2018-01-19 Thread tdsilva
Repository: phoenix
Updated Branches:
  refs/heads/system-catalog ae359fec1 -> 15d4dace4


http://git-wip-us.apache.org/repos/asf/phoenix/blob/217867c7/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/PhoenixAccessController.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/PhoenixAccessController.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/PhoenixAccessController.java
new file mode 100644
index 000..8437b37
--- /dev/null
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/PhoenixAccessController.java
@@ -0,0 +1,628 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.coprocessor;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.security.PrivilegedExceptionAction;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.AuthUtil;
+import org.apache.hadoop.hbase.CoprocessorEnvironment;
+import org.apache.hadoop.hbase.DoNotRetryIOException;
+import org.apache.hadoop.hbase.HColumnDescriptor;
+import org.apache.hadoop.hbase.HTableDescriptor;
+import org.apache.hadoop.hbase.NamespaceDescriptor;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.ClusterConnection;
+import org.apache.hadoop.hbase.client.Connection;
+import org.apache.hadoop.hbase.client.ConnectionFactory;
+import org.apache.hadoop.hbase.coprocessor.BaseMasterAndRegionObserver;
+import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment;
+import org.apache.hadoop.hbase.coprocessor.ObserverContext;
+import org.apache.hadoop.hbase.ipc.PayloadCarryingRpcController;
+import org.apache.hadoop.hbase.ipc.RpcServer;
+import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
+import org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos;
+import 
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService;
+import org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost;
+import org.apache.hadoop.hbase.security.AccessDeniedException;
+import org.apache.hadoop.hbase.security.User;
+import org.apache.hadoop.hbase.security.UserProvider;
+import org.apache.hadoop.hbase.security.access.AccessControlClient;
+import org.apache.hadoop.hbase.security.access.AuthResult;
+import org.apache.hadoop.hbase.security.access.Permission;
+import org.apache.hadoop.hbase.security.access.Permission.Action;
+import org.apache.hadoop.hbase.security.access.UserPermission;
+import org.apache.hadoop.hbase.util.Bytes;
+import 
org.apache.phoenix.coprocessor.PhoenixMetaDataCoprocessorHost.PhoenixMetaDataControllerEnvironment;
+import org.apache.phoenix.query.QueryServices;
+import org.apache.phoenix.query.QueryServicesOptions;
+import org.apache.phoenix.schema.PIndexState;
+import org.apache.phoenix.schema.PTable;
+import org.apache.phoenix.schema.PTableType;
+import org.apache.phoenix.util.MetaDataUtil;
+
+import com.google.common.collect.Lists;
+import com.google.protobuf.RpcCallback;
+
+public class PhoenixAccessController extends BaseMetaDataEndpointObserver {
+
+private PhoenixMetaDataControllerEnvironment env;
+private ArrayList accessControllers;
+private boolean accessCheckEnabled;
+private UserProvider userProvider;
+private boolean isAutomaticGrantEnabled;
+private boolean isStrictMode;
+public static final Log LOG = 
LogFactory.getLog(PhoenixAccessController.class);
+private static final Log AUDITLOG =
+
LogFactory.getLog("SecurityLogger."+PhoenixAccessController.class.getName());
+
+private List getAccessControllers() throws 
IOException {
+if (accessControllers == null) {
+synchronized (this) {
+if (accessControllers == null) {
+accessControllers = new 
ArrayList();
+RegionCoprocessorHost cpHost = 
this.env.getCoprocessorHost();
+List 

svn commit: r24326 - in /release/phoenix: apache-phoenix-4.13.1-HBase-0.98/bin/ apache-phoenix-4.13.1-HBase-0.98/src/ apache-phoenix-4.13.1-HBase-1.1/bin/ apache-phoenix-4.13.1-HBase-1.1/src/ apache-p

2018-01-19 Thread elserj
Author: elserj
Date: Fri Jan 19 16:59:54 2018
New Revision: 24326

Log:
Supplement .sha files with explicit .sha256 and .sha512 files

This is an update to better follow the policy set forth at
https://www.apache.org/dev/release-distribution#sigs-and-sums.

Added:

release/phoenix/apache-phoenix-4.13.1-HBase-0.98/bin/apache-phoenix-4.13.1-HBase-0.98-bin.tar.gz.sha256

release/phoenix/apache-phoenix-4.13.1-HBase-0.98/bin/apache-phoenix-4.13.1-HBase-0.98-bin.tar.gz.sha512

release/phoenix/apache-phoenix-4.13.1-HBase-0.98/src/apache-phoenix-4.13.1-HBase-0.98-src.tar.gz.sha256

release/phoenix/apache-phoenix-4.13.1-HBase-0.98/src/apache-phoenix-4.13.1-HBase-0.98-src.tar.gz.sha512

release/phoenix/apache-phoenix-4.13.1-HBase-1.1/bin/apache-phoenix-4.13.1-HBase-1.1-bin.tar.gz.sha256

release/phoenix/apache-phoenix-4.13.1-HBase-1.1/bin/apache-phoenix-4.13.1-HBase-1.1-bin.tar.gz.sha512

release/phoenix/apache-phoenix-4.13.1-HBase-1.1/src/apache-phoenix-4.13.1-HBase-1.1-src.tar.gz.sha256

release/phoenix/apache-phoenix-4.13.1-HBase-1.1/src/apache-phoenix-4.13.1-HBase-1.1-src.tar.gz.sha512

release/phoenix/apache-phoenix-4.13.1-HBase-1.2/bin/apache-phoenix-4.13.1-HBase-1.2-bin.tar.gz.sha256

release/phoenix/apache-phoenix-4.13.1-HBase-1.2/bin/apache-phoenix-4.13.1-HBase-1.2-bin.tar.gz.sha512

release/phoenix/apache-phoenix-4.13.1-HBase-1.2/src/apache-phoenix-4.13.1-HBase-1.2-src.tar.gz.sha256

release/phoenix/apache-phoenix-4.13.1-HBase-1.2/src/apache-phoenix-4.13.1-HBase-1.2-src.tar.gz.sha512

release/phoenix/apache-phoenix-4.13.1-HBase-1.3/bin/apache-phoenix-4.13.1-HBase-1.3-bin.tar.gz.sha256

release/phoenix/apache-phoenix-4.13.1-HBase-1.3/bin/apache-phoenix-4.13.1-HBase-1.3-bin.tar.gz.sha512

release/phoenix/apache-phoenix-4.13.1-HBase-1.3/src/apache-phoenix-4.13.1-HBase-1.3-src.tar.gz.sha256

release/phoenix/apache-phoenix-4.13.1-HBase-1.3/src/apache-phoenix-4.13.1-HBase-1.3-src.tar.gz.sha512

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/bin/apache-phoenix-4.13.2-cdh5.11.2-bin.tar.gz.sha256

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/bin/apache-phoenix-4.13.2-cdh5.11.2-bin.tar.gz.sha512

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/parcels/APACHE_PHOENIX-4.13.2-cdh5.11.2.p0.0-el5.parcel.sha256

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/parcels/APACHE_PHOENIX-4.13.2-cdh5.11.2.p0.0-el5.parcel.sha512

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/parcels/APACHE_PHOENIX-4.13.2-cdh5.11.2.p0.0-el6.parcel.sha256

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/parcels/APACHE_PHOENIX-4.13.2-cdh5.11.2.p0.0-el6.parcel.sha512

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/parcels/APACHE_PHOENIX-4.13.2-cdh5.11.2.p0.0-el7.parcel.sha256

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/parcels/APACHE_PHOENIX-4.13.2-cdh5.11.2.p0.0-el7.parcel.sha512

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/parcels/APACHE_PHOENIX-4.13.2-cdh5.11.2.p0.0-jessie.parcel.sha256

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/parcels/APACHE_PHOENIX-4.13.2-cdh5.11.2.p0.0-jessie.parcel.sha512

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/parcels/APACHE_PHOENIX-4.13.2-cdh5.11.2.p0.0-precise.parcel.sha256

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/parcels/APACHE_PHOENIX-4.13.2-cdh5.11.2.p0.0-precise.parcel.sha512

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/parcels/APACHE_PHOENIX-4.13.2-cdh5.11.2.p0.0-sles11.parcel.sha256

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/parcels/APACHE_PHOENIX-4.13.2-cdh5.11.2.p0.0-sles11.parcel.sha512

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/parcels/APACHE_PHOENIX-4.13.2-cdh5.11.2.p0.0-sles12.parcel.sha256

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/parcels/APACHE_PHOENIX-4.13.2-cdh5.11.2.p0.0-sles12.parcel.sha512

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/parcels/APACHE_PHOENIX-4.13.2-cdh5.11.2.p0.0-trusty.parcel.sha256

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/parcels/APACHE_PHOENIX-4.13.2-cdh5.11.2.p0.0-trusty.parcel.sha512

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/parcels/APACHE_PHOENIX-4.13.2-cdh5.11.2.p0.0-wheezy.parcel.sha256

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/parcels/APACHE_PHOENIX-4.13.2-cdh5.11.2.p0.0-wheezy.parcel.sha512

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/parcels/APACHE_PHOENIX-4.13.2-cdh5.11.2.p0.0-xenial.parcel.sha256

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/parcels/APACHE_PHOENIX-4.13.2-cdh5.11.2.p0.0-xenial.parcel.sha512

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/src/apache-phoenix-4.13.2-cdh5.11.2-src.tar.gz.sha256

release/phoenix/apache-phoenix-4.13.2-cdh5.11.2/src/apache-phoenix-4.13.2-cdh5.11.2-src.tar.gz.sha512

Added: 
release/phoenix/apache-phoenix-4.13.1-HBase-0.98/bin/apache-phoenix-4.13.1-HBase-0.98-bin.tar.gz.sha256
==
--- 

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

2018-01-19 Thread Apache Jenkins Server
See 


--
Started by timer
[EnvInject] - Loading node environment variables.
Building remotely on ubuntu-eu2 (ubuntu trusty) in workspace 

[Phoenix_Compile_Compat_wHBase] $ /bin/bash /tmp/jenkins1301480361309253579.sh
core file size  (blocks, -c) 0
data seg size   (kbytes, -d) unlimited
scheduling priority (-e) 0
file size   (blocks, -f) unlimited
pending signals (-i) 64082
max locked memory   (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files  (-n) 6
pipe size(512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority  (-r) 0
stack size  (kbytes, -s) 8192
cpu time   (seconds, -t) unlimited
max user processes  (-u) 10240
virtual memory  (kbytes, -v) unlimited
file locks  (-x) unlimited
core id : 0
physical id : 0
physical id : 1
physical id : 2
physical id : 3
MemTotal:   16433500 kB
MemFree: 2669456 kB
Filesystem  Size  Used Avail Use% Mounted on
udev7.9G   12K  7.9G   1% /dev
tmpfs   1.6G  744K  1.6G   1% /run
/dev/vda1   394G  365G   13G  97% /
none4.0K 0  4.0K   0% /sys/fs/cgroup
none5.0M 0  5.0M   0% /run/lock
none7.9G   20M  7.9G   1% /run/shm
none100M 0  100M   0% /run/user
apache-maven-2.2.1
apache-maven-3.0.4
apache-maven-3.0.5
apache-maven-3.2.1
apache-maven-3.2.5
apache-maven-3.3.3
apache-maven-3.3.9
apache-maven-3.5.0
apache-maven-3.5.2
latest
latest2
latest3


===
Verifying compile level compatibility with HBase 0.98 with Phoenix 
4.x-HBase-0.98
===

Cloning into 'hbase'...
Switched to a new branch '0.98'
Branch 0.98 set up to track remote branch 0.98 from origin.

main:
 [exec] 
~/jenkins-slave/workspace/Phoenix_Compile_Compat_wHBase/hbase/hbase-common 
~/jenkins-slave/workspace/Phoenix_Compile_Compat_wHBase/hbase/hbase-common
 [exec] 
~/jenkins-slave/workspace/Phoenix_Compile_Compat_wHBase/hbase/hbase-common

main:
[mkdir] Created dir: 

 [exec] tar: hadoop-snappy-nativelibs.tar: Cannot open: No such file or 
directory
 [exec] tar: Error is not recoverable: exiting now
 [exec] Result: 2

main:
[mkdir] Created dir: 

 [copy] Copying 20 files to 

[mkdir] Created dir: 

[mkdir] Created dir: 


main:
[mkdir] Created dir: 

 [copy] Copying 17 files to 

[mkdir] Created dir: 


main:
[mkdir] Created dir: 

 [copy] Copying 1 file to 

[mkdir] Created dir: 


HBase pom.xml:

Got HBase version as 0.98.25-SNAPSHOT
Cloning into 'phoenix'...
Switched to a new branch '4.x-HBase-0.98'
Branch 4.x-HBase-0.98 set up to track remote branch 4.x-HBase-0.98 from origin.
ANTLR Parser Generator  Version 3.5.2
Output file 

 does not exist: must build 

PhoenixSQL.g


===
Verifying compile level compatibility with HBase branch-1.3 with Phoenix master