[15/48] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/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
[18/48] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
PHOENIX-3253 Make changes to tests to support method level parallelization Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/bebb5ced Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/bebb5ced Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/bebb5ced Branch: refs/heads/calcite Commit: bebb5cedf761b132b78db675a19ede5849f6ea94 Parents: 16f0da3 Author: James TaylorAuthored: Thu Sep 22 17:16:43 2016 -0700 Committer: James Taylor Committed: Thu Sep 22 17:16:43 2016 -0700 -- .../StatisticsCollectionRunTrackerIT.java | 2 +- .../phoenix/end2end/AbsFunctionEnd2EndIT.java | 2 +- .../AlterMultiTenantTableWithViewsIT.java | 16 +- .../apache/phoenix/end2end/AlterSessionIT.java | 2 +- .../apache/phoenix/end2end/AlterTableIT.java| 10 +- .../phoenix/end2end/AlterTableWithViewsIT.java | 16 +- .../phoenix/end2end/AppendOnlySchemaIT.java | 22 +-- .../phoenix/end2end/ArithmeticQueryIT.java | 36 ++-- .../phoenix/end2end/ArrayAppendFunctionIT.java | 18 +- .../phoenix/end2end/ArrayConcatFunctionIT.java | 16 +- .../phoenix/end2end/ArrayFillFunctionIT.java| 12 +- .../phoenix/end2end/ArrayPrependFunctionIT.java | 68 +++ .../end2end/ArrayToStringFunctionIT.java| 22 +-- .../phoenix/end2end/ArraysWithNullsIT.java | 32 ++-- .../apache/phoenix/end2end/AutoCommitIT.java| 2 +- .../phoenix/end2end/AutoPartitionViewsIT.java | 18 +- .../end2end/BaseTenantSpecificTablesIT.java | 12 +- .../end2end/BaseTenantSpecificViewIndexIT.java | 12 +- .../org/apache/phoenix/end2end/BaseViewIT.java | 8 +- .../apache/phoenix/end2end/BinaryRowKeyIT.java | 6 +- .../phoenix/end2end/CSVCommonsLoaderIT.java | 20 +- .../phoenix/end2end/CbrtFunctionEnd2EndIT.java | 4 +- .../phoenix/end2end/CoalesceFunctionIT.java | 20 +- .../end2end/ConvertTimezoneFunctionIT.java | 14 +- .../org/apache/phoenix/end2end/DateTimeIT.java | 68 +++ .../phoenix/end2end/DecodeFunctionIT.java | 12 +- .../org/apache/phoenix/end2end/DeleteIT.java| 26 +-- .../phoenix/end2end/DisableLocalIndexIT.java| 2 +- .../phoenix/end2end/DistinctPrefixFilterIT.java | 6 +- .../apache/phoenix/end2end/DynamicFamilyIT.java | 4 +- .../apache/phoenix/end2end/DynamicUpsertIT.java | 2 +- .../phoenix/end2end/EncodeFunctionIT.java | 8 +- .../phoenix/end2end/EvaluationOfORIT.java | 2 +- .../phoenix/end2end/ExecuteStatementsIT.java| 6 +- .../phoenix/end2end/ExpFunctionEnd2EndIT.java | 4 +- .../phoenix/end2end/FirstValueFunctionIT.java | 14 +- .../end2end/GetSetByteBitFunctionEnd2EndIT.java | 2 +- .../apache/phoenix/end2end/GroupByCaseIT.java | 20 +- .../apache/phoenix/end2end/HashJoinMoreIT.java | 12 +- .../org/apache/phoenix/end2end/InListIT.java| 10 +- .../apache/phoenix/end2end/IndexExtendedIT.java | 30 +-- .../apache/phoenix/end2end/InstrFunctionIT.java | 16 +- .../org/apache/phoenix/end2end/IsNullIT.java| 6 +- .../org/apache/phoenix/end2end/KeyOnlyIT.java | 2 +- .../phoenix/end2end/LastValueFunctionIT.java| 22 +-- .../phoenix/end2end/LikeExpressionIT.java | 12 +- .../phoenix/end2end/LnLogFunctionEnd2EndIT.java | 4 +- .../apache/phoenix/end2end/MD5FunctionIT.java | 6 +- .../org/apache/phoenix/end2end/MapReduceIT.java | 8 +- .../phoenix/end2end/MappingTableDataTypeIT.java | 2 +- .../end2end/MinMaxAggregateFunctionIT.java | 2 +- .../phoenix/end2end/ModulusExpressionIT.java| 10 +- .../phoenix/end2end/MultiCfQueryExecIT.java | 2 +- .../end2end/NamespaceSchemaMappingIT.java | 2 +- .../phoenix/end2end/NthValueFunctionIT.java | 22 +-- .../end2end/OctetLengthFunctionEnd2EndIT.java | 2 +- .../org/apache/phoenix/end2end/OrderByIT.java | 16 +- .../phoenix/end2end/ParallelIteratorsIT.java| 4 +- .../apache/phoenix/end2end/PercentileIT.java| 15 +- .../phoenix/end2end/PhoenixRuntimeIT.java | 18 +- .../phoenix/end2end/PowerFunctionEnd2EndIT.java | 4 +- .../apache/phoenix/end2end/PrimitiveTypeIT.java | 18 +- .../org/apache/phoenix/end2end/QueryMoreIT.java | 8 +- .../phoenix/end2end/QueryWithOffsetIT.java | 2 +- .../apache/phoenix/end2end/RTrimFunctionIT.java | 2 +- .../org/apache/phoenix/end2end/ReadOnlyIT.java | 2 +- .../end2end/RegexpReplaceFunctionIT.java| 2 +- .../phoenix/end2end/RegexpSplitFunctionIT.java | 2 +- .../phoenix/end2end/RegexpSubstrFunctionIT.java | 2 +- .../phoenix/end2end/ReverseFunctionIT.java | 2 +- .../apache/phoenix/end2end/ReverseScanIT.java | 4 +- .../phoenix/end2end/RoundFloorCeilFuncIT.java | 2 +- .../phoenix/end2end/SerialIteratorsIT.java | 2 +- .../phoenix/end2end/ServerExceptionIT.java | 2 +-
[38/48] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
PHOENIX-3253 Make changes to tests to support method level parallelization Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/0494e54d Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/0494e54d Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/0494e54d Branch: refs/heads/calcite Commit: 0494e54de2a9ff7e1115678658fb092c95602930 Parents: 4c0aeb0 Author: James TaylorAuthored: Mon Oct 3 13:46:53 2016 -0700 Committer: James Taylor Committed: Mon Oct 3 13:47:38 2016 -0700 -- .../src/it/java/org/apache/phoenix/end2end/index/IndexIT.java| 4 1 file changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/0494e54d/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java index 254046b..cb4310b 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java @@ -230,6 +230,10 @@ public class IndexIT extends ParallelStatsDisabledIT { testCreateIndexAfterUpsertStarted(false, SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, generateUniqueName()), SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, generateUniqueName())); +} + +@Test +public void testCreateIndexAfterUpsertStartedTxnl() throws Exception { if (transactional) { testCreateIndexAfterUpsertStarted(true, SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, generateUniqueName()),
[13/48] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java index e5dfb0d..0a89eff 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java @@ -102,8 +102,8 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { conn.setAutoCommit(false); - String tableName = "TBL_" + generateRandomString(); - String indexName = "IDX_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); + String indexName = "IDX_" + generateUniqueName(); String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName); String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName); @@ -200,8 +200,8 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { @Test public void testCoveredColumns() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); - String tableName = "TBL_" + generateRandomString(); - String indexName = "IDX_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); + String indexName = "IDX_" + generateUniqueName(); String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName); String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { @@ -310,8 +310,8 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { @Test public void testCompoundIndexKey() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); - String tableName = "TBL_" + generateRandomString(); - String indexName = "IDX_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); + String indexName = "IDX_" + generateUniqueName(); String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName); String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { @@ -429,8 +429,8 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { @Test public void testMultipleUpdatesToSingleRow() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); - String tableName = "TBL_" + generateRandomString(); - String indexName = "IDX_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); + String indexName = "IDX_" + generateUniqueName(); String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName); String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { @@ -513,8 +513,8 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { @Test public void testUpsertingNullForIndexedColumns() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); - String tableName = "TBL_" + generateRandomString(); - String indexName = "IDX_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); + String indexName = "IDX_" + generateUniqueName(); String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName); String testTableName = tableName + "_" + System.currentTimeMillis(); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { @@ -599,7 +599,7 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { public void testAlterTableWithImmutability() throws Exception { String query; ResultSet rs; - String tableName = "TBL_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName); @@ -638,8 +638,8 @@ public class
[17/48] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
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 {
[07/48] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
PHOENIX-3253 Make changes to tests to support method level parallelization Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/d4f72018 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/d4f72018 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/d4f72018 Branch: refs/heads/calcite Commit: d4f7201854a8d27ba7e6dd1037a10a4a34842b92 Parents: 8174fc4 Author: James TaylorAuthored: Wed Sep 21 12:45:25 2016 -0700 Committer: James Taylor Committed: Wed Sep 21 12:45:25 2016 -0700 -- .../phoenix/end2end/StatsCollectorIT.java | 33 -- .../apache/phoenix/end2end/StoreNullsIT.java| 68 ++-- .../query/ConnectionQueryServicesImpl.java | 1 + .../java/org/apache/phoenix/util/TestUtil.java | 55 4 files changed, 74 insertions(+), 83 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/d4f72018/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 dd7741a..9a1ea26 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 @@ -40,8 +40,8 @@ import java.util.Random; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HRegionLocation; -import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.util.Bytes; +import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr; import org.apache.phoenix.jdbc.PhoenixConnection; import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData; import org.apache.phoenix.query.ConnectionQueryServices; @@ -77,8 +77,8 @@ public class StatsCollectorIT extends ParallelStatsEnabledIT { props.put(QueryServices.STATS_GUIDEPOST_WIDTH_BYTES_ATTRIB, Long.toString(20)); props.put(QueryServices.EXPLAIN_CHUNK_COUNT_ATTRIB, Boolean.TRUE.toString()); props.put(QueryServices.EXPLAIN_ROW_COUNT_ATTRIB, Boolean.TRUE.toString()); -props.put(QueryServices.QUEUE_SIZE_ATTRIB, Integer.toString(1024)); props.put(QueryServices.TRANSACTIONS_ENABLED, Boolean.toString(true)); +props.put(QueryServices.STATS_UPDATE_FREQ_MS_ATTRIB, Long.toString(Long.MAX_VALUE)); setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator())); } @@ -347,16 +347,8 @@ public class StatsCollectorIT extends ParallelStatsEnabledIT { return stmt; } -private void compactTable(Connection conn, String tableName) throws IOException, InterruptedException, SQLException { -ConnectionQueryServices services = conn.unwrap(PhoenixConnection.class).getQueryServices(); -HBaseAdmin admin = services.getAdmin(); -try { -admin.flush(tableName); -admin.majorCompact(tableName); -Thread.sleep(1); // FIXME: how do we know when compaction is done? -} finally { -admin.close(); -} +private void compactTable(Connection conn, String tableName) throws Exception { +TestUtil.doMajorCompaction(conn, tableName); } @Test @@ -374,9 +366,6 @@ public class StatsCollectorIT extends ParallelStatsEnabledIT { Connection conn; PreparedStatement stmt; Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); -if (minStatsUpdateFreq != null) { -props.setProperty(QueryServices.MIN_STATS_UPDATE_FREQ_MS_ATTRIB, minStatsUpdateFreq.toString()); -} conn = DriverManager.getConnection(getUrl(), props); conn.createStatement().execute("CREATE TABLE " + tableName + "(k CHAR(1) PRIMARY KEY, v INTEGER, w INTEGER) " + HColumnDescriptor.KEEP_DELETED_CELLS + "=" + Boolean.FALSE); @@ -391,11 +380,11 @@ public class StatsCollectorIT extends ParallelStatsEnabledIT { compactTable(conn, tableName); if (minStatsUpdateFreq == null) { - conn.unwrap(PhoenixConnection.class).getQueryServices().clearCache(); -} -// Confirm that when we have a non zero MIN_STATS_UPDATE_FREQ_MS_ATTRIB, after we run -// UPDATATE STATISTICS, the new statistics are faulted in as expected. -if (minStatsUpdateFreq != null) { +ImmutableBytesPtr ptr = new ImmutableBytesPtr(Bytes.toBytes(tableName)); + conn.unwrap(PhoenixConnection.class).getQueryServices().invalidateStats(ptr); +} else { +// Confirm that when we have a non zero
[36/48] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
PHOENIX-3253 Make changes to tests to support method level parallelization Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/2f51568a Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/2f51568a Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/2f51568a Branch: refs/heads/calcite Commit: 2f51568a71aed4ac8d8a078d3f10bb5afeedd4c4 Parents: cae4a7c Author: James TaylorAuthored: Sun Oct 2 12:47:34 2016 -0700 Committer: James Taylor Committed: Sun Oct 2 12:47:34 2016 -0700 -- .../apache/phoenix/end2end/AlterTableIT.java| 49 -- .../phoenix/end2end/FlappingAlterTableIT.java | 97 pom.xml | 12 +-- 3 files changed, 103 insertions(+), 55 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/2f51568a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java index 0125a63..48f4217 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java @@ -1083,30 +1083,6 @@ public class AlterTableIT extends ParallelStatsDisabledIT { } @Test -public void testAddColumnForNewColumnFamily() throws Exception { -Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); -String ddl = "CREATE TABLE " + dataTableFullName + " (\n" -+"ID1 VARCHAR(15) NOT NULL,\n" -+"ID2 VARCHAR(15) NOT NULL,\n" -+"CREATED_DATE DATE,\n" -+"CREATION_TIME BIGINT,\n" -+"LAST_USED DATE,\n" -+"CONSTRAINT PK PRIMARY KEY (ID1, ID2)) SALT_BUCKETS = 8"; -Connection conn1 = DriverManager.getConnection(getUrl(), props); -conn1.createStatement().execute(ddl); -ddl = "ALTER TABLE " + dataTableFullName + " ADD CF.STRING VARCHAR"; -conn1.createStatement().execute(ddl); -try (HBaseAdmin admin = conn1.unwrap(PhoenixConnection.class).getQueryServices().getAdmin()) { -HColumnDescriptor[] columnFamilies = admin.getTableDescriptor(Bytes.toBytes(dataTableFullName)).getColumnFamilies(); -assertEquals(2, columnFamilies.length); -assertEquals("0", columnFamilies[0].getNameAsString()); -assertEquals(HColumnDescriptor.DEFAULT_TTL, columnFamilies[0].getTimeToLive()); -assertEquals("CF", columnFamilies[1].getNameAsString()); -assertEquals(HColumnDescriptor.DEFAULT_TTL, columnFamilies[1].getTimeToLive()); -} -} - -@Test public void testSetHColumnProperties() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); String ddl = "CREATE TABLE " + dataTableFullName + " (\n" @@ -1414,31 +1390,6 @@ public class AlterTableIT extends ParallelStatsDisabledIT { } } -@Test -public void testNewColumnFamilyInheritsTTLOfEmptyCF() throws Exception { -Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); -String ddl = "CREATE TABLE " + dataTableFullName + " (\n" -+"ID1 VARCHAR(15) NOT NULL,\n" -+"ID2 VARCHAR(15) NOT NULL,\n" -+"CREATED_DATE DATE,\n" -+"CREATION_TIME BIGINT,\n" -+"LAST_USED DATE,\n" -+"CONSTRAINT PK PRIMARY KEY (ID1, ID2)) SALT_BUCKETS = 8, TTL = 1000"; -Connection conn1 = DriverManager.getConnection(getUrl(), props); -conn1.createStatement().execute(ddl); -ddl = "ALTER TABLE " + dataTableFullName + " ADD CF.STRING VARCHAR"; -conn1.createStatement().execute(ddl); -try (HBaseAdmin admin = conn1.unwrap(PhoenixConnection.class).getQueryServices().getAdmin()) { -HTableDescriptor tableDesc = admin.getTableDescriptor(Bytes.toBytes(dataTableFullName)); -HColumnDescriptor[] columnFamilies = tableDesc.getColumnFamilies(); -assertEquals(2, columnFamilies.length); -assertEquals("0", columnFamilies[0].getNameAsString()); -assertEquals(1000, columnFamilies[0].getTimeToLive()); -assertEquals("CF", columnFamilies[1].getNameAsString()); -assertEquals(1000, columnFamilies[1].getTimeToLive()); -} -} - private static void assertImmutableRows(Connection conn, String fullTableName, boolean expectedValue) throws SQLException { PhoenixConnection pconn = conn.unwrap(PhoenixConnection.class);
[14/48] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java index ec84282..c43fb0e 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java @@ -45,13 +45,13 @@ public class UseSchemaIT extends ParallelStatsDisabledIT { @Test public void testUseSchemaCaseInsensitive() throws Exception { -String schemaName = generateRandomString(); +String schemaName = generateUniqueName(); testUseSchema(schemaName); } @Test public void testUseSchemaCaseSensitive() throws Exception { -String schemaName = generateRandomString(); +String schemaName = generateUniqueName(); testUseSchema("\"" + schemaName + "\""); } @@ -61,7 +61,7 @@ public class UseSchemaIT extends ParallelStatsDisabledIT { Connection conn = DriverManager.getConnection(getUrl(), props); String ddl = "CREATE SCHEMA IF NOT EXISTS "+schema; conn.createStatement().execute(ddl); -String testTable = generateRandomString(); +String testTable = generateUniqueName(); ddl = "create table "+schema+"." + testTable + "(id varchar primary key)"; conn.createStatement().execute(ddl); conn.createStatement().execute("use "+schema); @@ -89,14 +89,14 @@ public class UseSchemaIT extends ParallelStatsDisabledIT { @Test public void testSchemaInJdbcUrl() throws Exception { Properties props = new Properties(); -String schema = generateRandomString(); +String schema = generateUniqueName(); props.setProperty(QueryServices.SCHEMA_ATTRIB, schema); props.setProperty(QueryServices.IS_NAMESPACE_MAPPING_ENABLED, Boolean.toString(true)); Connection conn = DriverManager.getConnection(getUrl(), props); conn.setAutoCommit(true); String ddl = "CREATE SCHEMA IF NOT EXISTS " + schema; conn.createStatement().execute(ddl); -String testTable = generateRandomString(); +String testTable = generateUniqueName(); ddl = "create table IF NOT EXISTS " + schema + "." + testTable + " (schema_name varchar primary key)"; conn.createStatement().execute(ddl); conn.createStatement().executeUpdate("upsert into " + schema + "." + testTable + " values('" + schema + "')"); @@ -105,7 +105,7 @@ public class UseSchemaIT extends ParallelStatsDisabledIT { assertTrue(rs.next()); assertEquals(schema, rs.getString(1)); -schema = generateRandomString(); +schema = generateUniqueName(); ddl = "CREATE SCHEMA " + schema; conn.createStatement().execute(ddl); conn.createStatement().execute("use " + schema); @@ -121,8 +121,8 @@ public class UseSchemaIT extends ParallelStatsDisabledIT { @Test public void testMappedView() throws Exception { Properties props = new Properties(); -String schema = generateRandomString(); -String tableName = generateRandomString(); +String schema = generateUniqueName(); +String tableName = generateUniqueName(); String fullTablename = schema + QueryConstants.NAME_SEPARATOR + tableName; props.setProperty(QueryServices.SCHEMA_ATTRIB, schema); Connection conn = DriverManager.getConnection(getUrl(), props); http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java index 425e84c..512841a 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java @@ -64,7 +64,7 @@ public class ViewIT extends BaseViewIT { Connection conn = DriverManager.getConnection(getUrl()); String ddl = "CREATE TABLE " + fullTableName + " (k INTEGER NOT NULL PRIMARY KEY, v1 DATE) "+ tableDDLOptions; conn.createStatement().execute(ddl); -String fullParentViewName = "V_" + generateRandomString(); +String fullParentViewName = "V_" + generateUniqueName(); ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * FROM " + tableName + " WHERE k > 5"; conn.createStatement().execute(ddl); try { @@ -104,7 +104,7 @@ public class ViewIT extends BaseViewIT { assertEquals(count + 5, rs.getInt(1)); } assertEquals(4, count); -String fullViewName = "V_" +
[16/48] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/IsNullIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IsNullIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IsNullIT.java index fb12fc4..10a5baa 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IsNullIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IsNullIT.java @@ -33,7 +33,7 @@ import org.junit.Test; public class IsNullIT extends ParallelStatsDisabledIT { @Test public void testIsNullInPk() throws Exception { -String tableName = generateRandomString(); +String tableName = generateUniqueName(); ensureTableCreated(getUrl(), tableName, "IntIntKeyTest"); Connection conn = DriverManager.getConnection(getUrl()); String upsert = "UPSERT INTO " + tableName + " VALUES(4,2)"; @@ -62,7 +62,7 @@ public class IsNullIT extends ParallelStatsDisabledIT { @Test public void testIsNullWithLastPKColDesc() throws Exception { -String tableName = generateRandomString(); +String tableName = generateUniqueName(); Connection conn = DriverManager.getConnection(getUrl()); conn.createStatement().execute("CREATE TABLE " + tableName + "(k1 VARCHAR NOT NULL, k2 VARCHAR, k3 VARCHAR, CONSTRAINT pk PRIMARY KEY (k1, k2, k3 DESC))"); conn.createStatement().execute("UPSERT INTO " + tableName + " VALUES ('a')"); @@ -89,7 +89,7 @@ public class IsNullIT extends ParallelStatsDisabledIT { @Test public void testIsNullInCompositeKey() throws Exception { Connection conn = DriverManager.getConnection(getUrl()); -String tableName = generateRandomString(); +String tableName = generateUniqueName(); conn.createStatement().execute("CREATE TABLE " + tableName + "(k1 VARCHAR, k2 VARCHAR, CONSTRAINT pk PRIMARY KEY (k1,k2))"); conn.createStatement().execute("UPSERT INTO " + tableName + " VALUES (null,'a')"); conn.createStatement().execute("UPSERT INTO " + tableName + " VALUES ('a','a')"); http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/KeyOnlyIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/KeyOnlyIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/KeyOnlyIT.java index 7ec37ce..b682c1a 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/KeyOnlyIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/KeyOnlyIT.java @@ -45,7 +45,7 @@ public class KeyOnlyIT extends ParallelStatsEnabledIT { @Before public void createTable() throws SQLException { -tableName = generateRandomString(); +tableName = generateUniqueName(); Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { conn.createStatement().execute("create table " + tableName + http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java index e28f510..2a3ebf7 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java @@ -33,7 +33,7 @@ public class LastValueFunctionIT extends ParallelStatsDisabledIT { @Test public void unsignedLong() throws Exception { Connection conn = DriverManager.getConnection(getUrl()); -String tableName = generateRandomString(); +String tableName = generateUniqueName(); String ddl = "CREATE TABLE IF NOT EXISTS " + tableName + "(id INTEGER NOT NULL PRIMARY KEY, page_id UNSIGNED_LONG," + " date DATE, \"value\" UNSIGNED_LONG)"; @@ -65,7 +65,7 @@ public class LastValueFunctionIT extends ParallelStatsDisabledIT { @Test public void signedInteger() throws Exception { Connection conn = DriverManager.getConnection(getUrl()); -String tableName = generateRandomString(); +String tableName = generateUniqueName(); String ddl = "CREATE TABLE IF NOT EXISTS " + tableName + "(id INTEGER NOT NULL PRIMARY KEY, page_id UNSIGNED_LONG, date INTEGER, \"value\" INTEGER)"; @@ -90,7 +90,7 @@ public class LastValueFunctionIT extends ParallelStatsDisabledIT { @Test public void unsignedInteger() throws Exception { Connection conn = DriverManager.getConnection(getUrl());
[39/48] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
PHOENIX-3253 Make changes to tests to support method level parallelization Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/34ba28e6 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/34ba28e6 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/34ba28e6 Branch: refs/heads/calcite Commit: 34ba28e60f66cb7b537b60c9ef04b8a26036f010 Parents: 0494e54 Author: James TaylorAuthored: Mon Oct 3 18:02:48 2016 -0700 Committer: James Taylor Committed: Mon Oct 3 18:02:48 2016 -0700 -- .../apache/phoenix/end2end/GroupByCaseIT.java | 31 +++- 1 file changed, 17 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/34ba28e6/phoenix-core/src/it/java/org/apache/phoenix/end2end/GroupByCaseIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/GroupByCaseIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/GroupByCaseIT.java index 48b926a..be59fd7 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/GroupByCaseIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/GroupByCaseIT.java @@ -451,32 +451,35 @@ public class GroupByCaseIT extends ParallelStatsDisabledIT { public void testGroupByWithAliasWithSameColumnName() throws SQLException { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); Connection conn = DriverManager.getConnection(getUrl(), props); -String ddl = "create table test3 (pk integer primary key, col integer)"; +String tableName1 = generateUniqueName(); +String tableName2 = generateUniqueName(); +String tableName3 = generateUniqueName(); +String ddl = "create table " + tableName1 + " (pk integer primary key, col integer)"; conn.createStatement().execute(ddl); -ddl = "create table test4 (pk integer primary key, col integer)"; +ddl = "create table " + tableName2 + " (pk integer primary key, col integer)"; conn.createStatement().execute(ddl); -ddl = "create table test5 (notPk integer primary key, col integer)"; +ddl = "create table " + tableName3 + " (notPk integer primary key, col integer)"; conn.createStatement().execute(ddl); -conn.createStatement().execute("UPSERT INTO test3 VALUES (1,2)"); -conn.createStatement().execute("UPSERT INTO test4 VALUES (1,2)"); -conn.createStatement().execute("UPSERT INTO test5 VALUES (1,2)"); -conn.createStatement().executeQuery("select test3.pk as pk from test3 group by pk"); -conn.createStatement().executeQuery("select test3.pk as pk from test3 group by test3.pk"); -conn.createStatement().executeQuery("select test3.pk as pk from test3 as t group by t.pk"); -conn.createStatement().executeQuery("select test3.col as pk from test3"); +conn.createStatement().execute("UPSERT INTO " + tableName1 + " VALUES (1,2)"); +conn.createStatement().execute("UPSERT INTO " + tableName2 + " VALUES (1,2)"); +conn.createStatement().execute("UPSERT INTO " + tableName3 + " VALUES (1,2)"); +conn.createStatement().executeQuery("select " + tableName1 + ".pk as pk from " + tableName1 + " group by pk"); +conn.createStatement().executeQuery("select " + tableName1 + ".pk as pk from " + tableName1 + " group by " + tableName1 + ".pk"); +conn.createStatement().executeQuery("select " + tableName1 + ".pk as pk from " + tableName1 + " as t group by t.pk"); +conn.createStatement().executeQuery("select " + tableName1 + ".col as pk from " + tableName1); conn.createStatement() -.executeQuery("select test3.pk as pk from test3 join test5 on (test3.pk=test5.notPk) group by pk"); +.executeQuery("select " + tableName1 + ".pk as pk from " + tableName1 + " join " + tableName3 + " on (" + tableName1 + ".pk=" + tableName3 + ".notPk) group by pk"); try { -conn.createStatement().executeQuery("select test3.col as pk from test3 group by pk"); +conn.createStatement().executeQuery("select " + tableName1 + ".col as pk from " + tableName1 + " group by pk"); fail(); } catch (AmbiguousColumnException e) {} try { -conn.createStatement().executeQuery("select col as pk from test3 group by pk"); +conn.createStatement().executeQuery("select col as pk from " + tableName1 + " group by pk"); fail(); } catch (AmbiguousColumnException e) {} try { conn.createStatement() -.executeQuery("select test3.pk as pk from test3 join test4 on (test3.pk=test4.pk)
[35/48] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
PHOENIX-3253 Make changes to tests to support method level parallelization Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/cae4a7c4 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/cae4a7c4 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/cae4a7c4 Branch: refs/heads/calcite Commit: cae4a7c449b7f60e60a6cfd9b523087ff2e0d5a6 Parents: 2895835 Author: James TaylorAuthored: Sun Oct 2 11:10:14 2016 -0700 Committer: James Taylor Committed: Sun Oct 2 11:10:14 2016 -0700 -- .../phoenix/end2end/FlappingLocalIndexIT.java | 300 + .../phoenix/end2end/index/BaseLocalIndexIT.java | 80 + .../phoenix/end2end/index/LocalIndexIT.java | 299 + .../phoenix/tx/FlappingTransactionIT.java | 328 ++ .../phoenix/tx/NotThreadSafeTransactionIT.java | 331 --- pom.xml | 4 +- 6 files changed, 712 insertions(+), 630 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/cae4a7c4/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java new file mode 100644 index 000..7509997 --- /dev/null +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java @@ -0,0 +1,300 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.phoenix.end2end; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.util.Properties; + +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.client.HBaseAdmin; +import org.apache.hadoop.hbase.client.HTable; +import org.apache.hadoop.hbase.client.Result; +import org.apache.hadoop.hbase.client.ResultScanner; +import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.Pair; +import org.apache.phoenix.end2end.index.BaseLocalIndexIT; +import org.apache.phoenix.query.QueryConstants; +import org.apache.phoenix.query.QueryServices; +import org.apache.phoenix.util.QueryUtil; +import org.apache.phoenix.util.SchemaUtil; +import org.apache.phoenix.util.TestUtil; +import org.junit.Test; + +public class FlappingLocalIndexIT extends BaseLocalIndexIT { + +public FlappingLocalIndexIT(boolean isNamespaceMapped) { +super(isNamespaceMapped); +} + +@Test +public void testScanWhenATableHasMultipleLocalIndexes() throws Exception { +String tableName = schemaName + "." + generateUniqueName(); +String indexName = "IDX_" + generateUniqueName(); + +createBaseTable(tableName, null, "('e','i','o')"); +Connection conn1 = DriverManager.getConnection(getUrl()); +try { +conn1.createStatement().execute("UPSERT INTO " + tableName + " values('b',1,2,4,'z')"); +conn1.createStatement().execute("UPSERT INTO " + tableName + " values('f',1,2,3,'a')"); +conn1.createStatement().execute("UPSERT INTO " + tableName + " values('j',2,4,2,'a')"); +conn1.createStatement().execute("UPSERT INTO " + tableName + " values('q',3,1,1,'c')"); +conn1.commit(); +conn1.createStatement().execute("CREATE LOCAL INDEX " + indexName + " ON " + tableName + "(v1)"); +conn1.createStatement().execute("CREATE LOCAL INDEX " + indexName + "2 ON " + tableName + "(k3)"); +conn1.commit(); +conn1 = DriverManager.getConnection(getUrl()); +ResultSet rs = conn1.createStatement().executeQuery("SELECT COUNT(*) FROM " + tableName); +assertTrue(rs.next()); +
phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
Repository: phoenix Updated Branches: refs/heads/master 0494e54de -> 34ba28e60 PHOENIX-3253 Make changes to tests to support method level parallelization Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/34ba28e6 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/34ba28e6 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/34ba28e6 Branch: refs/heads/master Commit: 34ba28e60f66cb7b537b60c9ef04b8a26036f010 Parents: 0494e54 Author: James TaylorAuthored: Mon Oct 3 18:02:48 2016 -0700 Committer: James Taylor Committed: Mon Oct 3 18:02:48 2016 -0700 -- .../apache/phoenix/end2end/GroupByCaseIT.java | 31 +++- 1 file changed, 17 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/34ba28e6/phoenix-core/src/it/java/org/apache/phoenix/end2end/GroupByCaseIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/GroupByCaseIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/GroupByCaseIT.java index 48b926a..be59fd7 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/GroupByCaseIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/GroupByCaseIT.java @@ -451,32 +451,35 @@ public class GroupByCaseIT extends ParallelStatsDisabledIT { public void testGroupByWithAliasWithSameColumnName() throws SQLException { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); Connection conn = DriverManager.getConnection(getUrl(), props); -String ddl = "create table test3 (pk integer primary key, col integer)"; +String tableName1 = generateUniqueName(); +String tableName2 = generateUniqueName(); +String tableName3 = generateUniqueName(); +String ddl = "create table " + tableName1 + " (pk integer primary key, col integer)"; conn.createStatement().execute(ddl); -ddl = "create table test4 (pk integer primary key, col integer)"; +ddl = "create table " + tableName2 + " (pk integer primary key, col integer)"; conn.createStatement().execute(ddl); -ddl = "create table test5 (notPk integer primary key, col integer)"; +ddl = "create table " + tableName3 + " (notPk integer primary key, col integer)"; conn.createStatement().execute(ddl); -conn.createStatement().execute("UPSERT INTO test3 VALUES (1,2)"); -conn.createStatement().execute("UPSERT INTO test4 VALUES (1,2)"); -conn.createStatement().execute("UPSERT INTO test5 VALUES (1,2)"); -conn.createStatement().executeQuery("select test3.pk as pk from test3 group by pk"); -conn.createStatement().executeQuery("select test3.pk as pk from test3 group by test3.pk"); -conn.createStatement().executeQuery("select test3.pk as pk from test3 as t group by t.pk"); -conn.createStatement().executeQuery("select test3.col as pk from test3"); +conn.createStatement().execute("UPSERT INTO " + tableName1 + " VALUES (1,2)"); +conn.createStatement().execute("UPSERT INTO " + tableName2 + " VALUES (1,2)"); +conn.createStatement().execute("UPSERT INTO " + tableName3 + " VALUES (1,2)"); +conn.createStatement().executeQuery("select " + tableName1 + ".pk as pk from " + tableName1 + " group by pk"); +conn.createStatement().executeQuery("select " + tableName1 + ".pk as pk from " + tableName1 + " group by " + tableName1 + ".pk"); +conn.createStatement().executeQuery("select " + tableName1 + ".pk as pk from " + tableName1 + " as t group by t.pk"); +conn.createStatement().executeQuery("select " + tableName1 + ".col as pk from " + tableName1); conn.createStatement() -.executeQuery("select test3.pk as pk from test3 join test5 on (test3.pk=test5.notPk) group by pk"); +.executeQuery("select " + tableName1 + ".pk as pk from " + tableName1 + " join " + tableName3 + " on (" + tableName1 + ".pk=" + tableName3 + ".notPk) group by pk"); try { -conn.createStatement().executeQuery("select test3.col as pk from test3 group by pk"); +conn.createStatement().executeQuery("select " + tableName1 + ".col as pk from " + tableName1 + " group by pk"); fail(); } catch (AmbiguousColumnException e) {} try { -conn.createStatement().executeQuery("select col as pk from test3 group by pk"); +conn.createStatement().executeQuery("select col as pk from " + tableName1 + " group by pk"); fail(); } catch (AmbiguousColumnException e) {} try { conn.createStatement() -
phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-0.98 1cce661b8 -> 08d9c7154 PHOENIX-3253 Make changes to tests to support method level parallelization Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/08d9c715 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/08d9c715 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/08d9c715 Branch: refs/heads/4.x-HBase-0.98 Commit: 08d9c7154194de69ce688ad78357bffb8d34c92f Parents: 1cce661 Author: James TaylorAuthored: Mon Oct 3 13:46:53 2016 -0700 Committer: James Taylor Committed: Mon Oct 3 13:53:13 2016 -0700 -- .../src/it/java/org/apache/phoenix/end2end/index/IndexIT.java| 4 1 file changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/08d9c715/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java index 254046b..cb4310b 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java @@ -230,6 +230,10 @@ public class IndexIT extends ParallelStatsDisabledIT { testCreateIndexAfterUpsertStarted(false, SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, generateUniqueName()), SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, generateUniqueName())); +} + +@Test +public void testCreateIndexAfterUpsertStartedTxnl() throws Exception { if (transactional) { testCreateIndexAfterUpsertStarted(true, SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, generateUniqueName()),
phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.1 976c97ac0 -> 73be315a2 PHOENIX-3253 Make changes to tests to support method level parallelization Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/73be315a Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/73be315a Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/73be315a Branch: refs/heads/4.x-HBase-1.1 Commit: 73be315a2a80e8aaba9839eaa340281f92f6691f Parents: 976c97a Author: James TaylorAuthored: Mon Oct 3 13:46:53 2016 -0700 Committer: James Taylor Committed: Mon Oct 3 13:52:05 2016 -0700 -- .../src/it/java/org/apache/phoenix/end2end/index/IndexIT.java| 4 1 file changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/73be315a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java index 254046b..cb4310b 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java @@ -230,6 +230,10 @@ public class IndexIT extends ParallelStatsDisabledIT { testCreateIndexAfterUpsertStarted(false, SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, generateUniqueName()), SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, generateUniqueName())); +} + +@Test +public void testCreateIndexAfterUpsertStartedTxnl() throws Exception { if (transactional) { testCreateIndexAfterUpsertStarted(true, SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, generateUniqueName()),
phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
Repository: phoenix Updated Branches: refs/heads/master 4c0aeb0d5 -> 0494e54de PHOENIX-3253 Make changes to tests to support method level parallelization Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/0494e54d Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/0494e54d Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/0494e54d Branch: refs/heads/master Commit: 0494e54de2a9ff7e1115678658fb092c95602930 Parents: 4c0aeb0 Author: James TaylorAuthored: Mon Oct 3 13:46:53 2016 -0700 Committer: James Taylor Committed: Mon Oct 3 13:47:38 2016 -0700 -- .../src/it/java/org/apache/phoenix/end2end/index/IndexIT.java| 4 1 file changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/0494e54d/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java index 254046b..cb4310b 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java @@ -230,6 +230,10 @@ public class IndexIT extends ParallelStatsDisabledIT { testCreateIndexAfterUpsertStarted(false, SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, generateUniqueName()), SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, generateUniqueName())); +} + +@Test +public void testCreateIndexAfterUpsertStartedTxnl() throws Exception { if (transactional) { testCreateIndexAfterUpsertStarted(true, SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, generateUniqueName()),
[1/3] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-0.98 fc01284b1 -> 1cce661b8 PHOENIX-3253 Make changes to tests to support method level parallelization Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/1cce661b Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/1cce661b Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/1cce661b Branch: refs/heads/4.x-HBase-0.98 Commit: 1cce661b8eefde5cc7b5d7799ba5e148a91516a7 Parents: d5b3bce Author: James TaylorAuthored: Sun Oct 2 12:47:34 2016 -0700 Committer: James Taylor Committed: Mon Oct 3 09:51:06 2016 -0700 -- .../apache/phoenix/end2end/AlterTableIT.java| 49 -- .../phoenix/end2end/FlappingAlterTableIT.java | 97 pom.xml | 28 +++--- 3 files changed, 114 insertions(+), 60 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/1cce661b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java index 0125a63..48f4217 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java @@ -1083,30 +1083,6 @@ public class AlterTableIT extends ParallelStatsDisabledIT { } @Test -public void testAddColumnForNewColumnFamily() throws Exception { -Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); -String ddl = "CREATE TABLE " + dataTableFullName + " (\n" -+"ID1 VARCHAR(15) NOT NULL,\n" -+"ID2 VARCHAR(15) NOT NULL,\n" -+"CREATED_DATE DATE,\n" -+"CREATION_TIME BIGINT,\n" -+"LAST_USED DATE,\n" -+"CONSTRAINT PK PRIMARY KEY (ID1, ID2)) SALT_BUCKETS = 8"; -Connection conn1 = DriverManager.getConnection(getUrl(), props); -conn1.createStatement().execute(ddl); -ddl = "ALTER TABLE " + dataTableFullName + " ADD CF.STRING VARCHAR"; -conn1.createStatement().execute(ddl); -try (HBaseAdmin admin = conn1.unwrap(PhoenixConnection.class).getQueryServices().getAdmin()) { -HColumnDescriptor[] columnFamilies = admin.getTableDescriptor(Bytes.toBytes(dataTableFullName)).getColumnFamilies(); -assertEquals(2, columnFamilies.length); -assertEquals("0", columnFamilies[0].getNameAsString()); -assertEquals(HColumnDescriptor.DEFAULT_TTL, columnFamilies[0].getTimeToLive()); -assertEquals("CF", columnFamilies[1].getNameAsString()); -assertEquals(HColumnDescriptor.DEFAULT_TTL, columnFamilies[1].getTimeToLive()); -} -} - -@Test public void testSetHColumnProperties() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); String ddl = "CREATE TABLE " + dataTableFullName + " (\n" @@ -1414,31 +1390,6 @@ public class AlterTableIT extends ParallelStatsDisabledIT { } } -@Test -public void testNewColumnFamilyInheritsTTLOfEmptyCF() throws Exception { -Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); -String ddl = "CREATE TABLE " + dataTableFullName + " (\n" -+"ID1 VARCHAR(15) NOT NULL,\n" -+"ID2 VARCHAR(15) NOT NULL,\n" -+"CREATED_DATE DATE,\n" -+"CREATION_TIME BIGINT,\n" -+"LAST_USED DATE,\n" -+"CONSTRAINT PK PRIMARY KEY (ID1, ID2)) SALT_BUCKETS = 8, TTL = 1000"; -Connection conn1 = DriverManager.getConnection(getUrl(), props); -conn1.createStatement().execute(ddl); -ddl = "ALTER TABLE " + dataTableFullName + " ADD CF.STRING VARCHAR"; -conn1.createStatement().execute(ddl); -try (HBaseAdmin admin = conn1.unwrap(PhoenixConnection.class).getQueryServices().getAdmin()) { -HTableDescriptor tableDesc = admin.getTableDescriptor(Bytes.toBytes(dataTableFullName)); -HColumnDescriptor[] columnFamilies = tableDesc.getColumnFamilies(); -assertEquals(2, columnFamilies.length); -assertEquals("0", columnFamilies[0].getNameAsString()); -assertEquals(1000, columnFamilies[0].getTimeToLive()); -assertEquals("CF", columnFamilies[1].getNameAsString()); -assertEquals(1000, columnFamilies[1].getTimeToLive()); -} -} - private static void assertImmutableRows(Connection conn, String fullTableName, boolean expectedValue) throws SQLException
[2/3] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
PHOENIX-3253 Make changes to tests to support method level parallelization Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/d5b3bced Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/d5b3bced Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/d5b3bced Branch: refs/heads/4.x-HBase-0.98 Commit: d5b3bcedf34e716a54038410e29dafb21ac05ccf Parents: 577a6de Author: James TaylorAuthored: Sun Oct 2 11:10:14 2016 -0700 Committer: James Taylor Committed: Mon Oct 3 09:51:06 2016 -0700 -- .../phoenix/end2end/FlappingLocalIndexIT.java | 300 + .../phoenix/end2end/index/BaseLocalIndexIT.java | 80 + .../phoenix/end2end/index/LocalIndexIT.java | 299 + .../phoenix/tx/FlappingTransactionIT.java | 328 ++ .../phoenix/tx/NotThreadSafeTransactionIT.java | 331 --- pom.xml | 4 +- 6 files changed, 712 insertions(+), 630 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/d5b3bced/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java new file mode 100644 index 000..7509997 --- /dev/null +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java @@ -0,0 +1,300 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.phoenix.end2end; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.util.Properties; + +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.client.HBaseAdmin; +import org.apache.hadoop.hbase.client.HTable; +import org.apache.hadoop.hbase.client.Result; +import org.apache.hadoop.hbase.client.ResultScanner; +import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.Pair; +import org.apache.phoenix.end2end.index.BaseLocalIndexIT; +import org.apache.phoenix.query.QueryConstants; +import org.apache.phoenix.query.QueryServices; +import org.apache.phoenix.util.QueryUtil; +import org.apache.phoenix.util.SchemaUtil; +import org.apache.phoenix.util.TestUtil; +import org.junit.Test; + +public class FlappingLocalIndexIT extends BaseLocalIndexIT { + +public FlappingLocalIndexIT(boolean isNamespaceMapped) { +super(isNamespaceMapped); +} + +@Test +public void testScanWhenATableHasMultipleLocalIndexes() throws Exception { +String tableName = schemaName + "." + generateUniqueName(); +String indexName = "IDX_" + generateUniqueName(); + +createBaseTable(tableName, null, "('e','i','o')"); +Connection conn1 = DriverManager.getConnection(getUrl()); +try { +conn1.createStatement().execute("UPSERT INTO " + tableName + " values('b',1,2,4,'z')"); +conn1.createStatement().execute("UPSERT INTO " + tableName + " values('f',1,2,3,'a')"); +conn1.createStatement().execute("UPSERT INTO " + tableName + " values('j',2,4,2,'a')"); +conn1.createStatement().execute("UPSERT INTO " + tableName + " values('q',3,1,1,'c')"); +conn1.commit(); +conn1.createStatement().execute("CREATE LOCAL INDEX " + indexName + " ON " + tableName + "(v1)"); +conn1.createStatement().execute("CREATE LOCAL INDEX " + indexName + "2 ON " + tableName + "(k3)"); +conn1.commit(); +conn1 = DriverManager.getConnection(getUrl()); +ResultSet rs = conn1.createStatement().executeQuery("SELECT COUNT(*) FROM " + tableName); +
[3/3] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
PHOENIX-3253 Make changes to tests to support method level parallelization Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/976c97ac Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/976c97ac Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/976c97ac Branch: refs/heads/4.x-HBase-1.1 Commit: 976c97ac085a8b96e40e7da05740568b2c4757a7 Parents: 7f1ccc2 Author: James TaylorAuthored: Sun Oct 2 12:47:34 2016 -0700 Committer: James Taylor Committed: Mon Oct 3 09:20:31 2016 -0700 -- .../apache/phoenix/end2end/AlterTableIT.java| 49 -- .../phoenix/end2end/FlappingAlterTableIT.java | 97 pom.xml | 28 +++--- 3 files changed, 114 insertions(+), 60 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/976c97ac/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java index 0125a63..48f4217 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java @@ -1083,30 +1083,6 @@ public class AlterTableIT extends ParallelStatsDisabledIT { } @Test -public void testAddColumnForNewColumnFamily() throws Exception { -Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); -String ddl = "CREATE TABLE " + dataTableFullName + " (\n" -+"ID1 VARCHAR(15) NOT NULL,\n" -+"ID2 VARCHAR(15) NOT NULL,\n" -+"CREATED_DATE DATE,\n" -+"CREATION_TIME BIGINT,\n" -+"LAST_USED DATE,\n" -+"CONSTRAINT PK PRIMARY KEY (ID1, ID2)) SALT_BUCKETS = 8"; -Connection conn1 = DriverManager.getConnection(getUrl(), props); -conn1.createStatement().execute(ddl); -ddl = "ALTER TABLE " + dataTableFullName + " ADD CF.STRING VARCHAR"; -conn1.createStatement().execute(ddl); -try (HBaseAdmin admin = conn1.unwrap(PhoenixConnection.class).getQueryServices().getAdmin()) { -HColumnDescriptor[] columnFamilies = admin.getTableDescriptor(Bytes.toBytes(dataTableFullName)).getColumnFamilies(); -assertEquals(2, columnFamilies.length); -assertEquals("0", columnFamilies[0].getNameAsString()); -assertEquals(HColumnDescriptor.DEFAULT_TTL, columnFamilies[0].getTimeToLive()); -assertEquals("CF", columnFamilies[1].getNameAsString()); -assertEquals(HColumnDescriptor.DEFAULT_TTL, columnFamilies[1].getTimeToLive()); -} -} - -@Test public void testSetHColumnProperties() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); String ddl = "CREATE TABLE " + dataTableFullName + " (\n" @@ -1414,31 +1390,6 @@ public class AlterTableIT extends ParallelStatsDisabledIT { } } -@Test -public void testNewColumnFamilyInheritsTTLOfEmptyCF() throws Exception { -Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); -String ddl = "CREATE TABLE " + dataTableFullName + " (\n" -+"ID1 VARCHAR(15) NOT NULL,\n" -+"ID2 VARCHAR(15) NOT NULL,\n" -+"CREATED_DATE DATE,\n" -+"CREATION_TIME BIGINT,\n" -+"LAST_USED DATE,\n" -+"CONSTRAINT PK PRIMARY KEY (ID1, ID2)) SALT_BUCKETS = 8, TTL = 1000"; -Connection conn1 = DriverManager.getConnection(getUrl(), props); -conn1.createStatement().execute(ddl); -ddl = "ALTER TABLE " + dataTableFullName + " ADD CF.STRING VARCHAR"; -conn1.createStatement().execute(ddl); -try (HBaseAdmin admin = conn1.unwrap(PhoenixConnection.class).getQueryServices().getAdmin()) { -HTableDescriptor tableDesc = admin.getTableDescriptor(Bytes.toBytes(dataTableFullName)); -HColumnDescriptor[] columnFamilies = tableDesc.getColumnFamilies(); -assertEquals(2, columnFamilies.length); -assertEquals("0", columnFamilies[0].getNameAsString()); -assertEquals(1000, columnFamilies[0].getTimeToLive()); -assertEquals("CF", columnFamilies[1].getNameAsString()); -assertEquals(1000, columnFamilies[1].getTimeToLive()); -} -} - private static void assertImmutableRows(Connection conn, String fullTableName, boolean expectedValue) throws SQLException { PhoenixConnection pconn = conn.unwrap(PhoenixConnection.class);
[2/3] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
PHOENIX-3253 Make changes to tests to support method level parallelization Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/7f1ccc21 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/7f1ccc21 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/7f1ccc21 Branch: refs/heads/4.x-HBase-1.1 Commit: 7f1ccc2125be4a6d900f47113f09d7c0a4dba601 Parents: ddce0bf Author: James TaylorAuthored: Sun Oct 2 11:10:14 2016 -0700 Committer: James Taylor Committed: Mon Oct 3 09:16:21 2016 -0700 -- .../phoenix/end2end/FlappingLocalIndexIT.java | 300 + .../phoenix/end2end/index/BaseLocalIndexIT.java | 80 + .../phoenix/end2end/index/LocalIndexIT.java | 299 + .../phoenix/tx/FlappingTransactionIT.java | 328 ++ .../phoenix/tx/NotThreadSafeTransactionIT.java | 331 --- pom.xml | 4 +- 6 files changed, 712 insertions(+), 630 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/7f1ccc21/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java new file mode 100644 index 000..7509997 --- /dev/null +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java @@ -0,0 +1,300 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.phoenix.end2end; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.util.Properties; + +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.client.HBaseAdmin; +import org.apache.hadoop.hbase.client.HTable; +import org.apache.hadoop.hbase.client.Result; +import org.apache.hadoop.hbase.client.ResultScanner; +import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.Pair; +import org.apache.phoenix.end2end.index.BaseLocalIndexIT; +import org.apache.phoenix.query.QueryConstants; +import org.apache.phoenix.query.QueryServices; +import org.apache.phoenix.util.QueryUtil; +import org.apache.phoenix.util.SchemaUtil; +import org.apache.phoenix.util.TestUtil; +import org.junit.Test; + +public class FlappingLocalIndexIT extends BaseLocalIndexIT { + +public FlappingLocalIndexIT(boolean isNamespaceMapped) { +super(isNamespaceMapped); +} + +@Test +public void testScanWhenATableHasMultipleLocalIndexes() throws Exception { +String tableName = schemaName + "." + generateUniqueName(); +String indexName = "IDX_" + generateUniqueName(); + +createBaseTable(tableName, null, "('e','i','o')"); +Connection conn1 = DriverManager.getConnection(getUrl()); +try { +conn1.createStatement().execute("UPSERT INTO " + tableName + " values('b',1,2,4,'z')"); +conn1.createStatement().execute("UPSERT INTO " + tableName + " values('f',1,2,3,'a')"); +conn1.createStatement().execute("UPSERT INTO " + tableName + " values('j',2,4,2,'a')"); +conn1.createStatement().execute("UPSERT INTO " + tableName + " values('q',3,1,1,'c')"); +conn1.commit(); +conn1.createStatement().execute("CREATE LOCAL INDEX " + indexName + " ON " + tableName + "(v1)"); +conn1.createStatement().execute("CREATE LOCAL INDEX " + indexName + "2 ON " + tableName + "(k3)"); +conn1.commit(); +conn1 = DriverManager.getConnection(getUrl()); +ResultSet rs = conn1.createStatement().executeQuery("SELECT COUNT(*) FROM " + tableName); +
phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
Repository: phoenix Updated Branches: refs/heads/master cae4a7c44 -> 2f51568a7 PHOENIX-3253 Make changes to tests to support method level parallelization Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/2f51568a Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/2f51568a Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/2f51568a Branch: refs/heads/master Commit: 2f51568a71aed4ac8d8a078d3f10bb5afeedd4c4 Parents: cae4a7c Author: James TaylorAuthored: Sun Oct 2 12:47:34 2016 -0700 Committer: James Taylor Committed: Sun Oct 2 12:47:34 2016 -0700 -- .../apache/phoenix/end2end/AlterTableIT.java| 49 -- .../phoenix/end2end/FlappingAlterTableIT.java | 97 pom.xml | 12 +-- 3 files changed, 103 insertions(+), 55 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/2f51568a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java index 0125a63..48f4217 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java @@ -1083,30 +1083,6 @@ public class AlterTableIT extends ParallelStatsDisabledIT { } @Test -public void testAddColumnForNewColumnFamily() throws Exception { -Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); -String ddl = "CREATE TABLE " + dataTableFullName + " (\n" -+"ID1 VARCHAR(15) NOT NULL,\n" -+"ID2 VARCHAR(15) NOT NULL,\n" -+"CREATED_DATE DATE,\n" -+"CREATION_TIME BIGINT,\n" -+"LAST_USED DATE,\n" -+"CONSTRAINT PK PRIMARY KEY (ID1, ID2)) SALT_BUCKETS = 8"; -Connection conn1 = DriverManager.getConnection(getUrl(), props); -conn1.createStatement().execute(ddl); -ddl = "ALTER TABLE " + dataTableFullName + " ADD CF.STRING VARCHAR"; -conn1.createStatement().execute(ddl); -try (HBaseAdmin admin = conn1.unwrap(PhoenixConnection.class).getQueryServices().getAdmin()) { -HColumnDescriptor[] columnFamilies = admin.getTableDescriptor(Bytes.toBytes(dataTableFullName)).getColumnFamilies(); -assertEquals(2, columnFamilies.length); -assertEquals("0", columnFamilies[0].getNameAsString()); -assertEquals(HColumnDescriptor.DEFAULT_TTL, columnFamilies[0].getTimeToLive()); -assertEquals("CF", columnFamilies[1].getNameAsString()); -assertEquals(HColumnDescriptor.DEFAULT_TTL, columnFamilies[1].getTimeToLive()); -} -} - -@Test public void testSetHColumnProperties() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); String ddl = "CREATE TABLE " + dataTableFullName + " (\n" @@ -1414,31 +1390,6 @@ public class AlterTableIT extends ParallelStatsDisabledIT { } } -@Test -public void testNewColumnFamilyInheritsTTLOfEmptyCF() throws Exception { -Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); -String ddl = "CREATE TABLE " + dataTableFullName + " (\n" -+"ID1 VARCHAR(15) NOT NULL,\n" -+"ID2 VARCHAR(15) NOT NULL,\n" -+"CREATED_DATE DATE,\n" -+"CREATION_TIME BIGINT,\n" -+"LAST_USED DATE,\n" -+"CONSTRAINT PK PRIMARY KEY (ID1, ID2)) SALT_BUCKETS = 8, TTL = 1000"; -Connection conn1 = DriverManager.getConnection(getUrl(), props); -conn1.createStatement().execute(ddl); -ddl = "ALTER TABLE " + dataTableFullName + " ADD CF.STRING VARCHAR"; -conn1.createStatement().execute(ddl); -try (HBaseAdmin admin = conn1.unwrap(PhoenixConnection.class).getQueryServices().getAdmin()) { -HTableDescriptor tableDesc = admin.getTableDescriptor(Bytes.toBytes(dataTableFullName)); -HColumnDescriptor[] columnFamilies = tableDesc.getColumnFamilies(); -assertEquals(2, columnFamilies.length); -assertEquals("0", columnFamilies[0].getNameAsString()); -assertEquals(1000, columnFamilies[0].getTimeToLive()); -assertEquals("CF", columnFamilies[1].getNameAsString()); -assertEquals(1000, columnFamilies[1].getTimeToLive()); -} -} - private static void assertImmutableRows(Connection conn, String fullTableName, boolean expectedValue) throws SQLException {
phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
Repository: phoenix Updated Branches: refs/heads/master 2895835a8 -> cae4a7c44 PHOENIX-3253 Make changes to tests to support method level parallelization Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/cae4a7c4 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/cae4a7c4 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/cae4a7c4 Branch: refs/heads/master Commit: cae4a7c449b7f60e60a6cfd9b523087ff2e0d5a6 Parents: 2895835 Author: James TaylorAuthored: Sun Oct 2 11:10:14 2016 -0700 Committer: James Taylor Committed: Sun Oct 2 11:10:14 2016 -0700 -- .../phoenix/end2end/FlappingLocalIndexIT.java | 300 + .../phoenix/end2end/index/BaseLocalIndexIT.java | 80 + .../phoenix/end2end/index/LocalIndexIT.java | 299 + .../phoenix/tx/FlappingTransactionIT.java | 328 ++ .../phoenix/tx/NotThreadSafeTransactionIT.java | 331 --- pom.xml | 4 +- 6 files changed, 712 insertions(+), 630 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/cae4a7c4/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java new file mode 100644 index 000..7509997 --- /dev/null +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/FlappingLocalIndexIT.java @@ -0,0 +1,300 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.phoenix.end2end; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.util.Properties; + +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.client.HBaseAdmin; +import org.apache.hadoop.hbase.client.HTable; +import org.apache.hadoop.hbase.client.Result; +import org.apache.hadoop.hbase.client.ResultScanner; +import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.Pair; +import org.apache.phoenix.end2end.index.BaseLocalIndexIT; +import org.apache.phoenix.query.QueryConstants; +import org.apache.phoenix.query.QueryServices; +import org.apache.phoenix.util.QueryUtil; +import org.apache.phoenix.util.SchemaUtil; +import org.apache.phoenix.util.TestUtil; +import org.junit.Test; + +public class FlappingLocalIndexIT extends BaseLocalIndexIT { + +public FlappingLocalIndexIT(boolean isNamespaceMapped) { +super(isNamespaceMapped); +} + +@Test +public void testScanWhenATableHasMultipleLocalIndexes() throws Exception { +String tableName = schemaName + "." + generateUniqueName(); +String indexName = "IDX_" + generateUniqueName(); + +createBaseTable(tableName, null, "('e','i','o')"); +Connection conn1 = DriverManager.getConnection(getUrl()); +try { +conn1.createStatement().execute("UPSERT INTO " + tableName + " values('b',1,2,4,'z')"); +conn1.createStatement().execute("UPSERT INTO " + tableName + " values('f',1,2,3,'a')"); +conn1.createStatement().execute("UPSERT INTO " + tableName + " values('j',2,4,2,'a')"); +conn1.createStatement().execute("UPSERT INTO " + tableName + " values('q',3,1,1,'c')"); +conn1.commit(); +conn1.createStatement().execute("CREATE LOCAL INDEX " + indexName + " ON " + tableName + "(v1)"); +conn1.createStatement().execute("CREATE LOCAL INDEX " + indexName + "2 ON " + tableName + "(k3)"); +conn1.commit(); +conn1 = DriverManager.getConnection(getUrl()); +ResultSet rs =
[6/6] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
PHOENIX-3253 Make changes to tests to support method level parallelization Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/26109c4f Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/26109c4f Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/26109c4f Branch: refs/heads/4.x-HBase-0.98 Commit: 26109c4fa172dd5aca239383a0090f02967880d7 Parents: 39d2361 Author: James TaylorAuthored: Thu Sep 22 18:28:04 2016 -0700 Committer: James Taylor Committed: Thu Sep 22 18:28:04 2016 -0700 -- .../StatisticsCollectionRunTrackerIT.java | 2 +- .../phoenix/end2end/AbsFunctionEnd2EndIT.java | 2 +- .../AlterMultiTenantTableWithViewsIT.java | 16 +- .../apache/phoenix/end2end/AlterTableIT.java| 10 +- .../phoenix/end2end/AlterTableWithViewsIT.java | 16 +- .../phoenix/end2end/AppendOnlySchemaIT.java | 22 +-- .../phoenix/end2end/ArithmeticQueryIT.java | 36 ++-- .../phoenix/end2end/ArrayAppendFunctionIT.java | 18 +- .../phoenix/end2end/ArrayConcatFunctionIT.java | 16 +- .../phoenix/end2end/ArrayFillFunctionIT.java| 12 +- .../phoenix/end2end/ArrayPrependFunctionIT.java | 68 +++ .../end2end/ArrayToStringFunctionIT.java| 22 +-- .../phoenix/end2end/ArraysWithNullsIT.java | 32 ++-- .../apache/phoenix/end2end/AutoCommitIT.java| 2 +- .../phoenix/end2end/AutoPartitionViewsIT.java | 18 +- .../end2end/BaseTenantSpecificTablesIT.java | 12 +- .../end2end/BaseTenantSpecificViewIndexIT.java | 12 +- .../org/apache/phoenix/end2end/BaseViewIT.java | 8 +- .../apache/phoenix/end2end/BinaryRowKeyIT.java | 6 +- .../phoenix/end2end/CSVCommonsLoaderIT.java | 20 +- .../phoenix/end2end/CbrtFunctionEnd2EndIT.java | 4 +- .../phoenix/end2end/CoalesceFunctionIT.java | 20 +- .../end2end/ConvertTimezoneFunctionIT.java | 14 +- .../org/apache/phoenix/end2end/DateTimeIT.java | 68 +++ .../phoenix/end2end/DecodeFunctionIT.java | 12 +- .../org/apache/phoenix/end2end/DeleteIT.java| 26 +-- .../phoenix/end2end/DisableLocalIndexIT.java| 2 +- .../phoenix/end2end/DistinctPrefixFilterIT.java | 6 +- .../apache/phoenix/end2end/DynamicFamilyIT.java | 4 +- .../apache/phoenix/end2end/DynamicUpsertIT.java | 2 +- .../phoenix/end2end/EncodeFunctionIT.java | 8 +- .../phoenix/end2end/EvaluationOfORIT.java | 2 +- .../phoenix/end2end/ExecuteStatementsIT.java| 6 +- .../phoenix/end2end/ExpFunctionEnd2EndIT.java | 4 +- .../phoenix/end2end/FirstValueFunctionIT.java | 14 +- .../end2end/GetSetByteBitFunctionEnd2EndIT.java | 2 +- .../apache/phoenix/end2end/GroupByCaseIT.java | 20 +- .../apache/phoenix/end2end/HashJoinMoreIT.java | 12 +- .../org/apache/phoenix/end2end/InListIT.java| 10 +- .../apache/phoenix/end2end/IndexExtendedIT.java | 30 +-- .../apache/phoenix/end2end/InstrFunctionIT.java | 16 +- .../org/apache/phoenix/end2end/IsNullIT.java| 6 +- .../org/apache/phoenix/end2end/KeyOnlyIT.java | 2 +- .../phoenix/end2end/LastValueFunctionIT.java| 22 +-- .../phoenix/end2end/LikeExpressionIT.java | 12 +- .../phoenix/end2end/LnLogFunctionEnd2EndIT.java | 4 +- .../apache/phoenix/end2end/MD5FunctionIT.java | 6 +- .../org/apache/phoenix/end2end/MapReduceIT.java | 8 +- .../phoenix/end2end/MappingTableDataTypeIT.java | 2 +- .../end2end/MinMaxAggregateFunctionIT.java | 2 +- .../phoenix/end2end/ModulusExpressionIT.java| 10 +- .../phoenix/end2end/MultiCfQueryExecIT.java | 2 +- .../end2end/NamespaceSchemaMappingIT.java | 2 +- .../phoenix/end2end/NthValueFunctionIT.java | 22 +-- .../end2end/OctetLengthFunctionEnd2EndIT.java | 2 +- .../org/apache/phoenix/end2end/OrderByIT.java | 16 +- .../phoenix/end2end/ParallelIteratorsIT.java| 4 +- .../apache/phoenix/end2end/PercentileIT.java| 15 +- .../phoenix/end2end/PhoenixRuntimeIT.java | 18 +- .../phoenix/end2end/PowerFunctionEnd2EndIT.java | 4 +- .../apache/phoenix/end2end/PrimitiveTypeIT.java | 18 +- .../org/apache/phoenix/end2end/QueryMoreIT.java | 8 +- .../phoenix/end2end/QueryWithOffsetIT.java | 2 +- .../apache/phoenix/end2end/RTrimFunctionIT.java | 2 +- .../org/apache/phoenix/end2end/ReadOnlyIT.java | 2 +- .../end2end/RegexpReplaceFunctionIT.java| 2 +- .../phoenix/end2end/RegexpSplitFunctionIT.java | 2 +- .../phoenix/end2end/RegexpSubstrFunctionIT.java | 2 +- .../phoenix/end2end/ReverseFunctionIT.java | 2 +- .../apache/phoenix/end2end/ReverseScanIT.java | 4 +- .../phoenix/end2end/RoundFloorCeilFuncIT.java | 2 +- .../phoenix/end2end/SerialIteratorsIT.java | 2 +- .../phoenix/end2end/ServerExceptionIT.java | 2 +- .../phoenix/end2end/SignFunctionEnd2EndIT.java |
[4/6] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java index e28f510..2a3ebf7 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java @@ -33,7 +33,7 @@ public class LastValueFunctionIT extends ParallelStatsDisabledIT { @Test public void unsignedLong() throws Exception { Connection conn = DriverManager.getConnection(getUrl()); -String tableName = generateRandomString(); +String tableName = generateUniqueName(); String ddl = "CREATE TABLE IF NOT EXISTS " + tableName + "(id INTEGER NOT NULL PRIMARY KEY, page_id UNSIGNED_LONG," + " date DATE, \"value\" UNSIGNED_LONG)"; @@ -65,7 +65,7 @@ public class LastValueFunctionIT extends ParallelStatsDisabledIT { @Test public void signedInteger() throws Exception { Connection conn = DriverManager.getConnection(getUrl()); -String tableName = generateRandomString(); +String tableName = generateUniqueName(); String ddl = "CREATE TABLE IF NOT EXISTS " + tableName + "(id INTEGER NOT NULL PRIMARY KEY, page_id UNSIGNED_LONG, date INTEGER, \"value\" INTEGER)"; @@ -90,7 +90,7 @@ public class LastValueFunctionIT extends ParallelStatsDisabledIT { @Test public void unsignedInteger() throws Exception { Connection conn = DriverManager.getConnection(getUrl()); -String tableName = generateRandomString(); +String tableName = generateUniqueName(); String ddl = "CREATE TABLE IF NOT EXISTS " + tableName + "(id INTEGER NOT NULL PRIMARY KEY, page_id UNSIGNED_LONG," @@ -115,7 +115,7 @@ public class LastValueFunctionIT extends ParallelStatsDisabledIT { @Test public void simpleTestDescOrder() throws Exception { Connection conn = DriverManager.getConnection(getUrl()); -String tableName = generateRandomString(); +String tableName = generateUniqueName(); String ddl = "CREATE TABLE IF NOT EXISTS " + tableName + "(id INTEGER NOT NULL PRIMARY KEY, page_id UNSIGNED_LONG," @@ -141,7 +141,7 @@ public class LastValueFunctionIT extends ParallelStatsDisabledIT { @Test public void simpleTestAscOrder() throws Exception { Connection conn = DriverManager.getConnection(getUrl()); -String tableName = generateRandomString(); +String tableName = generateUniqueName(); String ddl = "CREATE TABLE IF NOT EXISTS " + tableName + "(id INTEGER NOT NULL PRIMARY KEY, page_id UNSIGNED_LONG," @@ -167,7 +167,7 @@ public class LastValueFunctionIT extends ParallelStatsDisabledIT { @Test public void charDatatype() throws Exception { Connection conn = DriverManager.getConnection(getUrl()); -String tableName = generateRandomString(); +String tableName = generateUniqueName(); String ddl = "CREATE TABLE IF NOT EXISTS " + tableName + "(id INTEGER NOT NULL PRIMARY KEY, page_id UNSIGNED_LONG, " @@ -192,7 +192,7 @@ public class LastValueFunctionIT extends ParallelStatsDisabledIT { @Test public void varcharVariableLenghtDatatype() throws Exception { Connection conn = DriverManager.getConnection(getUrl()); -String tableName = generateRandomString(); +String tableName = generateUniqueName(); String ddl = "CREATE TABLE IF NOT EXISTS " + tableName + "(id INTEGER NOT NULL PRIMARY KEY, page_id UNSIGNED_LONG," @@ -217,7 +217,7 @@ public class LastValueFunctionIT extends ParallelStatsDisabledIT { @Test public void groupMultipleValues() throws Exception { Connection conn = DriverManager.getConnection(getUrl()); -String tableName = generateRandomString(); +String tableName = generateUniqueName(); String ddl = "CREATE TABLE IF NOT EXISTS " + tableName + "(id INTEGER NOT NULL PRIMARY KEY, page_id UNSIGNED_LONG," @@ -254,7 +254,7 @@ public class LastValueFunctionIT extends ParallelStatsDisabledIT { @Test public void nullValuesInAggregatingColumns() throws Exception { Connection conn = DriverManager.getConnection(getUrl()); -String tableName = generateRandomString(); +String tableName = generateUniqueName(); String ddl = "CREATE TABLE IF NOT EXISTS " + tableName + "(id INTEGER NOT NULL PRIMARY KEY, page_id UNSIGNED_LONG," @@ -279,7 +279,7 @@ public class LastValueFunctionIT extends ParallelStatsDisabledIT { @Test
[2/6] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java index 0d03389..78a6e9b 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java @@ -45,13 +45,13 @@ public class UseSchemaIT extends ParallelStatsDisabledIT { @Test public void testUseSchemaCaseInsensitive() throws Exception { -String schemaName = generateRandomString(); +String schemaName = generateUniqueName(); testUseSchema(schemaName); } @Test public void testUseSchemaCaseSensitive() throws Exception { -String schemaName = generateRandomString(); +String schemaName = generateUniqueName(); testUseSchema("\"" + schemaName + "\""); } @@ -61,7 +61,7 @@ public class UseSchemaIT extends ParallelStatsDisabledIT { Connection conn = DriverManager.getConnection(getUrl(), props); String ddl = "CREATE SCHEMA IF NOT EXISTS "+schema; conn.createStatement().execute(ddl); -String testTable = generateRandomString(); +String testTable = generateUniqueName(); ddl = "create table "+schema+"." + testTable + "(id varchar primary key)"; conn.createStatement().execute(ddl); conn.createStatement().execute("use "+schema); @@ -89,14 +89,14 @@ public class UseSchemaIT extends ParallelStatsDisabledIT { @Test public void testSchemaInJdbcUrl() throws Exception { Properties props = new Properties(); -String schema = generateRandomString(); +String schema = generateUniqueName(); props.setProperty(QueryServices.SCHEMA_ATTRIB, schema); props.setProperty(QueryServices.IS_NAMESPACE_MAPPING_ENABLED, Boolean.toString(true)); Connection conn = DriverManager.getConnection(getUrl(), props); conn.setAutoCommit(true); String ddl = "CREATE SCHEMA IF NOT EXISTS " + schema; conn.createStatement().execute(ddl); -String testTable = generateRandomString(); +String testTable = generateUniqueName(); ddl = "create table IF NOT EXISTS " + schema + "." + testTable + " (schema_name varchar primary key)"; conn.createStatement().execute(ddl); conn.createStatement().executeUpdate("upsert into " + schema + "." + testTable + " values('" + schema + "')"); @@ -105,7 +105,7 @@ public class UseSchemaIT extends ParallelStatsDisabledIT { assertTrue(rs.next()); assertEquals(schema, rs.getString(1)); -schema = generateRandomString(); +schema = generateUniqueName(); ddl = "CREATE SCHEMA " + schema; conn.createStatement().execute(ddl); conn.createStatement().execute("use " + schema); @@ -121,8 +121,8 @@ public class UseSchemaIT extends ParallelStatsDisabledIT { @Test public void testMappedView() throws Exception { Properties props = new Properties(); -String schema = generateRandomString(); -String tableName = generateRandomString(); +String schema = generateUniqueName(); +String tableName = generateUniqueName(); String fullTablename = schema + QueryConstants.NAME_SEPARATOR + tableName; props.setProperty(QueryServices.SCHEMA_ATTRIB, schema); 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/ViewIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java index 425e84c..512841a 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java @@ -64,7 +64,7 @@ public class ViewIT extends BaseViewIT { Connection conn = DriverManager.getConnection(getUrl()); String ddl = "CREATE TABLE " + fullTableName + " (k INTEGER NOT NULL PRIMARY KEY, v1 DATE) "+ tableDDLOptions; conn.createStatement().execute(ddl); -String fullParentViewName = "V_" + generateRandomString(); +String fullParentViewName = "V_" + generateUniqueName(); ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * FROM " + tableName + " WHERE k > 5"; conn.createStatement().execute(ddl); try { @@ -104,7 +104,7 @@ public class ViewIT extends BaseViewIT { assertEquals(count + 5, rs.getInt(1)); } assertEquals(4, count); -String fullViewName = "V_" +
[3/6] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
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
[1/6] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-0.98 39d236110 -> 26109c4fa http://git-wip-us.apache.org/repos/asf/phoenix/blob/26109c4f/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java index f013341..87b660a 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java @@ -103,8 +103,8 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { conn.setAutoCommit(false); - String tableName = "TBL_" + generateRandomString(); - String indexName = "IDX_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); + String indexName = "IDX_" + generateUniqueName(); String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName); String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName); @@ -201,8 +201,8 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { @Test public void testCoveredColumns() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); - String tableName = "TBL_" + generateRandomString(); - String indexName = "IDX_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); + String indexName = "IDX_" + generateUniqueName(); String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName); String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { @@ -311,8 +311,8 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { @Test public void testCompoundIndexKey() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); - String tableName = "TBL_" + generateRandomString(); - String indexName = "IDX_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); + String indexName = "IDX_" + generateUniqueName(); String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName); String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { @@ -430,8 +430,8 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { @Test public void testMultipleUpdatesToSingleRow() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); - String tableName = "TBL_" + generateRandomString(); - String indexName = "IDX_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); + String indexName = "IDX_" + generateUniqueName(); String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName); String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { @@ -514,8 +514,8 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { @Test public void testUpsertingNullForIndexedColumns() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); - String tableName = "TBL_" + generateRandomString(); - String indexName = "IDX_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); + String indexName = "IDX_" + generateUniqueName(); String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName); String testTableName = tableName + "_" + System.currentTimeMillis(); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { @@ -600,7 +600,7 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { public void testAlterTableWithImmutability() throws Exception { String query; ResultSet rs; - String tableName = "TBL_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); String fullTableName =
[5/6] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
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 PairtestUpdatableViewIndex(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
[4/6] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
http://git-wip-us.apache.org/repos/asf/phoenix/blob/44e43d7c/phoenix-core/src/it/java/org/apache/phoenix/end2end/IsNullIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IsNullIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IsNullIT.java index fb12fc4..10a5baa 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IsNullIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IsNullIT.java @@ -33,7 +33,7 @@ import org.junit.Test; public class IsNullIT extends ParallelStatsDisabledIT { @Test public void testIsNullInPk() throws Exception { -String tableName = generateRandomString(); +String tableName = generateUniqueName(); ensureTableCreated(getUrl(), tableName, "IntIntKeyTest"); Connection conn = DriverManager.getConnection(getUrl()); String upsert = "UPSERT INTO " + tableName + " VALUES(4,2)"; @@ -62,7 +62,7 @@ public class IsNullIT extends ParallelStatsDisabledIT { @Test public void testIsNullWithLastPKColDesc() throws Exception { -String tableName = generateRandomString(); +String tableName = generateUniqueName(); Connection conn = DriverManager.getConnection(getUrl()); conn.createStatement().execute("CREATE TABLE " + tableName + "(k1 VARCHAR NOT NULL, k2 VARCHAR, k3 VARCHAR, CONSTRAINT pk PRIMARY KEY (k1, k2, k3 DESC))"); conn.createStatement().execute("UPSERT INTO " + tableName + " VALUES ('a')"); @@ -89,7 +89,7 @@ public class IsNullIT extends ParallelStatsDisabledIT { @Test public void testIsNullInCompositeKey() throws Exception { Connection conn = DriverManager.getConnection(getUrl()); -String tableName = generateRandomString(); +String tableName = generateUniqueName(); conn.createStatement().execute("CREATE TABLE " + tableName + "(k1 VARCHAR, k2 VARCHAR, CONSTRAINT pk PRIMARY KEY (k1,k2))"); conn.createStatement().execute("UPSERT INTO " + tableName + " VALUES (null,'a')"); conn.createStatement().execute("UPSERT INTO " + tableName + " VALUES ('a','a')"); http://git-wip-us.apache.org/repos/asf/phoenix/blob/44e43d7c/phoenix-core/src/it/java/org/apache/phoenix/end2end/KeyOnlyIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/KeyOnlyIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/KeyOnlyIT.java index 7ec37ce..b682c1a 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/KeyOnlyIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/KeyOnlyIT.java @@ -45,7 +45,7 @@ public class KeyOnlyIT extends ParallelStatsEnabledIT { @Before public void createTable() throws SQLException { -tableName = generateRandomString(); +tableName = generateUniqueName(); Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { conn.createStatement().execute("create table " + tableName + http://git-wip-us.apache.org/repos/asf/phoenix/blob/44e43d7c/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java index e28f510..2a3ebf7 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java @@ -33,7 +33,7 @@ public class LastValueFunctionIT extends ParallelStatsDisabledIT { @Test public void unsignedLong() throws Exception { Connection conn = DriverManager.getConnection(getUrl()); -String tableName = generateRandomString(); +String tableName = generateUniqueName(); String ddl = "CREATE TABLE IF NOT EXISTS " + tableName + "(id INTEGER NOT NULL PRIMARY KEY, page_id UNSIGNED_LONG," + " date DATE, \"value\" UNSIGNED_LONG)"; @@ -65,7 +65,7 @@ public class LastValueFunctionIT extends ParallelStatsDisabledIT { @Test public void signedInteger() throws Exception { Connection conn = DriverManager.getConnection(getUrl()); -String tableName = generateRandomString(); +String tableName = generateUniqueName(); String ddl = "CREATE TABLE IF NOT EXISTS " + tableName + "(id INTEGER NOT NULL PRIMARY KEY, page_id UNSIGNED_LONG, date INTEGER, \"value\" INTEGER)"; @@ -90,7 +90,7 @@ public class LastValueFunctionIT extends ParallelStatsDisabledIT { @Test public void unsignedInteger() throws Exception { Connection conn = DriverManager.getConnection(getUrl());
[3/6] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
http://git-wip-us.apache.org/repos/asf/phoenix/blob/44e43d7c/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
[5/6] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
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 {
[2/6] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
http://git-wip-us.apache.org/repos/asf/phoenix/blob/44e43d7c/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java index ec84282..c43fb0e 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java @@ -45,13 +45,13 @@ public class UseSchemaIT extends ParallelStatsDisabledIT { @Test public void testUseSchemaCaseInsensitive() throws Exception { -String schemaName = generateRandomString(); +String schemaName = generateUniqueName(); testUseSchema(schemaName); } @Test public void testUseSchemaCaseSensitive() throws Exception { -String schemaName = generateRandomString(); +String schemaName = generateUniqueName(); testUseSchema("\"" + schemaName + "\""); } @@ -61,7 +61,7 @@ public class UseSchemaIT extends ParallelStatsDisabledIT { Connection conn = DriverManager.getConnection(getUrl(), props); String ddl = "CREATE SCHEMA IF NOT EXISTS "+schema; conn.createStatement().execute(ddl); -String testTable = generateRandomString(); +String testTable = generateUniqueName(); ddl = "create table "+schema+"." + testTable + "(id varchar primary key)"; conn.createStatement().execute(ddl); conn.createStatement().execute("use "+schema); @@ -89,14 +89,14 @@ public class UseSchemaIT extends ParallelStatsDisabledIT { @Test public void testSchemaInJdbcUrl() throws Exception { Properties props = new Properties(); -String schema = generateRandomString(); +String schema = generateUniqueName(); props.setProperty(QueryServices.SCHEMA_ATTRIB, schema); props.setProperty(QueryServices.IS_NAMESPACE_MAPPING_ENABLED, Boolean.toString(true)); Connection conn = DriverManager.getConnection(getUrl(), props); conn.setAutoCommit(true); String ddl = "CREATE SCHEMA IF NOT EXISTS " + schema; conn.createStatement().execute(ddl); -String testTable = generateRandomString(); +String testTable = generateUniqueName(); ddl = "create table IF NOT EXISTS " + schema + "." + testTable + " (schema_name varchar primary key)"; conn.createStatement().execute(ddl); conn.createStatement().executeUpdate("upsert into " + schema + "." + testTable + " values('" + schema + "')"); @@ -105,7 +105,7 @@ public class UseSchemaIT extends ParallelStatsDisabledIT { assertTrue(rs.next()); assertEquals(schema, rs.getString(1)); -schema = generateRandomString(); +schema = generateUniqueName(); ddl = "CREATE SCHEMA " + schema; conn.createStatement().execute(ddl); conn.createStatement().execute("use " + schema); @@ -121,8 +121,8 @@ public class UseSchemaIT extends ParallelStatsDisabledIT { @Test public void testMappedView() throws Exception { Properties props = new Properties(); -String schema = generateRandomString(); -String tableName = generateRandomString(); +String schema = generateUniqueName(); +String tableName = generateUniqueName(); String fullTablename = schema + QueryConstants.NAME_SEPARATOR + tableName; props.setProperty(QueryServices.SCHEMA_ATTRIB, schema); Connection conn = DriverManager.getConnection(getUrl(), props); http://git-wip-us.apache.org/repos/asf/phoenix/blob/44e43d7c/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java index 425e84c..512841a 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java @@ -64,7 +64,7 @@ public class ViewIT extends BaseViewIT { Connection conn = DriverManager.getConnection(getUrl()); String ddl = "CREATE TABLE " + fullTableName + " (k INTEGER NOT NULL PRIMARY KEY, v1 DATE) "+ tableDDLOptions; conn.createStatement().execute(ddl); -String fullParentViewName = "V_" + generateRandomString(); +String fullParentViewName = "V_" + generateUniqueName(); ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * FROM " + tableName + " WHERE k > 5"; conn.createStatement().execute(ddl); try { @@ -104,7 +104,7 @@ public class ViewIT extends BaseViewIT { assertEquals(count + 5, rs.getInt(1)); } assertEquals(4, count); -String fullViewName = "V_" +
[1/6] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.1 92499e722 -> 44e43d7c2 http://git-wip-us.apache.org/repos/asf/phoenix/blob/44e43d7c/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java index 6ae45bb..3c5ba22 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java @@ -100,8 +100,8 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { conn.setAutoCommit(false); - String tableName = "TBL_" + generateRandomString(); - String indexName = "IDX_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); + String indexName = "IDX_" + generateUniqueName(); String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName); String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName); @@ -198,8 +198,8 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { @Test public void testCoveredColumns() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); - String tableName = "TBL_" + generateRandomString(); - String indexName = "IDX_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); + String indexName = "IDX_" + generateUniqueName(); String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName); String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { @@ -308,8 +308,8 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { @Test public void testCompoundIndexKey() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); - String tableName = "TBL_" + generateRandomString(); - String indexName = "IDX_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); + String indexName = "IDX_" + generateUniqueName(); String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName); String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { @@ -427,8 +427,8 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { @Test public void testMultipleUpdatesToSingleRow() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); - String tableName = "TBL_" + generateRandomString(); - String indexName = "IDX_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); + String indexName = "IDX_" + generateUniqueName(); String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName); String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { @@ -511,8 +511,8 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { @Test public void testUpsertingNullForIndexedColumns() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); - String tableName = "TBL_" + generateRandomString(); - String indexName = "IDX_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); + String indexName = "IDX_" + generateUniqueName(); String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName); String testTableName = tableName + "_" + System.currentTimeMillis(); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { @@ -597,7 +597,7 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { public void testAlterTableWithImmutability() throws Exception { String query; ResultSet rs; - String tableName = "TBL_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); String fullTableName =
[4/6] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/IsNullIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IsNullIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IsNullIT.java index fb12fc4..10a5baa 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IsNullIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IsNullIT.java @@ -33,7 +33,7 @@ import org.junit.Test; public class IsNullIT extends ParallelStatsDisabledIT { @Test public void testIsNullInPk() throws Exception { -String tableName = generateRandomString(); +String tableName = generateUniqueName(); ensureTableCreated(getUrl(), tableName, "IntIntKeyTest"); Connection conn = DriverManager.getConnection(getUrl()); String upsert = "UPSERT INTO " + tableName + " VALUES(4,2)"; @@ -62,7 +62,7 @@ public class IsNullIT extends ParallelStatsDisabledIT { @Test public void testIsNullWithLastPKColDesc() throws Exception { -String tableName = generateRandomString(); +String tableName = generateUniqueName(); Connection conn = DriverManager.getConnection(getUrl()); conn.createStatement().execute("CREATE TABLE " + tableName + "(k1 VARCHAR NOT NULL, k2 VARCHAR, k3 VARCHAR, CONSTRAINT pk PRIMARY KEY (k1, k2, k3 DESC))"); conn.createStatement().execute("UPSERT INTO " + tableName + " VALUES ('a')"); @@ -89,7 +89,7 @@ public class IsNullIT extends ParallelStatsDisabledIT { @Test public void testIsNullInCompositeKey() throws Exception { Connection conn = DriverManager.getConnection(getUrl()); -String tableName = generateRandomString(); +String tableName = generateUniqueName(); conn.createStatement().execute("CREATE TABLE " + tableName + "(k1 VARCHAR, k2 VARCHAR, CONSTRAINT pk PRIMARY KEY (k1,k2))"); conn.createStatement().execute("UPSERT INTO " + tableName + " VALUES (null,'a')"); conn.createStatement().execute("UPSERT INTO " + tableName + " VALUES ('a','a')"); http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/KeyOnlyIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/KeyOnlyIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/KeyOnlyIT.java index 7ec37ce..b682c1a 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/KeyOnlyIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/KeyOnlyIT.java @@ -45,7 +45,7 @@ public class KeyOnlyIT extends ParallelStatsEnabledIT { @Before public void createTable() throws SQLException { -tableName = generateRandomString(); +tableName = generateUniqueName(); Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { conn.createStatement().execute("create table " + tableName + http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java index e28f510..2a3ebf7 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java @@ -33,7 +33,7 @@ public class LastValueFunctionIT extends ParallelStatsDisabledIT { @Test public void unsignedLong() throws Exception { Connection conn = DriverManager.getConnection(getUrl()); -String tableName = generateRandomString(); +String tableName = generateUniqueName(); String ddl = "CREATE TABLE IF NOT EXISTS " + tableName + "(id INTEGER NOT NULL PRIMARY KEY, page_id UNSIGNED_LONG," + " date DATE, \"value\" UNSIGNED_LONG)"; @@ -65,7 +65,7 @@ public class LastValueFunctionIT extends ParallelStatsDisabledIT { @Test public void signedInteger() throws Exception { Connection conn = DriverManager.getConnection(getUrl()); -String tableName = generateRandomString(); +String tableName = generateUniqueName(); String ddl = "CREATE TABLE IF NOT EXISTS " + tableName + "(id INTEGER NOT NULL PRIMARY KEY, page_id UNSIGNED_LONG, date INTEGER, \"value\" INTEGER)"; @@ -90,7 +90,7 @@ public class LastValueFunctionIT extends ParallelStatsDisabledIT { @Test public void unsignedInteger() throws Exception { Connection conn = DriverManager.getConnection(getUrl());
[2/6] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java index ec84282..c43fb0e 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java @@ -45,13 +45,13 @@ public class UseSchemaIT extends ParallelStatsDisabledIT { @Test public void testUseSchemaCaseInsensitive() throws Exception { -String schemaName = generateRandomString(); +String schemaName = generateUniqueName(); testUseSchema(schemaName); } @Test public void testUseSchemaCaseSensitive() throws Exception { -String schemaName = generateRandomString(); +String schemaName = generateUniqueName(); testUseSchema("\"" + schemaName + "\""); } @@ -61,7 +61,7 @@ public class UseSchemaIT extends ParallelStatsDisabledIT { Connection conn = DriverManager.getConnection(getUrl(), props); String ddl = "CREATE SCHEMA IF NOT EXISTS "+schema; conn.createStatement().execute(ddl); -String testTable = generateRandomString(); +String testTable = generateUniqueName(); ddl = "create table "+schema+"." + testTable + "(id varchar primary key)"; conn.createStatement().execute(ddl); conn.createStatement().execute("use "+schema); @@ -89,14 +89,14 @@ public class UseSchemaIT extends ParallelStatsDisabledIT { @Test public void testSchemaInJdbcUrl() throws Exception { Properties props = new Properties(); -String schema = generateRandomString(); +String schema = generateUniqueName(); props.setProperty(QueryServices.SCHEMA_ATTRIB, schema); props.setProperty(QueryServices.IS_NAMESPACE_MAPPING_ENABLED, Boolean.toString(true)); Connection conn = DriverManager.getConnection(getUrl(), props); conn.setAutoCommit(true); String ddl = "CREATE SCHEMA IF NOT EXISTS " + schema; conn.createStatement().execute(ddl); -String testTable = generateRandomString(); +String testTable = generateUniqueName(); ddl = "create table IF NOT EXISTS " + schema + "." + testTable + " (schema_name varchar primary key)"; conn.createStatement().execute(ddl); conn.createStatement().executeUpdate("upsert into " + schema + "." + testTable + " values('" + schema + "')"); @@ -105,7 +105,7 @@ public class UseSchemaIT extends ParallelStatsDisabledIT { assertTrue(rs.next()); assertEquals(schema, rs.getString(1)); -schema = generateRandomString(); +schema = generateUniqueName(); ddl = "CREATE SCHEMA " + schema; conn.createStatement().execute(ddl); conn.createStatement().execute("use " + schema); @@ -121,8 +121,8 @@ public class UseSchemaIT extends ParallelStatsDisabledIT { @Test public void testMappedView() throws Exception { Properties props = new Properties(); -String schema = generateRandomString(); -String tableName = generateRandomString(); +String schema = generateUniqueName(); +String tableName = generateUniqueName(); String fullTablename = schema + QueryConstants.NAME_SEPARATOR + tableName; props.setProperty(QueryServices.SCHEMA_ATTRIB, schema); Connection conn = DriverManager.getConnection(getUrl(), props); http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java index 425e84c..512841a 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java @@ -64,7 +64,7 @@ public class ViewIT extends BaseViewIT { Connection conn = DriverManager.getConnection(getUrl()); String ddl = "CREATE TABLE " + fullTableName + " (k INTEGER NOT NULL PRIMARY KEY, v1 DATE) "+ tableDDLOptions; conn.createStatement().execute(ddl); -String fullParentViewName = "V_" + generateRandomString(); +String fullParentViewName = "V_" + generateUniqueName(); ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * FROM " + tableName + " WHERE k > 5"; conn.createStatement().execute(ddl); try { @@ -104,7 +104,7 @@ public class ViewIT extends BaseViewIT { assertEquals(count + 5, rs.getInt(1)); } assertEquals(4, count); -String fullViewName = "V_" +
[5/6] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
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 {
[1/6] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
Repository: phoenix Updated Branches: refs/heads/master 16f0da3d9 -> bebb5cedf http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java index e5dfb0d..0a89eff 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java @@ -102,8 +102,8 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { conn.setAutoCommit(false); - String tableName = "TBL_" + generateRandomString(); - String indexName = "IDX_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); + String indexName = "IDX_" + generateUniqueName(); String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName); String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName); @@ -200,8 +200,8 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { @Test public void testCoveredColumns() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); - String tableName = "TBL_" + generateRandomString(); - String indexName = "IDX_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); + String indexName = "IDX_" + generateUniqueName(); String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName); String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { @@ -310,8 +310,8 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { @Test public void testCompoundIndexKey() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); - String tableName = "TBL_" + generateRandomString(); - String indexName = "IDX_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); + String indexName = "IDX_" + generateUniqueName(); String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName); String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { @@ -429,8 +429,8 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { @Test public void testMultipleUpdatesToSingleRow() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); - String tableName = "TBL_" + generateRandomString(); - String indexName = "IDX_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); + String indexName = "IDX_" + generateUniqueName(); String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName); String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { @@ -513,8 +513,8 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { @Test public void testUpsertingNullForIndexedColumns() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); - String tableName = "TBL_" + generateRandomString(); - String indexName = "IDX_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); + String indexName = "IDX_" + generateUniqueName(); String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName); String testTableName = tableName + "_" + System.currentTimeMillis(); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { @@ -599,7 +599,7 @@ public class MutableIndexIT extends ParallelStatsDisabledIT { public void testAlterTableWithImmutability() throws Exception { String query; ResultSet rs; - String tableName = "TBL_" + generateRandomString(); + String tableName = "TBL_" + generateUniqueName(); String fullTableName =
[6/6] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
PHOENIX-3253 Make changes to tests to support method level parallelization Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/bebb5ced Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/bebb5ced Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/bebb5ced Branch: refs/heads/master Commit: bebb5cedf761b132b78db675a19ede5849f6ea94 Parents: 16f0da3 Author: James TaylorAuthored: Thu Sep 22 17:16:43 2016 -0700 Committer: James Taylor Committed: Thu Sep 22 17:16:43 2016 -0700 -- .../StatisticsCollectionRunTrackerIT.java | 2 +- .../phoenix/end2end/AbsFunctionEnd2EndIT.java | 2 +- .../AlterMultiTenantTableWithViewsIT.java | 16 +- .../apache/phoenix/end2end/AlterSessionIT.java | 2 +- .../apache/phoenix/end2end/AlterTableIT.java| 10 +- .../phoenix/end2end/AlterTableWithViewsIT.java | 16 +- .../phoenix/end2end/AppendOnlySchemaIT.java | 22 +-- .../phoenix/end2end/ArithmeticQueryIT.java | 36 ++-- .../phoenix/end2end/ArrayAppendFunctionIT.java | 18 +- .../phoenix/end2end/ArrayConcatFunctionIT.java | 16 +- .../phoenix/end2end/ArrayFillFunctionIT.java| 12 +- .../phoenix/end2end/ArrayPrependFunctionIT.java | 68 +++ .../end2end/ArrayToStringFunctionIT.java| 22 +-- .../phoenix/end2end/ArraysWithNullsIT.java | 32 ++-- .../apache/phoenix/end2end/AutoCommitIT.java| 2 +- .../phoenix/end2end/AutoPartitionViewsIT.java | 18 +- .../end2end/BaseTenantSpecificTablesIT.java | 12 +- .../end2end/BaseTenantSpecificViewIndexIT.java | 12 +- .../org/apache/phoenix/end2end/BaseViewIT.java | 8 +- .../apache/phoenix/end2end/BinaryRowKeyIT.java | 6 +- .../phoenix/end2end/CSVCommonsLoaderIT.java | 20 +- .../phoenix/end2end/CbrtFunctionEnd2EndIT.java | 4 +- .../phoenix/end2end/CoalesceFunctionIT.java | 20 +- .../end2end/ConvertTimezoneFunctionIT.java | 14 +- .../org/apache/phoenix/end2end/DateTimeIT.java | 68 +++ .../phoenix/end2end/DecodeFunctionIT.java | 12 +- .../org/apache/phoenix/end2end/DeleteIT.java| 26 +-- .../phoenix/end2end/DisableLocalIndexIT.java| 2 +- .../phoenix/end2end/DistinctPrefixFilterIT.java | 6 +- .../apache/phoenix/end2end/DynamicFamilyIT.java | 4 +- .../apache/phoenix/end2end/DynamicUpsertIT.java | 2 +- .../phoenix/end2end/EncodeFunctionIT.java | 8 +- .../phoenix/end2end/EvaluationOfORIT.java | 2 +- .../phoenix/end2end/ExecuteStatementsIT.java| 6 +- .../phoenix/end2end/ExpFunctionEnd2EndIT.java | 4 +- .../phoenix/end2end/FirstValueFunctionIT.java | 14 +- .../end2end/GetSetByteBitFunctionEnd2EndIT.java | 2 +- .../apache/phoenix/end2end/GroupByCaseIT.java | 20 +- .../apache/phoenix/end2end/HashJoinMoreIT.java | 12 +- .../org/apache/phoenix/end2end/InListIT.java| 10 +- .../apache/phoenix/end2end/IndexExtendedIT.java | 30 +-- .../apache/phoenix/end2end/InstrFunctionIT.java | 16 +- .../org/apache/phoenix/end2end/IsNullIT.java| 6 +- .../org/apache/phoenix/end2end/KeyOnlyIT.java | 2 +- .../phoenix/end2end/LastValueFunctionIT.java| 22 +-- .../phoenix/end2end/LikeExpressionIT.java | 12 +- .../phoenix/end2end/LnLogFunctionEnd2EndIT.java | 4 +- .../apache/phoenix/end2end/MD5FunctionIT.java | 6 +- .../org/apache/phoenix/end2end/MapReduceIT.java | 8 +- .../phoenix/end2end/MappingTableDataTypeIT.java | 2 +- .../end2end/MinMaxAggregateFunctionIT.java | 2 +- .../phoenix/end2end/ModulusExpressionIT.java| 10 +- .../phoenix/end2end/MultiCfQueryExecIT.java | 2 +- .../end2end/NamespaceSchemaMappingIT.java | 2 +- .../phoenix/end2end/NthValueFunctionIT.java | 22 +-- .../end2end/OctetLengthFunctionEnd2EndIT.java | 2 +- .../org/apache/phoenix/end2end/OrderByIT.java | 16 +- .../phoenix/end2end/ParallelIteratorsIT.java| 4 +- .../apache/phoenix/end2end/PercentileIT.java| 15 +- .../phoenix/end2end/PhoenixRuntimeIT.java | 18 +- .../phoenix/end2end/PowerFunctionEnd2EndIT.java | 4 +- .../apache/phoenix/end2end/PrimitiveTypeIT.java | 18 +- .../org/apache/phoenix/end2end/QueryMoreIT.java | 8 +- .../phoenix/end2end/QueryWithOffsetIT.java | 2 +- .../apache/phoenix/end2end/RTrimFunctionIT.java | 2 +- .../org/apache/phoenix/end2end/ReadOnlyIT.java | 2 +- .../end2end/RegexpReplaceFunctionIT.java| 2 +- .../phoenix/end2end/RegexpSplitFunctionIT.java | 2 +- .../phoenix/end2end/RegexpSubstrFunctionIT.java | 2 +- .../phoenix/end2end/ReverseFunctionIT.java | 2 +- .../apache/phoenix/end2end/ReverseScanIT.java | 4 +- .../phoenix/end2end/RoundFloorCeilFuncIT.java | 2 +- .../phoenix/end2end/SerialIteratorsIT.java | 2 +- .../phoenix/end2end/ServerExceptionIT.java | 2 +-
[3/6] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/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
[2/2] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
PHOENIX-3253 Make changes to tests to support method level parallelization Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/d4f72018 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/d4f72018 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/d4f72018 Branch: refs/heads/master Commit: d4f7201854a8d27ba7e6dd1037a10a4a34842b92 Parents: 8174fc4 Author: James TaylorAuthored: Wed Sep 21 12:45:25 2016 -0700 Committer: James Taylor Committed: Wed Sep 21 12:45:25 2016 -0700 -- .../phoenix/end2end/StatsCollectorIT.java | 33 -- .../apache/phoenix/end2end/StoreNullsIT.java| 68 ++-- .../query/ConnectionQueryServicesImpl.java | 1 + .../java/org/apache/phoenix/util/TestUtil.java | 55 4 files changed, 74 insertions(+), 83 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/d4f72018/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 dd7741a..9a1ea26 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 @@ -40,8 +40,8 @@ import java.util.Random; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HRegionLocation; -import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.util.Bytes; +import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr; import org.apache.phoenix.jdbc.PhoenixConnection; import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData; import org.apache.phoenix.query.ConnectionQueryServices; @@ -77,8 +77,8 @@ public class StatsCollectorIT extends ParallelStatsEnabledIT { props.put(QueryServices.STATS_GUIDEPOST_WIDTH_BYTES_ATTRIB, Long.toString(20)); props.put(QueryServices.EXPLAIN_CHUNK_COUNT_ATTRIB, Boolean.TRUE.toString()); props.put(QueryServices.EXPLAIN_ROW_COUNT_ATTRIB, Boolean.TRUE.toString()); -props.put(QueryServices.QUEUE_SIZE_ATTRIB, Integer.toString(1024)); props.put(QueryServices.TRANSACTIONS_ENABLED, Boolean.toString(true)); +props.put(QueryServices.STATS_UPDATE_FREQ_MS_ATTRIB, Long.toString(Long.MAX_VALUE)); setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator())); } @@ -347,16 +347,8 @@ public class StatsCollectorIT extends ParallelStatsEnabledIT { return stmt; } -private void compactTable(Connection conn, String tableName) throws IOException, InterruptedException, SQLException { -ConnectionQueryServices services = conn.unwrap(PhoenixConnection.class).getQueryServices(); -HBaseAdmin admin = services.getAdmin(); -try { -admin.flush(tableName); -admin.majorCompact(tableName); -Thread.sleep(1); // FIXME: how do we know when compaction is done? -} finally { -admin.close(); -} +private void compactTable(Connection conn, String tableName) throws Exception { +TestUtil.doMajorCompaction(conn, tableName); } @Test @@ -374,9 +366,6 @@ public class StatsCollectorIT extends ParallelStatsEnabledIT { Connection conn; PreparedStatement stmt; Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); -if (minStatsUpdateFreq != null) { -props.setProperty(QueryServices.MIN_STATS_UPDATE_FREQ_MS_ATTRIB, minStatsUpdateFreq.toString()); -} conn = DriverManager.getConnection(getUrl(), props); conn.createStatement().execute("CREATE TABLE " + tableName + "(k CHAR(1) PRIMARY KEY, v INTEGER, w INTEGER) " + HColumnDescriptor.KEEP_DELETED_CELLS + "=" + Boolean.FALSE); @@ -391,11 +380,11 @@ public class StatsCollectorIT extends ParallelStatsEnabledIT { compactTable(conn, tableName); if (minStatsUpdateFreq == null) { - conn.unwrap(PhoenixConnection.class).getQueryServices().clearCache(); -} -// Confirm that when we have a non zero MIN_STATS_UPDATE_FREQ_MS_ATTRIB, after we run -// UPDATATE STATISTICS, the new statistics are faulted in as expected. -if (minStatsUpdateFreq != null) { +ImmutableBytesPtr ptr = new ImmutableBytesPtr(Bytes.toBytes(tableName)); + conn.unwrap(PhoenixConnection.class).getQueryServices().invalidateStats(ptr); +} else { +// Confirm that when we have a non zero