http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/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 dc22ff8..e9c0c55 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
@@ -60,12 +60,12 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Before
     public void generateTableName() {
-        baseTableName = generateRandomString();
+        baseTableName = generateUniqueName();
     }
     
     @Test
     public void noOrder() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (pk VARCHAR NOT NULL PRIMARY 
KEY)";
         runQueryTest(ddl, "pk", new Object[][]{{"a"}, {"b"}, {"c"}}, new 
Object[][]{{"a"}, {"b"}, {"c"}},
             table);
@@ -73,7 +73,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
 
     @Test
     public void noOrderCompositePK() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (oid CHAR(2) NOT NULL, code 
INTEGER NOT NULL constraint pk primary key (oid, code))";
         Object[][] rows = new Object[][]{{"o1", 1}, {"o2", 2}, {"o3", 3}};
         runQueryTest(ddl, upsert("oid", "code"), rows, rows, table);
@@ -81,7 +81,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void ascOrderInlinePK() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (pk VARCHAR NOT NULL PRIMARY 
KEY ASC)";
         runQueryTest(ddl, "pk", new Object[][]{{"a"}, {"b"}, {"c"}}, new 
Object[][]{{"a"}, {"b"}, {"c"}},
             table);
@@ -89,7 +89,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void ascOrderCompositePK() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (oid CHAR(2) NOT NULL, code 
INTEGER NOT NULL constraint pk primary key (oid ASC, code DESC))";
         Object[][] insertedRows = new Object[][]{{"o1", 1}, {"o1", 2}, {"o1", 
3}};
         Object[][] expectedRows = new Object[][]{{"o1", 3}, {"o1", 2}, {"o1", 
1}};
@@ -98,7 +98,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
 
     @Test
     public void descOrderInlinePK() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         for (String type : new String[]{"CHAR(2)", "VARCHAR"}) {
             String ddl = "CREATE table " + table + " (pk ${type} NOT NULL 
PRIMARY KEY DESC)".replace("${type}", type);
             runQueryTest(ddl, "pk", new Object[][]{{"aa"}, {"bb"}, {"cc"}}, 
new Object[][]{{"cc"}, {"bb"}, {"aa"}},
@@ -108,7 +108,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void descOrderCompositePK1() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (oid CHAR(2) NOT NULL, code 
INTEGER NOT NULL constraint pk primary key (oid DESC, code))";
         Object[][] insertedRows = new Object[][]{{"o1", 1}, {"o2", 2}, {"o3", 
3}};
         Object[][] expectedRows = new Object[][]{{"o3", 3}, {"o2", 2}, {"o1", 
1}};
@@ -117,7 +117,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void descOrderCompositePK2() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (oid CHAR(2) NOT NULL, code 
INTEGER NOT NULL constraint pk primary key (oid DESC, code DESC))";
         Object[][] insertedRows = new Object[][]{{"o1", 1}, {"o1", 2}, {"o1", 
3}};
         Object[][] expectedRows = new Object[][]{{"o1", 3}, {"o1", 2}, {"o1", 
1}};
@@ -126,7 +126,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
 
     @Test
     public void equalityDescInlinePK() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (pk VARCHAR NOT NULL PRIMARY 
KEY DESC)";
         runQueryTest(ddl, upsert("pk"), new Object[][]{{"a"}, {"b"}, {"c"}}, 
new Object[][]{{"b"}}, new WhereCondition("pk", "=", "'b'"),
             table);
@@ -134,7 +134,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void equalityDescCompositePK1() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (oid CHAR(2) NOT NULL, code 
INTEGER 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}}, new WhereCondition("oid", "=", "'o2'"),
@@ -143,7 +143,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void equalityDescCompositePK2() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (oid CHAR(2) NOT NULL, code 
INTEGER NOT NULL constraint pk primary key (oid DESC, code DESC))";
         Object[][] insertedRows = new Object[][]{{"o1", 1}, {"o1", 2}, {"o1", 
3}};
         runQueryTest(ddl, upsert("oid", "code"), insertedRows, new 
Object[][]{{"o1", 2}}, new WhereCondition("code", "=", "2"),
@@ -152,7 +152,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void inDescCompositePK1() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (oid CHAR(2) NOT NULL, code 
INTEGER NOT NULL constraint pk primary key (oid DESC, code DESC))";
         Object[][] insertedRows = new Object[][]{{"o1", 1}, {"o1", 2}, {"o1", 
3}};
         runQueryTest(ddl, upsert("oid", "code"), insertedRows, new 
Object[][]{{"o1", 2}}, new WhereCondition("code", "IN", "(2)"),
@@ -161,7 +161,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void inDescCompositePK2() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (oid CHAR(2) NOT NULL, code 
INTEGER 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}}, new WhereCondition("oid", "IN", "('o2')"),
@@ -170,7 +170,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void likeDescCompositePK1() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (oid CHAR(2) NOT NULL, code 
INTEGER NOT NULL constraint pk primary key (oid DESC, code DESC))";
         Object[][] insertedRows = new Object[][]{{"a1", 1}, {"b2", 2}, {"c3", 
3}};
         runQueryTest(ddl, upsert("oid", "code"), insertedRows, new 
Object[][]{{"b2", 2}}, new WhereCondition("oid", "LIKE", "('b%')"),
@@ -179,7 +179,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void likeDescCompositePK2() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (oid CHAR(2) NOT NULL, code 
CHAR(2) NOT NULL constraint pk primary key (oid DESC, code DESC))";
         Object[][] insertedRows = new Object[][]{{"a1", "11"}, {"b2", "22"}, 
{"c3", "33"}};
         runQueryTest(ddl, upsert("oid", "code"), insertedRows, new 
Object[][]{{"b2", "22"}}, new WhereCondition("code", "LIKE", "('2%')"),
@@ -188,7 +188,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void greaterThanDescCompositePK3() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (oid CHAR(2) NOT NULL, code 
INTEGER NOT NULL constraint pk primary key (oid DESC, code DESC))";
         Object[][] insertedRows = new Object[][]{{"o1", 1}, {"o1", 2}, {"o1", 
3}};
         Object[][] expectedRows = new Object[][]{{"o1", 2}, {"o1", 1}};
@@ -198,7 +198,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void substrDescCompositePK1() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (oid CHAR(3) NOT NULL, code 
INTEGER NOT NULL constraint pk primary key (oid DESC, code ASC))";
         Object[][] insertedRows = new Object[][]{{"ao1", 1}, {"bo2", 2}, 
{"co3", 3}};
         Object[][] expectedRows = new Object[][]{{"co3", 3}, {"bo2", 2}};
@@ -208,7 +208,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
         
     @Test
     public void substrDescCompositePK2() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (oid CHAR(4) NOT NULL, code 
INTEGER NOT NULL constraint pk primary key (oid DESC, code ASC))";
         Object[][] insertedRows = new Object[][]{{"aaaa", 1}, {"bbbb", 2}, 
{"cccd", 3}};
         Object[][] expectedRows = new Object[][]{{"cccd", 3}};
@@ -218,7 +218,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void substrFixedLengthDescPK1() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (oid CHAR(3) PRIMARY KEY 
DESC)";
         Object[][] insertedRows = new Object[][]{{"a"}, {"ab"}};
         Object[][] expectedRows = new Object[][]{{"ab"}, {"a"} };
@@ -228,7 +228,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
         
     @Test
     public void substrVarLengthDescPK1() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (oid VARCHAR PRIMARY KEY 
DESC)";
         Object[][] insertedRows = new Object[][]{{"a"}, {"ab"}};
         Object[][] expectedRows = new Object[][]{{"ab"}, {"a"} };
@@ -238,7 +238,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
         
     @Test
     public void likeVarLengthDescPK1() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (oid VARCHAR PRIMARY KEY 
DESC)";
         Object[][] insertedRows = new Object[][]{{"a"}, {"ab"}};
         Object[][] expectedRows = new Object[][]{{"ab"}, {"a"} };
@@ -248,7 +248,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
         
     @Test
     public void likeFixedLengthDescPK1() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (oid CHAR(3) PRIMARY KEY 
DESC)";
         Object[][] insertedRows = new Object[][]{{"a"}, {"ab"}};
         Object[][] expectedRows = new Object[][]{{"ab"}, {"a"} };
@@ -258,7 +258,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
         
     @Test
     public void decimalRangeDescPK1() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (oid DECIMAL PRIMARY KEY 
DESC)";
         Connection conn = DriverManager.getConnection(getUrl());
         conn.createStatement().execute(ddl);
@@ -284,7 +284,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
         
     @Test
     public void lTrimDescCompositePK() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (oid VARCHAR NOT NULL, code 
INTEGER NOT NULL constraint pk primary key (oid DESC, code DESC))";
         Object[][] insertedRows = new Object[][]{{" o1 ", 1}, {"  o2", 2}, {"  
o3", 3}};
         Object[][] expectedRows = new Object[][]{{"  o2", 2}};
@@ -294,7 +294,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void lPadDescCompositePK() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (oid VARCHAR NOT NULL, code 
INTEGER NOT NULL constraint pk primary key (oid DESC, code DESC))";
         Object[][] insertedRows = new Object[][]{{"aaaa", 1}, {"bbbb", 2}, 
{"cccc", 3}};
         Object[][] expectedRows = new Object[][]{{"bbbb", 2}};
@@ -304,7 +304,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
 
     @Test
     public void countDescCompositePK() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (oid CHAR(2) NOT NULL, code 
INTEGER NOT NULL constraint pk primary key (oid DESC, code ASC))";
         Object[][] insertedRows = new Object[][]{{"o1", 1}, {"o2", 2}, {"o3", 
3}};
         Object[][] expectedRows = new Object[][]{{3l}};
@@ -314,7 +314,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void sumDescCompositePK() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (n1 INTEGER NOT NULL, n2 
DECIMAL(10, 2) NOT NULL, n3 BIGINT NOT NULL " +
             "constraint pk primary key (n1 DESC, n2 DESC, n3 DESC))";
         Object[][] insertedRows = new Object[][]{{10, bdec(10.2), 21l}, {20, 
bdec(20.2), 32l}, {30, bdec(30.2), 43l}};
@@ -325,7 +325,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void avgDescCompositePK() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (n1 INTEGER NOT NULL, n2 
DECIMAL(10, 2) NOT NULL, n3 BIGINT NOT NULL " +
             "constraint pk primary key (n1 DESC, n2 DESC, n3 DESC))";
         Object[][] insertedRows = new Object[][]{{10, bdec(10.2), 21l}, {20, 
bdec(20.2), 32l}, {30, bdec(30.2), 43l}};
@@ -336,7 +336,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void minDescCompositePK() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (n1 INTEGER NOT NULL, n2 
DECIMAL(10, 2) NOT NULL, n3 BIGINT NOT NULL " +
             "constraint pk primary key (n1 DESC, n2 DESC, n3 DESC))";
         Object[][] insertedRows = new Object[][]{{10, bdec(10.2), 21l}, {20, 
bdec(20.2), 32l}, {30, bdec(30.2), 43l}};
@@ -347,7 +347,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void maxDescCompositePK() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (n1 INTEGER NOT NULL, n2 
DECIMAL(10, 2) NOT NULL, n3 BIGINT NOT NULL " +
             "constraint pk primary key (n1 DESC, n2 DESC, n3 DESC))";
         Object[][] insertedRows = new Object[][]{{10, bdec(10.2), 21l}, {20, 
bdec(20.2), 32l}, {30, bdec(30.2), 43l}};
@@ -358,7 +358,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void havingSumDescCompositePK() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (name CHAR(1) NOT NULL, code 
INTEGER NOT NULL " +
             "constraint pk primary key (name DESC, code DESC))";
         Object[][] insertedRows = new Object[][]{{"a", 10}, {"a", 20}, {"b", 
100}}; 
@@ -369,7 +369,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void queryDescDateWithExplicitOrderBy() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (c1 CHAR(1) NOT NULL, c2 
CHAR(1) NOT NULL, d1 DATE NOT NULL, c3 CHAR(1) NOT NULL " +
             "constraint pk primary key (c1, c2, d1 DESC, c3))";
         Object[] row1 = {"1", "2", date(10, 11, 2001), "3"};
@@ -381,7 +381,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void additionOnDescCompositePK() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (n1 INTEGER NOT NULL, n2 
DECIMAL(10, 2) NOT NULL, n3 BIGINT NOT NULL, d1 DATE NOT NULL " +
             "constraint pk primary key (n1 DESC, n2 DESC, n3 DESC, d1 DESC))";
         Object[][] insertedRows = new Object[][]{
@@ -394,7 +394,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void subtractionOnDescCompositePK() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (n1 INTEGER NOT NULL, n2 
DECIMAL(10, 2) NOT NULL, n3 BIGINT NOT NULL, d1 DATE NOT NULL " +
             "constraint pk primary key (n1 DESC, n2 DESC, n3 DESC, d1 DESC))";
         Object[][] insertedRows = new Object[][]{
@@ -407,7 +407,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void lessThanLeadingDescCompositePK() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (id INTEGER NOT NULL, date 
DATE NOT NULL constraint pk primary key (id DESC, date))";
         Object[][] insertedRows = new Object[][]{{1, date(1, 1, 2012)}, {3, 
date(1, 1, 2013)}, {2, date(1, 1, 2011)}};
         Object[][] expectedRows = new Object[][]{{1, date(1, 1, 2012)}};
@@ -417,7 +417,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void lessThanTrailingDescCompositePK() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (id INTEGER NOT NULL, date 
DATE NOT NULL constraint pk primary key (id DESC, date))";
         Object[][] insertedRows = new Object[][]{{1, date(1, 1, 2002)}, {3, 
date(1, 1, 2003)}, {2, date(1, 1, 2001)}};
         Object[][] expectedRows = new Object[][]{{2, date(1, 1, 2001)}};
@@ -427,7 +427,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void descVarLengthPK() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (id VARCHAR PRIMARY KEY 
DESC)";
         Object[][] insertedRows = new Object[][]{{"a"}, {"ab"}, {"abc"}};
         Object[][] expectedRows = new Object[][]{{"abc"}, {"ab"}, {"a"}};
@@ -437,7 +437,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
     
     @Test
     public void descVarLengthAscPKGT() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (k1 INTEGER NOT NULL, k2 
VARCHAR, CONSTRAINT pk PRIMARY KEY (k1, k2))";
         Object[][] insertedRows = new Object[][]{{0, null}, {1, "a"}, {2, 
"b"}, {3, "ba"}, {4, "baa"}, {5, "c"}, {6, "d"}};
         Object[][] expectedRows = new Object[][]{{3}, {4}, {5}, {6}};
@@ -447,7 +447,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
         
     @Test
     public void descVarLengthDescPKGT() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (k1 INTEGER NOT NULL, k2 
VARCHAR, CONSTRAINT pk PRIMARY KEY (k1, k2 desc))";
         Object[][] insertedRows = new Object[][]{{0, null}, {1, "a"}, {2, 
"b"}, {3, "ba"}, {4, "baa"}, {5, "c"}, {6, "d"}};
         Object[][] expectedRows = new Object[][]{{3}, {4}, {5}, {6}};
@@ -457,7 +457,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
         
     @Test
     public void descVarLengthDescPKLTE() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (k1 INTEGER NOT NULL, k2 
VARCHAR, CONSTRAINT pk PRIMARY KEY (k1, k2 desc))";
         Object[][] insertedRows = new Object[][]{{0, null}, {1, "a"}, {2, 
"b"}, {3, "ba"}, {4, "bb"}, {5, "bc"}, {6, "bba"}, {7, "c"}};
         Object[][] expectedRows = new Object[][]{{1}, {2}, {3}, {4}};
@@ -467,7 +467,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
         
     @Test
     public void descVarLengthAscPKLTE() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (k1 INTEGER NOT NULL, k2 
VARCHAR, CONSTRAINT pk PRIMARY KEY (k1, k2))";
         Object[][] insertedRows = new Object[][]{{0, null}, {1, "a"}, {2, 
"b"}, {3, "ba"}, {4, "bb"}, {5, "bc"}, {6, "bba"}, {7, "c"}};
         Object[][] expectedRows = new Object[][]{{1}, {2}, {3}, {4}};
@@ -477,7 +477,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
         
     @Test
     public void varLengthAscLT() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (k1 VARCHAR NOT NULL, k2 
VARCHAR, CONSTRAINT pk PRIMARY KEY (k1, k2))";
         Object[][] insertedRows = new Object[][]{{"a", ""}, {"b",""}, 
{"b","a"}};
         Object[][] expectedRows = new Object[][]{{"a"}};
@@ -487,7 +487,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
         
     @Test
     public void varLengthDescLT() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (k1 VARCHAR NOT NULL, k2 
VARCHAR, CONSTRAINT pk PRIMARY KEY (k1 desc, k2))";
         Object[][] insertedRows = new Object[][]{{"a", ""}, {"b",""}, 
{"b","a"}};
         Object[][] expectedRows = new Object[][]{{"a"}};
@@ -497,7 +497,7 @@ public class SortOrderIT extends ParallelStatsDisabledIT {
         
     @Test
     public void varLengthDescGT() throws Exception {
-        String table = generateRandomString();
+        String table = generateUniqueName();
         String ddl = "CREATE table " + table + " (k1 VARCHAR NOT NULL, k2 
VARCHAR, CONSTRAINT pk PRIMARY KEY (k1 desc, k2))";
         Object[][] insertedRows = new Object[][]{{"a", ""}, {"b",""}, 
{"b","a"}, {"ba","a"}};
         Object[][] expectedRows = new Object[][]{{"ba"}};

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/SpooledTmpFileDeleteIT.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SpooledTmpFileDeleteIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SpooledTmpFileDeleteIT.java
index 02a5d71..51bcb31 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SpooledTmpFileDeleteIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SpooledTmpFileDeleteIT.java
@@ -57,7 +57,7 @@ public class SpooledTmpFileDeleteIT extends 
ParallelStatsDisabledIT {
        
        @Before 
        public void setup() throws SQLException {
-               tableName = generateRandomString();
+               tableName = generateUniqueName();
                props = new Properties();
                spoolDir =  Files.createTempDir();
                props.put(QueryServices.SPOOL_DIRECTORY, spoolDir.getPath());

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/SqrtFunctionEnd2EndIT.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SqrtFunctionEnd2EndIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SqrtFunctionEnd2EndIT.java
index 1426564..657c3fd 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SqrtFunctionEnd2EndIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SqrtFunctionEnd2EndIT.java
@@ -45,8 +45,8 @@ public class SqrtFunctionEnd2EndIT extends 
ParallelStatsDisabledIT {
     public void initTable() throws Exception {
         Connection conn = null;
         PreparedStatement stmt = null;
-        testUnsignedTable = generateRandomString();
-        testSignedTable = generateRandomString();
+        testUnsignedTable = generateUniqueName();
+        testSignedTable = generateUniqueName();
         try {
             conn = DriverManager.getConnection(getUrl());
             String ddl;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatementHintsIT.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatementHintsIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatementHintsIT.java
index a0960e5..d740ae4 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatementHintsIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatementHintsIT.java
@@ -39,7 +39,7 @@ import org.junit.Test;
 
 public class StatementHintsIT extends ParallelStatsDisabledIT {
 
-    private static final String TABLE_NAME = generateRandomString();
+    private static final String TABLE_NAME = generateUniqueName();
 
     private static void initTableValues() throws Exception {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
index 9a1ea26..0b5a92d 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
@@ -89,7 +89,7 @@ public class StatsCollectorIT extends ParallelStatsEnabledIT {
     @Before
     public void generateTableNames() {
         schemaName = TestUtil.DEFAULT_SCHEMA_NAME;
-        tableName = "T_" + generateRandomString();
+        tableName = "T_" + generateUniqueName();
         fullTableName = SchemaUtil.getTableName(schemaName, tableName);
     }
 
@@ -224,7 +224,7 @@ public class StatsCollectorIT extends 
ParallelStatsEnabledIT {
 
     @Test
     public void testUpdateStatsWithMultipleTables() throws Throwable {
-        String fullTableName2 = SchemaUtil.getTableName(schemaName, "T_" + 
generateRandomString());
+        String fullTableName2 = SchemaUtil.getTableName(schemaName, "T_" + 
generateUniqueName());
         Connection conn;
         PreparedStatement stmt;
         ResultSet rs;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/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 c14cf39..bb13f1b 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
@@ -64,10 +64,10 @@ public class StoreNullsIT extends ParallelStatsDisabledIT {
 
     @Before
     public void setUp() throws SQLException {
-        WITH_NULLS = generateRandomString();
-        WITHOUT_NULLS = generateRandomString();
-        IMMUTABLE_WITH_NULLS = generateRandomString();
-        IMMUTABLE_WITHOUT_NULLS = generateRandomString();
+        WITH_NULLS = generateUniqueName();
+        WITHOUT_NULLS = generateUniqueName();
+        IMMUTABLE_WITH_NULLS = generateUniqueName();
+        IMMUTABLE_WITHOUT_NULLS = generateUniqueName();
         conn = DriverManager.getConnection(getUrl());
         conn.setAutoCommit(true);
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/StringIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/StringIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/StringIT.java
index bcf31ca..680935b 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/StringIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/StringIT.java
@@ -116,7 +116,7 @@ public class StringIT extends ParallelStatsDisabledIT {
     public void testCharPadding() throws Exception {
         ResultSet rs;
         Connection conn = DriverManager.getConnection(getUrl());
-        String tableName = generateRandomString();
+        String tableName = generateUniqueName();
         conn.createStatement().execute("CREATE TABLE " + tableName + " (k 
CHAR(3) PRIMARY KEY)");
         conn.createStatement().execute("UPSERT INTO " + tableName + " 
VALUES('a')");
         conn.createStatement().execute("UPSERT INTO " + tableName + " 
VALUES('ab')");
@@ -127,7 +127,7 @@ public class StringIT extends ParallelStatsDisabledIT {
         assertTrue(rs.next());
         assertEquals("ab", rs.getString(1));
         assertFalse(rs.next());
-        String tableNameDesc = generateRandomString();
+        String tableNameDesc = generateUniqueName();
         conn.createStatement().execute("CREATE TABLE " + tableNameDesc + " (k 
CHAR(3) PRIMARY KEY DESC)");
         conn.createStatement().execute("UPSERT INTO " + tableNameDesc + " 
VALUES('a')");
         conn.createStatement().execute("UPSERT INTO " + tableNameDesc + " 
VALUES('ab')");
@@ -144,7 +144,7 @@ public class StringIT extends ParallelStatsDisabledIT {
     public void testBinaryPadding() throws Exception {
         ResultSet rs;
         Connection conn = DriverManager.getConnection(getUrl());
-        String tableName = generateRandomString();
+        String tableName = generateUniqueName();
         conn.createStatement().execute("CREATE TABLE " + tableName + " (k 
BINARY(3) PRIMARY KEY)");
         conn.createStatement().execute("UPSERT INTO " + tableName + " 
VALUES('a')");
         conn.createStatement().execute("UPSERT INTO " + tableName + " 
VALUES('ab')");
@@ -156,7 +156,7 @@ public class StringIT extends ParallelStatsDisabledIT {
         assertArrayEquals(ByteUtil.concat(Bytes.toBytes("ab"), 
QueryConstants.SEPARATOR_BYTE_ARRAY), rs.getBytes(1));
         assertFalse(rs.next());
 
-        String tableNameDesc = generateRandomString();
+        String tableNameDesc = generateUniqueName();
         conn.createStatement().execute("CREATE TABLE " +  tableNameDesc + " (k 
BINARY(3) PRIMARY KEY DESC)");
         conn.createStatement().execute("UPSERT INTO " + tableNameDesc + " 
VALUES('a')");
         conn.createStatement().execute("UPSERT INTO " + tableNameDesc + " 
VALUES('ab')");
@@ -245,7 +245,7 @@ public class StringIT extends ParallelStatsDisabledIT {
     @Test
     public void testStrConcat() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
-        String tableName = generateRandomString();
+        String tableName = generateUniqueName();
         conn.createStatement().execute("create table " + tableName + " (PK1 
integer, F1 varchar, F2 varchar, F3 varchar, F4 varchar, constraint PK primary 
key (PK1))");
         conn.createStatement().execute("upsert into " + tableName + "(PK1, 
F1,F3) values(0, 'tortilla', 'chip')");
         conn.commit();

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/StringToArrayFunctionIT.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/StringToArrayFunctionIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/StringToArrayFunctionIT.java
index d0f45c7..c11d765 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/StringToArrayFunctionIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/StringToArrayFunctionIT.java
@@ -30,7 +30,7 @@ import org.junit.Test;
 
 public class StringToArrayFunctionIT extends ParallelStatsDisabledIT {
 
-    private static final String TABLE_NAME = generateRandomString();
+    private static final String TABLE_NAME = generateUniqueName();
 
     @BeforeClass
     public static void initTables() throws Exception {
@@ -295,7 +295,7 @@ public class StringToArrayFunctionIT extends 
ParallelStatsDisabledIT {
     public void testStringToArrayFunctionWithUpsert1() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
 
-        String tableName = generateRandomString();
+        String tableName = generateUniqueName();
         String ddl =
             "CREATE TABLE " + tableName + " (region_name VARCHAR PRIMARY 
KEY,varchars VARCHAR[])";
         conn.createStatement().execute(ddl);
@@ -320,7 +320,7 @@ public class StringToArrayFunctionIT extends 
ParallelStatsDisabledIT {
     public void testStringToArrayFunctionWithUpsert2() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
 
-        String tableName = generateRandomString();
+        String tableName = generateUniqueName();
         String ddl =
             "CREATE TABLE " + tableName + " (region_name VARCHAR PRIMARY 
KEY,varchars VARCHAR[])";
         conn.createStatement().execute(ddl);
@@ -345,12 +345,12 @@ public class StringToArrayFunctionIT extends 
ParallelStatsDisabledIT {
     public void testStringToArrayFunctionWithUpsertSelect1() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
 
-        String table1 = generateRandomString();
+        String table1 = generateUniqueName();
         String ddl =
             "CREATE TABLE " + table1 + " (region_name VARCHAR PRIMARY KEY, 
varchar VARCHAR)";
         conn.createStatement().execute(ddl);
 
-        String table2 = generateRandomString();
+        String table2 = generateUniqueName();
         ddl = "CREATE TABLE " + table2 + " (region_name VARCHAR PRIMARY KEY, 
varchars VARCHAR[])";
         conn.createStatement().execute(ddl);
 
@@ -388,13 +388,13 @@ public class StringToArrayFunctionIT extends 
ParallelStatsDisabledIT {
     public void testStringToArrayFunctionWithUpsertSelect2() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
 
-        String sourceTable = generateRandomString();
+        String sourceTable = generateUniqueName();
 
         String ddl =
             "CREATE TABLE " + sourceTable + " (region_name VARCHAR PRIMARY 
KEY, varchar VARCHAR)";
         conn.createStatement().execute(ddl);
 
-        String targetTable = generateRandomString();
+        String targetTable = generateUniqueName();
         ddl = "CREATE TABLE " + targetTable
             + " (region_name VARCHAR PRIMARY KEY, varchars VARCHAR[])";
         conn.createStatement().execute(ddl);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantIdTypeIT.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantIdTypeIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantIdTypeIT.java
index 22b3655..73b3212 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantIdTypeIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantIdTypeIT.java
@@ -78,7 +78,7 @@ public class TenantIdTypeIT extends ParallelStatsDisabledIT {
         this.dataType = dataType;
         this.tenantId = tenantId;
         this.otherTenantId = otherTenantId;
-        String tbl = generateRandomString();
+        String tbl = generateUniqueName();
         if(tbl.contains("(")){
             tbl = tbl.substring(0, tbl.indexOf("("));
         }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java
index 11eb40e..b8f8177 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java
@@ -84,10 +84,10 @@ public class TenantSpecificTablesDDLIT extends 
BaseTenantSpecificTablesIT {
     
     @Test
     public void testCreateTenantViewFromNonMultiTenant() throws Exception {
-        String tableName = generateRandomString();
+        String tableName = generateUniqueName();
         createTestTable(getUrl(), "CREATE TABLE " + tableName + " (K VARCHAR 
PRIMARY KEY)");
         try {
-            String viewName = generateRandomString();
+            String viewName = generateUniqueName();
             // Only way to get this exception is to attempt to derive from a 
global, multi-type table, as we won't find
             // a tenant-specific table when we attempt to resolve the base 
table.
             createTestTable(PHOENIX_JDBC_TENANT_SPECIFIC_URL, "CREATE VIEW " + 
viewName + " (COL VARCHAR) AS SELECT * FROM " + tableName);
@@ -99,8 +99,8 @@ public class TenantSpecificTablesDDLIT extends 
BaseTenantSpecificTablesIT {
     @Test
     public void testAlteringMultiTenancyForTableWithViewsNotAllowed() throws 
Exception {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-        String multiTenantTable = "MT_" + generateRandomString();
-        String globalTable = "G_" + generateRandomString();
+        String multiTenantTable = "MT_" + generateUniqueName();
+        String globalTable = "G_" + generateUniqueName();
         // create the two base tables
         try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
             String ddl = "CREATE TABLE " + multiTenantTable + " (TENANT_ID 
VARCHAR NOT NULL, PK1 VARCHAR NOT NULL, V1 VARCHAR, V2 VARCHAR, V3 VARCHAR 
CONSTRAINT NAME_PK PRIMARY KEY(TENANT_ID, PK1)) MULTI_TENANT = true "; 
@@ -108,18 +108,18 @@ public class TenantSpecificTablesDDLIT extends 
BaseTenantSpecificTablesIT {
             ddl = "CREATE TABLE " + globalTable + " (TENANT_ID VARCHAR NOT 
NULL, PK1 VARCHAR NOT NULL, V1 VARCHAR, V2 VARCHAR, V3 VARCHAR CONSTRAINT 
NAME_PK PRIMARY KEY(TENANT_ID, PK1)) ";
             conn.createStatement().execute(ddl);
         }
-        String t1 = generateRandomString();
+        String t1 = generateUniqueName();
         props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, t1);
         // create view on multi-tenant table
         try (Connection tenantConn = DriverManager.getConnection(getUrl(), 
props)) {
-            String viewName = "V_" + generateRandomString();
+            String viewName = "V_" + generateUniqueName();
             String viewDDL = "CREATE VIEW " + viewName + " AS SELECT * FROM " 
+ multiTenantTable;
             tenantConn.createStatement().execute(viewDDL);
         }
         props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         // create view on global table
         try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
-            String viewName = "V_" + generateRandomString();
+            String viewName = "V_" + generateUniqueName();
             conn.createStatement().execute("CREATE VIEW " + viewName + " AS 
SELECT * FROM " + globalTable);
         }
         props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
@@ -151,7 +151,7 @@ public class TenantSpecificTablesDDLIT extends 
BaseTenantSpecificTablesIT {
     
     public void testCreationOfParentTableFailsOnTenantSpecificConnection() 
throws Exception {
         try {
-            createTestTable(PHOENIX_JDBC_TENANT_SPECIFIC_URL, "CREATE TABLE " 
+ generateRandomString() + "( \n" + 
+            createTestTable(PHOENIX_JDBC_TENANT_SPECIFIC_URL, "CREATE TABLE " 
+ generateUniqueName() + "( \n" + 
                     "                user VARCHAR ,\n" + 
                     "                id INTEGER not null primary key desc\n" + 
                     "                ) ");
@@ -163,7 +163,7 @@ public class TenantSpecificTablesDDLIT extends 
BaseTenantSpecificTablesIT {
     
     @Test
     public void testTenantSpecificAndParentTablesMayBeInDifferentSchemas() 
throws SQLException {
-        String fullTableName = "DIFFSCHEMA." + generateRandomString();
+        String fullTableName = "DIFFSCHEMA." + generateUniqueName();
         createTestTable(PHOENIX_JDBC_TENANT_SPECIFIC_URL, "CREATE VIEW " + 
fullTableName + " ( \n" + 
                 "                tenant_col VARCHAR) AS SELECT * \n" + 
                 "                FROM " + PARENT_TABLE_NAME + " WHERE 
tenant_type_id = 'aaa'");
@@ -191,14 +191,14 @@ public class TenantSpecificTablesDDLIT extends 
BaseTenantSpecificTablesIT {
     
     @Test
     public void testTenantSpecificTableCanDeclarePK() throws SQLException {
-            createTestTable(PHOENIX_JDBC_TENANT_SPECIFIC_URL, "CREATE VIEW " + 
generateRandomString() + "( \n" + 
+            createTestTable(PHOENIX_JDBC_TENANT_SPECIFIC_URL, "CREATE VIEW " + 
generateUniqueName() + "( \n" + 
                     "                tenant_col VARCHAR PRIMARY KEY) AS SELECT 
*\n" + 
                     "                FROM " + PARENT_TABLE_NAME);
     }
     
     @Test(expected=ColumnAlreadyExistsException.class)
     public void testTenantSpecificTableCannotOverrideParentCol() throws 
SQLException {
-        createTestTable(PHOENIX_JDBC_TENANT_SPECIFIC_URL, "CREATE VIEW " + 
generateRandomString() + " ( \n" + 
+        createTestTable(PHOENIX_JDBC_TENANT_SPECIFIC_URL, "CREATE VIEW " + 
generateUniqueName() + " ( \n" + 
                 "                user INTEGER) AS SELECT *\n" + 
                 "                FROM " + PARENT_TABLE_NAME);
     }
@@ -208,7 +208,7 @@ public class TenantSpecificTablesDDLIT extends 
BaseTenantSpecificTablesIT {
         // only two PK columns for multi_tenant, multi_type
         try {
             createTestTable(getUrl(), 
-                    "CREATE TABLE " + generateRandomString() + 
+                    "CREATE TABLE " + generateUniqueName() + 
                     "(TENANT_ID VARCHAR NOT NULL PRIMARY KEY, ID VARCHAR, A 
INTEGER) MULTI_TENANT=true");
             fail();
         }
@@ -338,7 +338,7 @@ public class TenantSpecificTablesDDLIT extends 
BaseTenantSpecificTablesIT {
     @Test
     public void 
testAllDropParentTableWithCascadeWithMultipleTenantTablesAndIndexes() throws 
Exception {
         // Create a second tenant table
-        String tenantTable2 = "V_" + generateRandomString();
+        String tenantTable2 = "V_" + generateUniqueName();
         createTestTable(PHOENIX_JDBC_TENANT_SPECIFIC_URL2, 
TENANT_TABLE_DDL.replace(TENANT_TABLE_NAME, tenantTable2));
        //TODO Create some tenant specific table indexes
         
@@ -418,9 +418,9 @@ public class TenantSpecificTablesDDLIT extends 
BaseTenantSpecificTablesIT {
     @Test
     public void testTableMetadataScan() throws Exception {
         // create a tenant table with same name for a different tenant to make 
sure we are not picking it up in metadata scans for TENANT_ID
-        String tenantId2 = "T_" + generateRandomString();
+        String tenantId2 = "T_" + generateUniqueName();
         String secondTenatConnectionURL = 
PHOENIX_JDBC_TENANT_SPECIFIC_URL.replace(TENANT_ID,  tenantId2);
-        String tenantTable2 = "V_" + generateRandomString();
+        String tenantTable2 = "V_" + generateUniqueName();
         createTestTable(secondTenatConnectionURL, 
TENANT_TABLE_DDL.replace(TENANT_TABLE_NAME, tenantTable2));
         
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDMLIT.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDMLIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDMLIT.java
index f26e6dd..76625c0 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDMLIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDMLIT.java
@@ -361,7 +361,7 @@ public class TenantSpecificTablesDMLIT extends 
BaseTenantSpecificTablesIT {
     
     @Test
     public void 
testUpsertSelectOnlyUpsertsTenantDataWithDifferentTenantTable() throws 
Exception {
-        String anotherTableName = "V_" + generateRandomString();
+        String anotherTableName = "V_" + generateUniqueName();
         createTestTable(PHOENIX_JDBC_TENANT_SPECIFIC_URL, "CREATE VIEW " + 
anotherTableName + " ( " + 
             "tenant_col VARCHAR) AS SELECT * FROM " + PARENT_TABLE_NAME + " 
WHERE tenant_type_id = 'def'");
         

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificViewIndexIT.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificViewIndexIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificViewIndexIT.java
index dc65fa6..33c0cf2 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificViewIndexIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificViewIndexIT.java
@@ -117,8 +117,8 @@ public class TenantSpecificViewIndexIT extends 
BaseTenantSpecificViewIndexIT {
     }
 
     private void testMultiCFViewIndex(boolean localIndex, boolean 
isNamespaceEnabled) throws Exception {
-        String tableName = "XYZ." + generateRandomString();
-        String baseViewName = generateRandomString() ;
+        String tableName = "XYZ." + generateUniqueName();
+        String baseViewName = generateUniqueName() ;
         createTableAndValidate(tableName, isNamespaceEnabled);
         createViewAndIndexesWithTenantId(tableName, baseViewName, localIndex, 
"b", isNamespaceEnabled);
         createViewAndIndexesWithTenantId(tableName, baseViewName, localIndex, 
"a", isNamespaceEnabled);
@@ -248,8 +248,8 @@ public class TenantSpecificViewIndexIT extends 
BaseTenantSpecificViewIndexIT {
     public void testNonPaddedTenantId() throws Exception {
         String tenantId1 = "org1";
         String tenantId2 = "org2";
-        String tableName = generateRandomString();
-        String viewName = generateRandomString();
+        String tableName = generateUniqueName();
+        String viewName = generateUniqueName();
         String ddl = "CREATE TABLE " + tableName + " (tenantId char(15) NOT 
NULL, pk1 varchar NOT NULL, pk2 INTEGER NOT NULL, val1 VARCHAR CONSTRAINT pk 
primary key (tenantId,pk1,pk2)) MULTI_TENANT = true";
         Connection conn = DriverManager.getConnection(getUrl());
         conn.createStatement().execute(ddl);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
index 48eb87e..65d47be 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TimezoneOffsetFunctionIT.java
@@ -39,7 +39,7 @@ public class TimezoneOffsetFunctionIT extends 
ParallelStatsDisabledIT {
        @Test
        public void testTimezoneOffset() throws Exception {
                Connection conn = DriverManager.getConnection(getUrl());
-               String timezone_offset_test = generateRandomString();
+               String timezone_offset_test = generateUniqueName();
                String ddl = "CREATE TABLE IF NOT EXISTS " + 
timezone_offset_test
                                + " (k1 INTEGER NOT NULL, dates DATE CONSTRAINT 
pk PRIMARY KEY (k1))";
                conn.createStatement().execute(ddl);
@@ -64,7 +64,7 @@ public class TimezoneOffsetFunctionIT extends 
ParallelStatsDisabledIT {
        @Test
        public void testUnknownTimezone() throws Exception {
                Connection conn = DriverManager.getConnection(getUrl());
-               String timezone_offset_test = generateRandomString();
+               String timezone_offset_test = generateUniqueName();
                String ddl = "CREATE TABLE IF NOT EXISTS " + 
timezone_offset_test
                                + " (k1 INTEGER NOT NULL, dates DATE CONSTRAINT 
pk PRIMARY KEY (k1))";
                conn.createStatement().execute(ddl);
@@ -89,7 +89,7 @@ public class TimezoneOffsetFunctionIT extends 
ParallelStatsDisabledIT {
        @Test
        public void testInRowKeyDSTTimezoneDesc() throws Exception {
                Connection conn = DriverManager.getConnection(getUrl());
-               String timezone_offset_test = generateRandomString();
+               String timezone_offset_test = generateUniqueName();
                String ddl = "CREATE TABLE IF NOT EXISTS " + 
timezone_offset_test + " "
                                + "(k1 INTEGER NOT NULL, dates DATE NOT NULL 
CONSTRAINT pk PRIMARY KEY (k1, dates DESC))";
                conn.createStatement().execute(ddl);
@@ -114,7 +114,7 @@ public class TimezoneOffsetFunctionIT extends 
ParallelStatsDisabledIT {
        @Test
        public void testBothParametersNull() throws Exception {
                Connection conn = DriverManager.getConnection(getUrl());
-               String timezone_offset_test = generateRandomString();
+               String timezone_offset_test = generateUniqueName();
                String ddl = "CREATE TABLE IF NOT EXISTS " + 
timezone_offset_test + " "
                                + "(k1 INTEGER NOT NULL, dates DATE, v1 VARCHAR 
CONSTRAINT pk PRIMARY KEY (k1))";
                conn.createStatement().execute(ddl);
@@ -134,7 +134,7 @@ public class TimezoneOffsetFunctionIT extends 
ParallelStatsDisabledIT {
        @Test
        public void timezoneParameterNull() throws Exception {
                Connection conn = DriverManager.getConnection(getUrl());
-               String timezone_offset_test = generateRandomString();
+               String timezone_offset_test = generateUniqueName();
                String ddl = "CREATE TABLE IF NOT EXISTS " + 
timezone_offset_test + " "
                                + "(k1 INTEGER NOT NULL, dates DATE, v1 VARCHAR 
CONSTRAINT pk PRIMARY KEY (k1))";
                conn.createStatement().execute(ddl);
@@ -155,7 +155,7 @@ public class TimezoneOffsetFunctionIT extends 
ParallelStatsDisabledIT {
        @Test
        public void dateParameterNull() throws Exception {
                Connection conn = DriverManager.getConnection(getUrl());
-               String timezone_offset_test = generateRandomString();
+               String timezone_offset_test = generateUniqueName();
                String ddl = "CREATE TABLE IF NOT EXISTS " + 
timezone_offset_test + " "
                                + "(k1 INTEGER NOT NULL, dates DATE, v1 VARCHAR 
CONSTRAINT pk PRIMARY KEY (k1))";
                conn.createStatement().execute(ddl);
@@ -176,7 +176,7 @@ public class TimezoneOffsetFunctionIT extends 
ParallelStatsDisabledIT {
        @Test
        public void testInsertingRetrivingTimestamp() throws Exception {
            Connection conn = DriverManager.getConnection(getUrl());
-               String t = generateRandomString();
+               String t = generateUniqueName();
                String ddl = "CREATE TABLE " + t + " (K INTEGER NOT NULL 
PRIMARY KEY, V TIMESTAMP)";
         conn.createStatement().execute(ddl);
         String dml = "UPSERT INTO " + t + " VALUES (?, ?)";

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/ToCharFunctionIT.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ToCharFunctionIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ToCharFunctionIT.java
index 7181918..022197c 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ToCharFunctionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ToCharFunctionIT.java
@@ -67,7 +67,7 @@ public class ToCharFunctionIT extends ParallelStatsDisabledIT 
{
             value="DMI_BIGDECIMAL_CONSTRUCTED_FROM_DOUBLE", 
             justification="Test code.")
     public void initTable() throws Exception {
-        TO_CHAR_TABLE_NAME = generateRandomString();
+        TO_CHAR_TABLE_NAME = generateUniqueName();
         String ddl = "create table " + TO_CHAR_TABLE_NAME +
                 "(pk integer not null, \n" + 
                 "col_date date, \n" +
@@ -236,7 +236,7 @@ public class ToCharFunctionIT extends 
ParallelStatsDisabledIT {
     @Test
     public void testToCharWithCloneMethod() throws SQLException {
         Connection conn = DriverManager.getConnection(getUrl());
-        String tableName = generateRandomString();
+        String tableName = generateUniqueName();
        String ddl = "create table " + tableName + " (k varchar primary key, v 
integer[])";
         conn.createStatement().execute(ddl);
         conn.createStatement().execute("UPSERT INTO " + tableName + " 
VALUES('x',ARRAY[1234])");
@@ -250,7 +250,7 @@ public class ToCharFunctionIT extends 
ParallelStatsDisabledIT {
 
     @Test
     public void testIndexedNull() throws SQLException {
-        final String tableName = generateRandomString();
+        final String tableName = generateUniqueName();
         Connection conn = DriverManager.getConnection(getUrl());
         conn.createStatement().execute("create table " + tableName +
                 " (id integer primary key, ts1 timestamp, ts2 timestamp)");

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/ToDateFunctionIT.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ToDateFunctionIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ToDateFunctionIT.java
index 3b11419..6053ef5 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ToDateFunctionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ToDateFunctionIT.java
@@ -255,7 +255,7 @@ public class ToDateFunctionIT extends 
ParallelStatsDisabledIT {
     @Test
     public void testToDateWithCloneMethod() throws SQLException {
         Connection conn = DriverManager.getConnection(getUrl());
-        String tableName = generateRandomString();
+        String tableName = generateUniqueName();
        String ddl = "create table " + tableName + " (k varchar primary key, v 
varchar[])";
         conn.createStatement().execute(ddl);
         String dateStr = "2100-01-01";

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/TransactionalViewIT.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TransactionalViewIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TransactionalViewIT.java
index 95e7266..18e6e5a 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TransactionalViewIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TransactionalViewIT.java
@@ -55,9 +55,9 @@ public class TransactionalViewIT extends 
ParallelStatsEnabledIT {
     @Before
     public void generateTableNames() {
         String schemaName = TestUtil.DEFAULT_SCHEMA_NAME;
-        String tableName = "T_" + generateRandomString();
+        String tableName = "T_" + generateUniqueName();
         fullTableName = SchemaUtil.getTableName(schemaName, tableName);
-        String viewName = "V_" + generateRandomString();
+        String viewName = "V_" + generateUniqueName();
         fullViewName = SchemaUtil.getTableName(schemaName, viewName);
     }
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/UnionAllIT.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UnionAllIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UnionAllIT.java
index 8f9a294..419459a 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UnionAllIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UnionAllIT.java
@@ -41,8 +41,8 @@ public class UnionAllIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testUnionAllSelects() throws Exception {
-        String tableName1 = generateRandomString();
-        String tableName2 = generateRandomString();
+        String tableName1 = generateUniqueName();
+        String tableName2 = generateUniqueName();
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(false);
@@ -96,8 +96,8 @@ public class UnionAllIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testAggregate() throws Exception {
-        String tableName1 = generateRandomString();
-        String tableName2 = generateRandomString();
+        String tableName1 = generateUniqueName();
+        String tableName2 = generateUniqueName();
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(false);
@@ -151,8 +151,8 @@ public class UnionAllIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testGroupBy() throws Exception {
-        String tableName1 = generateRandomString();
-        String tableName2 = generateRandomString();
+        String tableName1 = generateUniqueName();
+        String tableName2 = generateUniqueName();
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(false);
@@ -200,8 +200,8 @@ public class UnionAllIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testOrderByLimit() throws Exception {
-        String tableName1 = generateRandomString();
-        String tableName2 = generateRandomString();
+        String tableName1 = generateUniqueName();
+        String tableName2 = generateUniqueName();
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(false);
@@ -276,8 +276,8 @@ public class UnionAllIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testSelectDiff() throws Exception {
-        String tableName1 = generateRandomString();
-        String tableName2 = generateRandomString();
+        String tableName1 = generateUniqueName();
+        String tableName2 = generateUniqueName();
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(false);
@@ -305,8 +305,8 @@ public class UnionAllIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testJoinInUnionAll() throws Exception {
-        String tableName1 = generateRandomString();
-        String tableName2 = generateRandomString();
+        String tableName1 = generateUniqueName();
+        String tableName2 = generateUniqueName();
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(false);
@@ -380,8 +380,8 @@ public class UnionAllIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testDerivedTable() throws Exception {
-        String tableName1 = generateRandomString();
-        String tableName2 = generateRandomString();
+        String tableName1 = generateUniqueName();
+        String tableName2 = generateUniqueName();
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(false);
@@ -428,8 +428,8 @@ public class UnionAllIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testUnionAllInDerivedTable() throws Exception {
-        String tableName1 = generateRandomString();
-        String tableName2 = generateRandomString();
+        String tableName1 = generateUniqueName();
+        String tableName2 = generateUniqueName();
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(false);
@@ -497,8 +497,8 @@ public class UnionAllIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testUnionAllInSubquery() throws Exception {
-        String tableName1 = generateRandomString();
-        String tableName2 = generateRandomString();
+        String tableName1 = generateUniqueName();
+        String tableName2 = generateUniqueName();
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(false);
@@ -553,8 +553,8 @@ public class UnionAllIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testUnionAllWithBindParam() throws Exception {
-        String tableName1 = generateRandomString();
-        String tableName2 = generateRandomString();
+        String tableName1 = generateUniqueName();
+        String tableName2 = generateUniqueName();
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(false);
@@ -601,8 +601,8 @@ public class UnionAllIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testExplainUnionAll() throws Exception {
-        String tableName1 = generateRandomString();
-        String tableName2 = generateRandomString();
+        String tableName1 = generateUniqueName();
+        String tableName2 = generateUniqueName();
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(false);
@@ -660,10 +660,10 @@ public class UnionAllIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testBug2295() throws Exception {
-        String tableName1 = generateRandomString();
-        String tableName2 = generateRandomString();
-        String itableName1 = generateRandomString();
-        String itableName2 = generateRandomString();
+        String tableName1 = generateUniqueName();
+        String tableName2 = generateUniqueName();
+        String itableName1 = generateUniqueName();
+        String itableName2 = generateUniqueName();
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(false);
@@ -694,8 +694,8 @@ public class UnionAllIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testParameterMetaDataNotNull() throws Exception {
-        String tableName1 = generateRandomString();
-        String tableName2 = generateRandomString();
+        String tableName1 = generateUniqueName();
+        String tableName2 = generateUniqueName();
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
     
@@ -741,10 +741,10 @@ public class UnionAllIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testDiffDataTypes() throws Exception {
-        String tableName1 = generateRandomString();
-        String tableName2 = generateRandomString();
-        String tableName3 = generateRandomString();
-        String tableName4 = generateRandomString();
+        String tableName1 = generateUniqueName();
+        String tableName2 = generateUniqueName();
+        String tableName3 = generateUniqueName();
+        String tableName4 = generateUniqueName();
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
 
@@ -827,10 +827,10 @@ public class UnionAllIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testDiffScaleSortOrder() throws Exception {
-        String tableName1 = generateRandomString();
-        String tableName2 = generateRandomString();
-        String tableName3 = generateRandomString();
-        String tableName4 = generateRandomString();
+        String tableName1 = generateUniqueName();
+        String tableName2 = generateUniqueName();
+        String tableName3 = generateUniqueName();
+        String tableName4 = generateUniqueName();
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
 
@@ -915,8 +915,8 @@ public class UnionAllIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testVarcharChar() throws Exception {
-        String tableName1 = generateRandomString();
-        String tableName2 = generateRandomString();
+        String tableName1 = generateUniqueName();
+        String tableName2 = generateUniqueName();
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
 
@@ -979,8 +979,8 @@ public class UnionAllIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testCoerceExpr() throws Exception {
-        String tableName1 = generateRandomString();
-        String tableName2 = generateRandomString();
+        String tableName1 = generateUniqueName();
+        String tableName2 = generateUniqueName();
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/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 84fa217..d37419b 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
@@ -73,13 +73,13 @@ public class UpgradeIT extends ParallelStatsDisabledIT {
     
     @Before
     public void generateTenantId() {
-        tenantId = "T_" + generateRandomString();
+        tenantId = "T_" + generateUniqueName();
     }
 
     @Test
     public void testUpgradeForTenantViewWithSameColumnsAsBaseTable() throws 
Exception {
-        String tableWithViewName = generateRandomString();
-        String viewTableName = generateRandomString();
+        String tableWithViewName = generateUniqueName();
+        String viewTableName = generateUniqueName();
         testViewUpgrade(true, tenantId, null, tableWithViewName + "1", null, 
viewTableName + "1", ColumnDiff.EQUAL);
         testViewUpgrade(true, tenantId, "TABLESCHEMA", tableWithViewName + "", 
null, viewTableName + "2",
             ColumnDiff.EQUAL);
@@ -93,8 +93,8 @@ public class UpgradeIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testUpgradeForTenantViewWithMoreColumnsThanBaseTable() throws 
Exception {
-        String tableWithViewName = generateRandomString();
-        String viewTableName = generateRandomString();
+        String tableWithViewName = generateUniqueName();
+        String viewTableName = generateUniqueName();
         testViewUpgrade(true, tenantId, null, tableWithViewName + "1", null, 
viewTableName + "1", ColumnDiff.MORE);
         testViewUpgrade(true, tenantId, "TABLESCHEMA", tableWithViewName + "", 
null, viewTableName + "2",
             ColumnDiff.MORE);
@@ -108,8 +108,8 @@ public class UpgradeIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testUpgradeForViewWithSameColumnsAsBaseTable() throws 
Exception {
-        String tableWithViewName = generateRandomString();
-        String viewTableName = generateRandomString();
+        String tableWithViewName = generateUniqueName();
+        String viewTableName = generateUniqueName();
         testViewUpgrade(false, null, null, tableWithViewName + "1", null, 
viewTableName + "1", ColumnDiff.EQUAL);
         testViewUpgrade(false, null, "TABLESCHEMA", tableWithViewName + "", 
null, viewTableName + "2",
             ColumnDiff.EQUAL);
@@ -123,8 +123,8 @@ public class UpgradeIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testUpgradeForViewWithMoreColumnsThanBaseTable() throws 
Exception {
-        String tableWithViewName = generateRandomString();
-        String viewTableName = generateRandomString();
+        String tableWithViewName = generateUniqueName();
+        String viewTableName = generateUniqueName();
         testViewUpgrade(false, null, null, tableWithViewName + "1", null, 
viewTableName + "1", ColumnDiff.MORE);
         testViewUpgrade(false, null, "TABLESCHEMA", tableWithViewName + "", 
null, viewTableName + "2", ColumnDiff.MORE);
         testViewUpgrade(false, null, null, tableWithViewName + "3", 
"VIEWSCHEMA", viewTableName + "3", ColumnDiff.MORE);
@@ -136,8 +136,8 @@ public class UpgradeIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testSettingBaseColumnCountWhenBaseTableColumnDropped() throws 
Exception {
-        String tableWithViewName = generateRandomString();
-        String viewTableName = generateRandomString();
+        String tableWithViewName = generateUniqueName();
+        String viewTableName = generateUniqueName();
         testViewUpgrade(true, tenantId, null, tableWithViewName + "1", null, 
viewTableName + "1", ColumnDiff.MORE);
         testViewUpgrade(true, tenantId, "TABLESCHEMA", tableWithViewName + "", 
null, viewTableName + "2",
             ColumnDiff.LESS);
@@ -156,12 +156,12 @@ public class UpgradeIT extends ParallelStatsDisabledIT {
 
         try (Connection conn = DriverManager.getConnection(getUrl())) {
             String schemaName = "TEST";
-            String phoenixFullTableName = schemaName + "." + 
generateRandomString();
-            String indexName = "IDX_" + generateRandomString();
-            String localIndexName = "LIDX_" + generateRandomString();
+            String phoenixFullTableName = schemaName + "." + 
generateUniqueName();
+            String indexName = "IDX_" + generateUniqueName();
+            String localIndexName = "LIDX_" + generateUniqueName();
 
-            String viewName = "VIEW_" + generateRandomString();
-            String viewIndexName = "VIDX_" + generateRandomString();
+            String viewName = "VIEW_" + generateUniqueName();
+            String viewIndexName = "VIDX_" + generateUniqueName();
 
             String[] tableNames = new String[] { phoenixFullTableName, 
schemaName + "." + indexName,
                     schemaName + "." + localIndexName, "diff." + viewName, 
"test." + viewName, viewName};
@@ -275,19 +275,20 @@ public class UpgradeIT extends ParallelStatsDisabledIT {
     public void testMapMultiTenantTableToNamespaceDuringUpgrade() throws 
SQLException, SnapshotCreationException,
             IllegalArgumentException, IOException, InterruptedException {
         String[] strings = new String[] { "a", "b", "c", "d" };
-        String schemaName = "TEST";
-        String phoenixFullTableName = schemaName + "." + 
generateRandomString();
+        String schemaName1 = "S_" +generateUniqueName(); // TEST
+        String schemaName2 = "S_" +generateUniqueName(); // DIFF
+        String phoenixFullTableName = schemaName1 + "." + generateUniqueName();
         String hbaseTableName = 
SchemaUtil.getPhysicalTableName(Bytes.toBytes(phoenixFullTableName), true)
                 .getNameAsString();
-        String indexName = "IDX_" + generateRandomString();
-        String viewName = "V_" + generateRandomString();
-        String viewName1 = "V1_" + generateRandomString();
-        String viewIndexName = "V_IDX_" + generateRandomString();
-        String tenantViewIndexName = "V1_IDX_" + generateRandomString();
-
-        String[] tableNames = new String[] { phoenixFullTableName, "diff." + 
viewName1, "test." + viewName1, viewName1 };
-        String[] viewIndexes = new String[] { "test." + viewIndexName, "diff." 
+ viewIndexName };
-        String[] tenantViewIndexes = new String[] { "test." + 
tenantViewIndexName, "diff." + tenantViewIndexName };
+        String indexName = "IDX_" + generateUniqueName();
+        String viewName = "V_" + generateUniqueName();
+        String viewName1 = "V1_" + generateUniqueName();
+        String viewIndexName = "V_IDX_" + generateUniqueName();
+        String tenantViewIndexName = "V1_IDX_" + generateUniqueName();
+
+        String[] tableNames = new String[] { phoenixFullTableName, schemaName2 
+ "." + viewName1, schemaName1 + "." + viewName1, viewName1 };
+        String[] viewIndexes = new String[] { schemaName1 + "." + 
viewIndexName, schemaName2 + "." + viewIndexName };
+        String[] tenantViewIndexes = new String[] { schemaName1 + "." + 
tenantViewIndexName, schemaName2 + "." + tenantViewIndexName };
         try (Connection conn = DriverManager.getConnection(getUrl())) {
             conn.createStatement().execute("CREATE TABLE " + 
phoenixFullTableName
                     + "(k VARCHAR not null, v INTEGER not null, f INTEGER, g 
INTEGER NULL, h INTEGER NULL CONSTRAINT pk PRIMARY KEY(k,v)) 
MULTI_TENANT=true");
@@ -304,16 +305,16 @@ public class UpgradeIT extends ParallelStatsDisabledIT {
             // creating global index
             conn.createStatement().execute("create index " + indexName + " on 
" + phoenixFullTableName + "(f)");
             // creating view in schema 'diff'
-            conn.createStatement().execute("CREATE VIEW diff." + viewName + " 
(col VARCHAR) AS SELECT * FROM " + phoenixFullTableName);
+            conn.createStatement().execute("CREATE VIEW " + schemaName2 + "." 
+ viewName + " (col VARCHAR) AS SELECT * FROM " + phoenixFullTableName);
             // creating view in schema 'test'
-            conn.createStatement().execute("CREATE VIEW test." + viewName + " 
(col VARCHAR) AS SELECT * FROM " + phoenixFullTableName);
+            conn.createStatement().execute("CREATE VIEW " + schemaName1 + "." 
+ viewName + " (col VARCHAR) AS SELECT * FROM " + phoenixFullTableName);
             conn.createStatement().execute("CREATE VIEW " + viewName + " (col 
VARCHAR) AS SELECT * FROM " + phoenixFullTableName);
             // Creating index on views
-            conn.createStatement().execute("create local index " + 
viewIndexName + " on diff." + viewName + "(col)");
-            conn.createStatement().execute("create local index " + 
viewIndexName + " on test." + viewName + "(col)");
+            conn.createStatement().execute("create local index " + 
viewIndexName + " on " + schemaName2 + "." + viewName + "(col)");
+            conn.createStatement().execute("create local index " + 
viewIndexName + " on " + schemaName1 + "." + viewName + "(col)");
         }
         Properties props = new Properties();
-        String tenantId = "a";
+        String tenantId = strings[0];
         props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId);
         try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
             PreparedStatement upsertStmt = conn
@@ -327,14 +328,14 @@ public class UpgradeIT extends ParallelStatsDisabledIT {
             conn.commit();
             // creating view in schema 'diff'
             conn.createStatement()
-                    .execute("CREATE VIEW diff." + viewName1 + " (col VARCHAR) 
AS SELECT * FROM " + phoenixFullTableName);
+                    .execute("CREATE VIEW " + schemaName2 + "." + viewName1 + 
" (col VARCHAR) AS SELECT * FROM " + phoenixFullTableName);
             // creating view in schema 'test'
             conn.createStatement()
-                    .execute("CREATE VIEW test." + viewName1 + " (col VARCHAR) 
AS SELECT * FROM " + phoenixFullTableName);
+                    .execute("CREATE VIEW " + schemaName1 + "." + viewName1 + 
" (col VARCHAR) AS SELECT * FROM " + phoenixFullTableName);
             conn.createStatement().execute("CREATE VIEW " + viewName1 + " (col 
VARCHAR) AS SELECT * FROM " + phoenixFullTableName);
             // Creating index on views
-            conn.createStatement().execute("create index " + 
tenantViewIndexName + " on diff." + viewName1 + "(col)");
-            conn.createStatement().execute("create index " + 
tenantViewIndexName + " on test." + viewName1 + "(col)");
+            conn.createStatement().execute("create index " + 
tenantViewIndexName + " on " + schemaName2 + "." + viewName1 + "(col)");
+            conn.createStatement().execute("create index " + 
tenantViewIndexName + " on " + schemaName1 + "." + viewName1 + "(col)");
         }
 
         props = new Properties();
@@ -393,18 +394,18 @@ public class UpgradeIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testSettingBaseColumnCountForMultipleViewsOnTable() throws 
Exception {
-        String baseSchema = "S_" + generateRandomString();
-        String baseTable = "T_" + generateRandomString();
+        String baseSchema = "S_" + generateUniqueName();
+        String baseTable = "T_" + generateUniqueName();
         String fullBaseTableName = SchemaUtil.getTableName(baseSchema, 
baseTable);
         try (Connection conn = DriverManager.getConnection(getUrl())) {
             String baseTableDDL = "CREATE TABLE " + fullBaseTableName + " 
(TENANT_ID VARCHAR NOT NULL, PK1 VARCHAR NOT NULL, V1 INTEGER, V2 INTEGER 
CONSTRAINT NAME_PK PRIMARY KEY(TENANT_ID, PK1)) MULTI_TENANT = true";
             conn.createStatement().execute(baseTableDDL);
 
-            String[] tenants = new String[] {"T_" + generateRandomString(), 
"T_" + generateRandomString()};
+            String[] tenants = new String[] {"T_" + generateUniqueName(), "T_" 
+ generateUniqueName()};
             Collections.sort(Arrays.asList(tenants));
-            String[] tenantViews = new String[] {"V_" + 
generateRandomString(), "V_" + generateRandomString(), "V_" + 
generateRandomString()};
+            String[] tenantViews = new String[] {"V_" + generateUniqueName(), 
"V_" + generateUniqueName(), "V_" + generateUniqueName()};
             Collections.sort(Arrays.asList(tenantViews));
-            String[] globalViews = new String[] {"G_" + 
generateRandomString(), "G_" + generateRandomString(), "G_" + 
generateRandomString()};
+            String[] globalViews = new String[] {"G_" + generateUniqueName(), 
"G_" + generateUniqueName(), "G_" + generateUniqueName()};
             Collections.sort(Arrays.asList(globalViews));
             for (int i = 0; i < 2; i++) {
                 // Create views for tenants;
@@ -601,7 +602,7 @@ public class UpgradeIT extends ParallelStatsDisabledIT {
     
     @Test
     public void testUpgradeRequiredPreventsSQL() throws SQLException {
-        String tableName = generateRandomString();
+        String tableName = generateUniqueName();
         try (Connection conn = getConnection(false, null)) {
             conn.createStatement().execute(
                     "CREATE TABLE " + tableName
@@ -617,7 +618,7 @@ public class UpgradeIT extends ParallelStatsDisabledIT {
                     conn.unwrap(PhoenixConnection.class), 
HConstants.LATEST_TIMESTAMP)) {
                 try {
                     phxConn.createStatement().execute(
-                            "CREATE TABLE " + generateRandomString()
+                            "CREATE TABLE " + generateUniqueName()
                                     + " (k1 VARCHAR NOT NULL, k2 VARCHAR, 
CONSTRAINT PK PRIMARY KEY(K1,K2))");
                     fail("CREATE TABLE should have failed with 
UpgradeRequiredException");
                 } catch (UpgradeRequiredException expected) {
@@ -655,7 +656,7 @@ public class UpgradeIT extends ParallelStatsDisabledIT {
     
     @Test
     public void testUpgradingConnectionBypassesUpgradeRequiredCheck() throws 
Exception {
-        String tableName = generateRandomString();
+        String tableName = generateUniqueName();
         try (Connection conn = getConnection(false, null)) {
             conn.createStatement()
                     .execute(

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/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 132c0ae..0f97a94 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
@@ -39,7 +39,7 @@ public class UpsertBigValuesIT extends 
ParallelStatsDisabledIT {
     public void testIntegerPK() throws Exception {
         int[] testNumbers = {Integer.MIN_VALUE, Integer.MIN_VALUE + 1,
                 -2, -1, 0, 1, 2, Integer.MAX_VALUE - 1, Integer.MAX_VALUE};
-        String tableName = generateRandomString();
+        String tableName = generateUniqueName();
         ensureTableCreated(getUrl(), tableName,"PKIntValueTest");
         Properties props = new Properties();
         Connection conn = DriverManager.getConnection(getUrl(), props);
@@ -124,7 +124,7 @@ public class UpsertBigValuesIT extends 
ParallelStatsDisabledIT {
       // NOTE: Due to how we parse negative long, -9223372036854775808L, the 
minimum value of 
       // bigint is not recognizable in the current version. As a result, we 
start with 
       // Long.MIN_VALUE+1 as the smallest value.
-        String tableName = generateRandomString();
+        String tableName = generateUniqueName();
         long[] testNumbers = {Long.MIN_VALUE+1 , Long.MIN_VALUE+2 , 
                 -2L, -1L, 0L, 1L, 2L, Long.MAX_VALUE-1, Long.MAX_VALUE};
         ensureTableCreated(getUrl(), tableName, "PKBigIntValueTest" );
@@ -208,7 +208,7 @@ public class UpsertBigValuesIT extends 
ParallelStatsDisabledIT {
 
     @Test
     public void testIntegerKV() throws Exception {
-        String tableName = generateRandomString();
+        String tableName = generateUniqueName();
         int[] testNumbers = {Integer.MIN_VALUE, Integer.MIN_VALUE + 1, 
                 -2, -1, 0, 1, 2, Integer.MAX_VALUE - 1, Integer.MAX_VALUE};
         ensureTableCreated(getUrl(), tableName, "KVIntValueTest" );
@@ -292,7 +292,7 @@ public class UpsertBigValuesIT extends 
ParallelStatsDisabledIT {
         // NOTE: Due to how we parse negative long, -9223372036854775808L, the 
minimum value of 
         // bigint is not recognizable in the current version. As a result, we 
start with 
         // Long.MIN_VALUE+1 as the smallest value.
-        String tableName = generateRandomString();
+        String tableName = generateUniqueName();
         long[] testNumbers = {Long.MIN_VALUE+1, Long.MIN_VALUE+2, 
                 -2L, -1L, 0L, 1L, 2L, Long.MAX_VALUE-1, Long.MAX_VALUE};
         ensureTableCreated(getUrl(), tableName, "KVBigIntValueTest" );

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectAutoCommitIT.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectAutoCommitIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectAutoCommitIT.java
index 3fbe5d7..37482de 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectAutoCommitIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectAutoCommitIT.java
@@ -47,7 +47,7 @@ public class UpsertSelectAutoCommitIT extends 
ParallelStatsDisabledIT {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(true);
-        String atable = generateRandomString();
+        String atable = generateUniqueName();
         conn.createStatement().execute("CREATE TABLE " + atable
             + " (ORGANIZATION_ID CHAR(15) NOT NULL, ENTITY_ID CHAR(15) NOT 
NULL, A_STRING VARCHAR\n"
             +
@@ -77,7 +77,7 @@ public class UpsertSelectAutoCommitIT extends 
ParallelStatsDisabledIT {
         assertEquals(A_VALUE, rs.getString(2));
         assertFalse(rs.next());
 
-        String atable2 = generateRandomString();
+        String atable2 = generateUniqueName();
         conn.createStatement().execute("CREATE TABLE " + atable2
             + " (ORGANIZATION_ID CHAR(15) NOT NULL, ENTITY_ID CHAR(15) NOT 
NULL, A_STRING VARCHAR\n"
             +
@@ -98,7 +98,7 @@ public class UpsertSelectAutoCommitIT extends 
ParallelStatsDisabledIT {
     @Test
     public void testDynamicUpsertSelect() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
-        String tableName = generateRandomString();
+        String tableName = generateUniqueName();
         String cursorDDL = " CREATE TABLE IF NOT EXISTS " + tableName
             + " (ORGANIZATION_ID VARCHAR(15) NOT NULL, \n"
                 + "QUERY_ID VARCHAR(15) NOT NULL, \n"
@@ -107,7 +107,7 @@ public class UpsertSelectAutoCommitIT extends 
ParallelStatsDisabledIT {
                 + "SALT_BUCKETS = 4";
         conn.createStatement().execute(cursorDDL);
 
-        String tableName2 = generateRandomString();
+        String tableName2 = generateUniqueName();
         String dataTableDDL = "CREATE TABLE IF NOT EXISTS " + tableName2 +
                 "(" +
                 "ORGANIZATION_ID CHAR(15) NOT NULL, " +
@@ -158,7 +158,7 @@ public class UpsertSelectAutoCommitIT extends 
ParallelStatsDisabledIT {
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(true);
         conn.createStatement().execute("CREATE SEQUENCE keys");
-        String tableName = generateRandomString();
+        String tableName = generateUniqueName();
         conn.createStatement().execute(
             "CREATE TABLE " + tableName + " (pk INTEGER PRIMARY KEY, val 
INTEGER)");
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertValuesIT.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertValuesIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertValuesIT.java
index 9725175..21ccbf4 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertValuesIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertValuesIT.java
@@ -471,7 +471,7 @@ public class UpsertValuesIT extends BaseClientManagedTimeIT 
{
         props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, 
Long.toString(ts));
         Connection conn = null;
         PreparedStatement pstmt = null;
-        String tableName = BaseTest.generateRandomString();
+        String tableName = BaseTest.generateUniqueName();
         try {
             conn = DriverManager.getConnection(getUrl(), props);
             pstmt = conn.prepareStatement("create table " + tableName + " (k 
varchar primary key, v integer)");

Reply via email to