[2/3] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization

2016-10-03 Thread jamestaylor
PHOENIX-3253 Make changes to tests to support method level parallelization


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

Branch: refs/heads/4.x-HBase-0.98
Commit: d5b3bcedf34e716a54038410e29dafb21ac05ccf
Parents: 577a6de
Author: James Taylor 
Authored: Sun Oct 2 11:10:14 2016 -0700
Committer: James Taylor 
Committed: Mon Oct 3 09:51:06 2016 -0700

--
 .../phoenix/end2end/FlappingLocalIndexIT.java   | 300 +
 .../phoenix/end2end/index/BaseLocalIndexIT.java |  80 +
 .../phoenix/end2end/index/LocalIndexIT.java | 299 +
 .../phoenix/tx/FlappingTransactionIT.java   | 328 ++
 .../phoenix/tx/NotThreadSafeTransactionIT.java  | 331 ---
 pom.xml |   4 +-
 6 files changed, 712 insertions(+), 630 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d5b3bced/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java
new file mode 100644
index 000..7509997
--- /dev/null
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java
@@ -0,0 +1,300 @@
+/*
+ * 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.ResultSet;
+import java.util.Properties;
+
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.HBaseAdmin;
+import org.apache.hadoop.hbase.client.HTable;
+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.util.Bytes;
+import org.apache.hadoop.hbase.util.Pair;
+import org.apache.phoenix.end2end.index.BaseLocalIndexIT;
+import org.apache.phoenix.query.QueryConstants;
+import org.apache.phoenix.query.QueryServices;
+import org.apache.phoenix.util.QueryUtil;
+import org.apache.phoenix.util.SchemaUtil;
+import org.apache.phoenix.util.TestUtil;
+import org.junit.Test;
+
+public class FlappingLocalIndexIT extends BaseLocalIndexIT {
+
+public FlappingLocalIndexIT(boolean isNamespaceMapped) {
+super(isNamespaceMapped);
+}
+
+@Test
+public void testScanWhenATableHasMultipleLocalIndexes() throws Exception {
+String tableName = schemaName + "." + generateUniqueName();
+String indexName = "IDX_" + generateUniqueName();
+
+createBaseTable(tableName, null, "('e','i','o')");
+Connection conn1 = DriverManager.getConnection(getUrl());
+try {
+conn1.createStatement().execute("UPSERT INTO " + tableName + " 
values('b',1,2,4,'z')");
+conn1.createStatement().execute("UPSERT INTO " + tableName + " 
values('f',1,2,3,'a')");
+conn1.createStatement().execute("UPSERT INTO " + tableName + " 
values('j',2,4,2,'a')");
+conn1.createStatement().execute("UPSERT INTO " + tableName + " 
values('q',3,1,1,'c')");
+conn1.commit();
+conn1.createStatement().execute("CREATE LOCAL INDEX " + indexName 
+ " ON " + tableName + "(v1)");
+conn1.createStatement().execute("CREATE LOCAL INDEX " + indexName 
+ "2 ON " + tableName + "(k3)");
+conn1.commit();
+conn1 = DriverManager.getConnection(getUrl());
+ResultSet rs = conn1.createStatement().executeQuery("SELECT 
COUNT(*) FROM " + tableName);
+

[2/3] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization

2016-10-03 Thread jamestaylor
PHOENIX-3253 Make changes to tests to support method level parallelization


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

Branch: refs/heads/4.x-HBase-1.1
Commit: 7f1ccc2125be4a6d900f47113f09d7c0a4dba601
Parents: ddce0bf
Author: James Taylor 
Authored: Sun Oct 2 11:10:14 2016 -0700
Committer: James Taylor 
Committed: Mon Oct 3 09:16:21 2016 -0700

--
 .../phoenix/end2end/FlappingLocalIndexIT.java   | 300 +
 .../phoenix/end2end/index/BaseLocalIndexIT.java |  80 +
 .../phoenix/end2end/index/LocalIndexIT.java | 299 +
 .../phoenix/tx/FlappingTransactionIT.java   | 328 ++
 .../phoenix/tx/NotThreadSafeTransactionIT.java  | 331 ---
 pom.xml |   4 +-
 6 files changed, 712 insertions(+), 630 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/7f1ccc21/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java
new file mode 100644
index 000..7509997
--- /dev/null
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java
@@ -0,0 +1,300 @@
+/*
+ * 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.ResultSet;
+import java.util.Properties;
+
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.HBaseAdmin;
+import org.apache.hadoop.hbase.client.HTable;
+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.util.Bytes;
+import org.apache.hadoop.hbase.util.Pair;
+import org.apache.phoenix.end2end.index.BaseLocalIndexIT;
+import org.apache.phoenix.query.QueryConstants;
+import org.apache.phoenix.query.QueryServices;
+import org.apache.phoenix.util.QueryUtil;
+import org.apache.phoenix.util.SchemaUtil;
+import org.apache.phoenix.util.TestUtil;
+import org.junit.Test;
+
+public class FlappingLocalIndexIT extends BaseLocalIndexIT {
+
+public FlappingLocalIndexIT(boolean isNamespaceMapped) {
+super(isNamespaceMapped);
+}
+
+@Test
+public void testScanWhenATableHasMultipleLocalIndexes() throws Exception {
+String tableName = schemaName + "." + generateUniqueName();
+String indexName = "IDX_" + generateUniqueName();
+
+createBaseTable(tableName, null, "('e','i','o')");
+Connection conn1 = DriverManager.getConnection(getUrl());
+try {
+conn1.createStatement().execute("UPSERT INTO " + tableName + " 
values('b',1,2,4,'z')");
+conn1.createStatement().execute("UPSERT INTO " + tableName + " 
values('f',1,2,3,'a')");
+conn1.createStatement().execute("UPSERT INTO " + tableName + " 
values('j',2,4,2,'a')");
+conn1.createStatement().execute("UPSERT INTO " + tableName + " 
values('q',3,1,1,'c')");
+conn1.commit();
+conn1.createStatement().execute("CREATE LOCAL INDEX " + indexName 
+ " ON " + tableName + "(v1)");
+conn1.createStatement().execute("CREATE LOCAL INDEX " + indexName 
+ "2 ON " + tableName + "(k3)");
+conn1.commit();
+conn1 = DriverManager.getConnection(getUrl());
+ResultSet rs = conn1.createStatement().executeQuery("SELECT 
COUNT(*) FROM " + tableName);
+