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

2016-09-22 Thread jamestaylor
http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/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 559c000..686b39f 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
@@ -83,7 +83,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
}
this.schemaName = TestUtil.DEFAULT_SCHEMA_NAME;
this.tableDDLOptions = optionBuilder.toString();
-   this.tableName = "T_" + generateRandomString();
+   this.tableName = "T_" + generateUniqueName();
 this.fullTableName = SchemaUtil.getTableName(schemaName, tableName);
}
 
@@ -126,7 +126,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
tableDDLOptions+=",";
tableDDLOptions+=(" SALT_BUCKETS="+saltBuckets);
}
-   String viewName = "V_" + generateRandomString();
+   String viewName = "V_" + generateUniqueName();
 String ddl = "CREATE TABLE " + fullTableName + " (k1 INTEGER NOT NULL, 
k2 INTEGER NOT NULL, k3 DECIMAL, s VARCHAR CONSTRAINT pk PRIMARY KEY (k1, k2, 
k3))" + tableDDLOptions;
 conn.createStatement().execute(ddl);
 ddl = "CREATE VIEW " + viewName + " AS SELECT * FROM " + fullTableName 
+ " WHERE k1 = 1";
@@ -180,7 +180,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 protected Pair testUpdatableViewIndex(Integer saltBuckets, 
boolean localIndex, String viewName) throws Exception {
 ResultSet rs;
 Connection conn = DriverManager.getConnection(getUrl());
-String viewIndexName1 = "I_" + generateRandomString();
+String viewIndexName1 = "I_" + generateUniqueName();
 String viewIndexPhysicalName = 
MetaDataUtil.getViewIndexName(schemaName, tableName);
 if (localIndex) {
 conn.createStatement().execute("CREATE LOCAL INDEX " + 
viewIndexName1 + " on " + viewName + "(k3)");
@@ -217,7 +217,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
 queryPlan);
 }
 
