You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by la...@apache.org on 2019/06/16 20:46:33 UTC

[phoenix] 01/04: PHOENIX-5350 Speedup ParameterizedTransactionIT.

This is an automated email from the ASF dual-hosted git repository.

larsh pushed a commit to branch 4.x-HBase-1.5
in repository https://gitbox.apache.org/repos/asf/phoenix.git

commit 4dc04e75bac112847c210d13067a57fdb9a5b757
Author: Lars Hofhansl <la...@apache.org>
AuthorDate: Sun Jun 16 13:19:49 2019 -0700

    PHOENIX-5350 Speedup ParameterizedTransactionIT.
---
 .../phoenix/tx/ParameterizedTransactionIT.java     | 45 ++++++++++++----------
 1 file changed, 24 insertions(+), 21 deletions(-)

diff --git a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
index f94ec17..ed4e1e0 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
@@ -142,7 +142,7 @@ public class ParameterizedTransactionIT extends ParallelStatsDisabledIT {
         }
     }
     
-    @Test
+    // @Test - disabled, doesn't test anything new. TODO: Fix or remove.
     public void testTxnClosedCorrecty() throws Exception {
         String transTableName = generateUniqueName();
         String fullTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + transTableName;
@@ -178,27 +178,18 @@ public class ParameterizedTransactionIT extends ParallelStatsDisabledIT {
     }
     
     @Test
-    public void testAutoCommitQuerySingleTable() throws Exception {
+    public void testAutoCommitQuery() throws Exception {
         String transTableName = generateUniqueName();
         String fullTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + transTableName;
         try (Connection conn = DriverManager.getConnection(getUrl())) {
             conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA + tableDDLOptions + (tableDDLOptions.length() > 0 ? "," : "") + "TRANSACTIONAL=true");
             conn.setAutoCommit(true);
-            // verify no rows returned
+            // verify no rows returned with single table
             ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM " + fullTableName);
             assertFalse(rs.next());
-        }
-    }
-    
-    @Test
-    public void testAutoCommitQueryMultiTables() throws Exception {
-        String transTableName = generateUniqueName();
-        String fullTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + transTableName;
-        try (Connection conn = DriverManager.getConnection(getUrl())) {
-            conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA + tableDDLOptions + (tableDDLOptions.length() > 0 ? "," : "") + "TRANSACTIONAL=true");
-            conn.setAutoCommit(true);
-            // verify no rows returned
-            ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM " + fullTableName + " x JOIN " + fullTableName + " y ON (x.long_pk = y.int_pk)");
+
+            // verify no rows returned with multiple tables
+            rs = conn.createStatement().executeQuery("SELECT * FROM " + fullTableName + " x JOIN " + fullTableName + " y ON (x.long_pk = y.int_pk)");
             assertFalse(rs.next());
         } 
     }
@@ -265,12 +256,14 @@ public class ParameterizedTransactionIT extends ParallelStatsDisabledIT {
     
     @Test
     public void testNoConflictDetectionForImmutableRows() throws Exception {
-        String transTableName = generateUniqueName();
-        String fullTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + transTableName;
-        Connection conn = DriverManager.getConnection(getUrl());
-        conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA + tableDDLOptions + (tableDDLOptions.length() > 0 ? "," : "") + "TRANSACTIONAL=true");
-        conn.createStatement().execute("ALTER TABLE " + fullTableName + " SET IMMUTABLE_ROWS=true");
-        testRowConflicts(fullTableName);
+        if (tableDDLOptions.contains("IMMUTABLE_ROWS=true")) {
+            // only need to test this for immutable rows
+            String transTableName = generateUniqueName();
+            String fullTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + transTableName;
+            Connection conn = DriverManager.getConnection(getUrl());
+            conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA + tableDDLOptions + (tableDDLOptions.length() > 0 ? "," : "") + "TRANSACTIONAL=true");
+            testRowConflicts(fullTableName);
+        }
     }
     
     @Test
@@ -351,6 +344,11 @@ public class ParameterizedTransactionIT extends ParallelStatsDisabledIT {
     
     @Test
     public void testNonTxToTxTableFailure() throws Exception {
+        if (tableDDLOptions.contains("COLUMN_ENCODED_BYTES")) {
+            // no need to test this with all variations of column encoding
+            return;
+        }
+
         String nonTxTableName = generateUniqueName();
 
         Connection conn = DriverManager.getConnection(getUrl());
@@ -398,6 +396,11 @@ public class ParameterizedTransactionIT extends ParallelStatsDisabledIT {
     
     @Test
     public void testCreateTableToBeTransactional() throws Exception {
+        if (tableDDLOptions.contains("COLUMN_ENCODED_BYTES")) {
+            // no need to test this with all variations of column encoding
+            return;
+        }
+
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         String t1 = generateUniqueName();