-String viewIndexName2 = "I_" + generateRandomString();
+String viewIndexName2 = "I_" + generateUniqueName();
 if (localIndex) {
 conn.createStatement().execute("CREATE LOCAL INDEX " + 
viewIndexName2 + " on " + viewName + "(s)");
 } else {

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/BinaryRowKeyIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BinaryRowKeyIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BinaryRowKeyIT.java
index 02c27cd..cc43df5 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BinaryRowKeyIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BinaryRowKeyIT.java
@@ -77,7 +77,7 @@ public class BinaryRowKeyIT extends ParallelStatsDisabledIT {
 Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 Connection conn = DriverManager.getConnection(getUrl(), props);
 try {
-String tableName = generateRandomString();
+String tableName = generateUniqueName();
 initTableValues(tableName);
 conn.setAutoCommit(true);
 conn.createStatement().execute("DELETE FROM " + tableName );
@@ -105,7 +105,7 @@ public class BinaryRowKeyIT extends ParallelStatsDisabledIT 
{
 Connection conn = DriverManager.getConnection(getUrl(), props);
 
 try {
-String tableName = generateRandomString();
+String tableName = generateUniqueName();
 initTableValues(tableName);
 String query = "SELECT * FROM " + tableName;
 PreparedStatement stmt = conn.prepareStatement(query);
@@ -131,7 +131,7 @@ public class BinaryRowKeyIT extends ParallelStatsDisabledIT 
{
 Connection conn = DriverManager.getConnection(getUrl(), props);
 
 try {
-String tableName = generateRandomString();
+String tableName = generateUniqueName();
 initTableValues(tableName);
 
 String query = "UPSERT INTO " + tableName + " (a_binary, a_string, 
b_binary) "

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/CSVCommonsLoaderIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CSVCommonsLoa

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

2016-09-22 Thread jamestaylor
http://git-wip-us.apache.org/repos/asf/phoenix/blob/44e43d7c/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java
index 6b53cd5..c61d970 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java
@@ -48,7 +48,7 @@ public class BaseTenantSpecificViewIndexIT extends 
ParallelStatsDisabledIT {
 }
 
 protected void testUpdatableView(Integer saltBuckets, boolean localIndex) 
throws Exception {
-String tableName = generateRandomString();
+String tableName = generateUniqueName();
 createBaseTable(tableName, saltBuckets, true);
 Connection conn = createTenantConnection(TENANT1_ID);
 try {
@@ -61,7 +61,7 @@ public class BaseTenantSpecificViewIndexIT extends 
ParallelStatsDisabledIT {
 }
 
 protected void testUpdatableViewNonString(Integer saltBuckets, boolean 
localIndex) throws Exception {
-String tableName = generateRandomString();
+String tableName = generateUniqueName();
 createBaseTable(tableName, saltBuckets, false);
 Connection conn = createTenantConnection(NON_STRING_TENANT_ID);
 try {
@@ -78,7 +78,7 @@ public class BaseTenantSpecificViewIndexIT extends 
ParallelStatsDisabledIT {
 }
 
 protected void testUpdatableViewsWithSameNameDifferentTenants(Integer 
saltBuckets, boolean localIndex) throws Exception {
-String tableName = generateRandomString();
+String tableName = generateUniqueName();
 createBaseTable(tableName, saltBuckets, true);
 Connection conn1 = createTenantConnection(TENANT1_ID);
 Connection conn2 = createTenantConnection(TENANT2_ID);
@@ -115,7 +115,7 @@ public class BaseTenantSpecificViewIndexIT extends 
ParallelStatsDisabledIT {
 }
 
 private String createAndPopulateTenantView(Connection conn, String 
tenantId, String baseTable, String valuePrefix) throws SQLException {
-String viewName = generateRandomString();
+String viewName = generateUniqueName();
 String ddl = "CREATE VIEW " + viewName + "(v2 VARCHAR) AS SELECT * 
FROM " + baseTable + " WHERE k1 = 1";
 conn.createStatement().execute(ddl);
 tenantViewsToDelete.add(new Pair(tenantId, viewName ));
@@ -127,7 +127,7 @@ public class BaseTenantSpecificViewIndexIT extends 
ParallelStatsDisabledIT {
 }
 
 private void createAndVerifyIndex(Connection conn, String viewName, String 
tableName, Integer saltBuckets, String tenantId, String valuePrefix, boolean 
localIndex) throws SQLException {
-String indexName = generateRandomString();
+String indexName = generateUniqueName();
 if(localIndex){
 conn.createStatement().execute("CREATE LOCAL INDEX " + indexName + 
" ON " + viewName + "(v2)");
 } else {
@@ -157,7 +157,7 @@ public class BaseTenantSpecificViewIndexIT extends 
ParallelStatsDisabledIT {
 }
 
 private void createAndVerifyIndexNonStringTenantId(Connection conn, String 
viewName, String tableName, String tenantId, String valuePrefix) throws 
SQLException {
-String indexName = generateRandomString();
+String indexName = generateUniqueName();
 conn.createStatement().execute("CREATE LOCAL INDEX " + indexName + " 
ON " + viewName + "(v2)");
 conn.createStatement().execute("UPSERT INTO " + viewName + "(k2,v1,v2) 
VALUES (-1, 'blah', 'superblah')"); // sanity check that we can upsert after 
index is there
 conn.commit();

http://git-wip-us.apache.org/repos/asf/phoenix/blob/44e43d7c/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 559c000..686b39f 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
@@ -83,7 +83,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
}
this.schemaName = TestUtil.DEFAULT_SCHEMA_NAME;
this.tableDDLOptions = optionBuilder.toString();
-   this.tableName = "T_" + generateRandomString();
+   this.tableName = "T_" + generateUniqueName();
 this.fullTableName = SchemaUtil.getTableName(schemaName, tableName);
}
 
@@ -126,7 +126,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
tableDDLOptions+=",";
 

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

2016-09-22 Thread jamestaylor
http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java
index 6b53cd5..c61d970 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseTenantSpecificViewIndexIT.java
@@ -48,7 +48,7 @@ public class BaseTenantSpecificViewIndexIT extends 
ParallelStatsDisabledIT {
 }
 
 protected void testUpdatableView(Integer saltBuckets, boolean localIndex) 
throws Exception {
-String tableName = generateRandomString();
+String tableName = generateUniqueName();
 createBaseTable(tableName, saltBuckets, true);
 Connection conn = createTenantConnection(TENANT1_ID);
 try {
@@ -61,7 +61,7 @@ public class BaseTenantSpecificViewIndexIT extends 
ParallelStatsDisabledIT {
 }
 
 protected void testUpdatableViewNonString(Integer saltBuckets, boolean 
localIndex) throws Exception {
-String tableName = generateRandomString();
+String tableName = generateUniqueName();
 createBaseTable(tableName, saltBuckets, false);
 Connection conn = createTenantConnection(NON_STRING_TENANT_ID);
 try {
@@ -78,7 +78,7 @@ public class BaseTenantSpecificViewIndexIT extends 
ParallelStatsDisabledIT {
 }
 
 protected void testUpdatableViewsWithSameNameDifferentTenants(Integer 
saltBuckets, boolean localIndex) throws Exception {
-String tableName = generateRandomString();
+String tableName = generateUniqueName();
 createBaseTable(tableName, saltBuckets, true);
 Connection conn1 = createTenantConnection(TENANT1_ID);
 Connection conn2 = createTenantConnection(TENANT2_ID);
@@ -115,7 +115,7 @@ public class BaseTenantSpecificViewIndexIT extends 
ParallelStatsDisabledIT {
 }
 
 private String createAndPopulateTenantView(Connection conn, String 
tenantId, String baseTable, String valuePrefix) throws SQLException {
-String viewName = generateRandomString();
+String viewName = generateUniqueName();
 String ddl = "CREATE VIEW " + viewName + "(v2 VARCHAR) AS SELECT * 
FROM " + baseTable + " WHERE k1 = 1";
 conn.createStatement().execute(ddl);
 tenantViewsToDelete.add(new Pair(tenantId, viewName ));
@@ -127,7 +127,7 @@ public class BaseTenantSpecificViewIndexIT extends 
ParallelStatsDisabledIT {
 }
 
 private void createAndVerifyIndex(Connection conn, String viewName, String 
tableName, Integer saltBuckets, String tenantId, String valuePrefix, boolean 
localIndex) throws SQLException {
-String indexName = generateRandomString();
+String indexName = generateUniqueName();
 if(localIndex){
 conn.createStatement().execute("CREATE LOCAL INDEX " + indexName + 
" ON " + viewName + "(v2)");
 } else {
@@ -157,7 +157,7 @@ public class BaseTenantSpecificViewIndexIT extends 
ParallelStatsDisabledIT {
 }
 
 private void createAndVerifyIndexNonStringTenantId(Connection conn, String 
viewName, String tableName, String tenantId, String valuePrefix) throws 
SQLException {
-String indexName = generateRandomString();
+String indexName = generateUniqueName();
 conn.createStatement().execute("CREATE LOCAL INDEX " + indexName + " 
ON " + viewName + "(v2)");
 conn.createStatement().execute("UPSERT INTO " + viewName + "(k2,v1,v2) 
VALUES (-1, 'blah', 'superblah')"); // sanity check that we can upsert after 
index is there
 conn.commit();

http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/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 559c000..686b39f 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
@@ -83,7 +83,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
}
this.schemaName = TestUtil.DEFAULT_SCHEMA_NAME;
this.tableDDLOptions = optionBuilder.toString();
-   this.tableName = "T_" + generateRandomString();
+   this.tableName = "T_" + generateUniqueName();
 this.fullTableName = SchemaUtil.getTableName(schemaName, tableName);
}
 
@@ -126,7 +126,7 @@ public abstract class BaseViewIT extends 
ParallelStatsEnabledIT {
tableDDLOptions+=",";