You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ja...@apache.org on 2018/06/15 21:22:03 UTC
phoenix git commit: PHOENIX-4731 Make running transactional unit
tests for a given provider optional
Repository: phoenix
Updated Branches:
refs/heads/omid2 fce08bdc6 -> 5af5980ab
PHOENIX-4731 Make running transactional unit tests for a given provider optional
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/5af5980a
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/5af5980a
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/5af5980a
Branch: refs/heads/omid2
Commit: 5af5980ab08049d74b4a8732f8b402cdddd4c741
Parents: fce08bd
Author: James Taylor <ja...@apache.org>
Authored: Fri Jun 15 23:21:52 2018 +0200
Committer: James Taylor <ja...@apache.org>
Committed: Fri Jun 15 23:21:52 2018 +0200
----------------------------------------------------------------------
.../apache/phoenix/end2end/AlterTableIT.java | 4 ++
.../phoenix/end2end/AlterTableWithViewsIT.java | 4 ++
.../org/apache/phoenix/end2end/BaseViewIT.java | 5 +-
...olumnEncodedImmutableTxStatsCollectorIT.java | 8 ++-
.../ColumnEncodedMutableTxStatsCollectorIT.java | 7 ++-
.../org/apache/phoenix/end2end/IndexToolIT.java | 3 +-
...olumnEncodedImmutableTxStatsCollectorIT.java | 5 +-
...SysTableNamespaceMappedStatsCollectorIT.java | 5 +-
.../phoenix/end2end/TransactionalViewIT.java | 4 +-
.../end2end/index/GlobalImmutableTxIndexIT.java | 10 +--
.../end2end/index/GlobalMutableTxIndexIT.java | 10 +--
.../phoenix/end2end/index/ImmutableIndexIT.java | 20 +++---
.../end2end/index/LocalImmutableTxIndexIT.java | 10 +--
.../end2end/index/LocalMutableTxIndexIT.java | 10 +--
.../end2end/index/MutableIndexFailureIT.java | 65 ++++++++++----------
.../end2end/index/txn/MutableRollbackIT.java | 4 +-
.../phoenix/end2end/index/txn/RollbackIT.java | 4 +-
.../end2end/index/txn/TxWriteFailureIT.java | 5 +-
.../apache/phoenix/execute/PartialCommitIT.java | 5 +-
.../org/apache/phoenix/rpc/UpdateCacheIT.java | 12 ++--
.../phoenix/tx/FlappingTransactionIT.java | 4 +-
.../phoenix/tx/ParameterizedTransactionIT.java | 4 +-
.../org/apache/phoenix/tx/TransactionIT.java | 4 +-
.../org/apache/phoenix/tx/TxCheckpointIT.java | 5 +-
.../phoenix/transaction/TransactionFactory.java | 12 +++-
.../java/org/apache/phoenix/util/TestUtil.java | 25 ++++++++
26 files changed, 158 insertions(+), 96 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/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 b1949ed..791924d 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
@@ -61,6 +61,7 @@ import org.apache.phoenix.schema.PTable.EncodedCQCounter;
import org.apache.phoenix.schema.PTable.QualifierEncodingScheme;
import org.apache.phoenix.schema.PTableKey;
import org.apache.phoenix.schema.TableNotFoundException;
+import org.apache.phoenix.transaction.TransactionFactory;
import org.apache.phoenix.util.IndexUtil;
import org.apache.phoenix.util.PropertiesUtil;
import org.apache.phoenix.util.SchemaUtil;
@@ -1072,6 +1073,9 @@ public class AlterTableIT extends ParallelStatsDisabledIT {
@Test
public void testCreatingTxnTableFailsIfTxnsDisabled() throws Exception {
+ if (!TransactionFactory.Provider.getDefault().runTests()) {
+ return;
+ }
Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
props.setProperty(QueryServices.TRANSACTIONS_ENABLED, Boolean.toString(false));
try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableWithViewsIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableWithViewsIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableWithViewsIT.java
index 2f3498a..3a368bc 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableWithViewsIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableWithViewsIT.java
@@ -49,6 +49,7 @@ import org.apache.phoenix.schema.PNameFactory;
import org.apache.phoenix.schema.PTable;
import org.apache.phoenix.schema.PTableKey;
import org.apache.phoenix.schema.PTableType;
+import org.apache.phoenix.transaction.TransactionFactory;
import org.apache.phoenix.util.PropertiesUtil;
import org.apache.phoenix.util.StringUtil;
import org.apache.phoenix.util.TestUtil;
@@ -755,6 +756,9 @@ public class AlterTableWithViewsIT extends ParallelStatsDisabledIT {
@Test
public void testMakeBaseTableTransactional() throws Exception {
+ if (!TransactionFactory.Provider.TEPHRA.runTests()) {
+ return;
+ }
Properties props = PropertiesUtil.deepCopy(TestUtil.TEST_PROPERTIES);
props.setProperty(QueryServices.TRANSACTIONS_ENABLED, Boolean.TRUE.toString());
try (Connection conn = DriverManager.getConnection(getUrl(), props);
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/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 8d42016..4890272 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
@@ -46,6 +46,7 @@ import org.apache.phoenix.util.MetaDataUtil;
import org.apache.phoenix.util.QueryUtil;
import org.apache.phoenix.util.ScanUtil;
import org.apache.phoenix.util.SchemaUtil;
+import org.apache.phoenix.util.TestUtil;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
@@ -72,8 +73,8 @@ public abstract class BaseViewIT extends ParallelStatsEnabledIT {
}
@Parameters(name="transactionProvider={0}")
- public static Collection<Object> data() {
- return Arrays.asList(new Object[] { "TEPHRA", "OMID", null });
+ public static Collection<Object[]> data() {
+ return TestUtil.filterTxParamData(Arrays.asList(new Object[][] { {"TEPHRA"}, {"OMID"}, {null} }), 0);
}
protected void testUpdatableViewWithIndex(Integer saltBuckets, boolean localIndex) throws Exception {
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedImmutableTxStatsCollectorIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedImmutableTxStatsCollectorIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedImmutableTxStatsCollectorIT.java
index 7998288..073dc07 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedImmutableTxStatsCollectorIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedImmutableTxStatsCollectorIT.java
@@ -21,6 +21,7 @@ import java.util.Arrays;
import java.util.Collection;
import org.apache.phoenix.schema.stats.StatsCollectorIT;
+import org.apache.phoenix.util.TestUtil;
import org.junit.runners.Parameterized.Parameters;
public class ColumnEncodedImmutableTxStatsCollectorIT extends StatsCollectorIT {
@@ -32,7 +33,10 @@ public class ColumnEncodedImmutableTxStatsCollectorIT extends StatsCollectorIT {
@Parameters(name = "mutable={0},transactionProvider={1},isUserTableNamespaceMapped={2},columnEncoded={3}")
public static Collection<Object[]> data() {
- return Arrays.asList(
- new Object[][] { { false, "TEPHRA", false, true }, { false, "TEPHRA", true, true }, });
+ return TestUtil.filterTxParamData(
+ Arrays.asList(
+ new Object[][] {
+ { false, "TEPHRA", false, true },
+ { false, "TEPHRA", true, true }, }), 1);
}
}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedMutableTxStatsCollectorIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedMutableTxStatsCollectorIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedMutableTxStatsCollectorIT.java
index 9283018..29e000e 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedMutableTxStatsCollectorIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedMutableTxStatsCollectorIT.java
@@ -21,6 +21,7 @@ import java.util.Arrays;
import java.util.Collection;
import org.apache.phoenix.schema.stats.StatsCollectorIT;
+import org.apache.phoenix.util.TestUtil;
import org.junit.runners.Parameterized.Parameters;
public class ColumnEncodedMutableTxStatsCollectorIT extends StatsCollectorIT {
@@ -32,7 +33,9 @@ public class ColumnEncodedMutableTxStatsCollectorIT extends StatsCollectorIT {
@Parameters(name = "mutable={0},transactionProvider={1},isUserTableNamespaceMapped={2},columnEncoded={3}")
public static Collection<Object[]> data() {
- return Arrays.asList(
- new Object[][] { { true, "TEPHRA", false, true }, { true, "TEPHRA", true, true } });
+ return TestUtil.filterTxParamData(
+ Arrays.asList(new Object[][] {
+ { true, "TEPHRA", false, true },
+ { true, "TEPHRA", true, true } }), 1);
}
}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexToolIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexToolIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexToolIT.java
index 3cba9c4..b8372c4 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexToolIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexToolIT.java
@@ -53,6 +53,7 @@ import org.apache.phoenix.util.PropertiesUtil;
import org.apache.phoenix.util.QueryUtil;
import org.apache.phoenix.util.ReadOnlyProps;
import org.apache.phoenix.util.SchemaUtil;
+import org.apache.phoenix.util.TestUtil;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
@@ -121,7 +122,7 @@ public class IndexToolIT extends ParallelStatsEnabledIT {
}
}
}
- return list;
+ return TestUtil.filterTxParamData(list,0);
}
@Test
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/it/java/org/apache/phoenix/end2end/NonColumnEncodedImmutableTxStatsCollectorIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/NonColumnEncodedImmutableTxStatsCollectorIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/NonColumnEncodedImmutableTxStatsCollectorIT.java
index a0f6991..04485c4 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/NonColumnEncodedImmutableTxStatsCollectorIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/NonColumnEncodedImmutableTxStatsCollectorIT.java
@@ -21,6 +21,7 @@ import java.util.Arrays;
import java.util.Collection;
import org.apache.phoenix.schema.stats.StatsCollectorIT;
+import org.apache.phoenix.util.TestUtil;
import org.junit.runners.Parameterized.Parameters;
public class NonColumnEncodedImmutableTxStatsCollectorIT extends StatsCollectorIT {
@@ -32,10 +33,10 @@ public class NonColumnEncodedImmutableTxStatsCollectorIT extends StatsCollectorI
@Parameters(name = "mutable={0},transactionProvider={1},isUserTableNamespaceMapped={2},columnEncoded={3}")
public static Collection<Object[]> data() {
- return Arrays.asList(
+ return TestUtil.filterTxParamData(Arrays.asList(
new Object[][] {
{ false, "TEPHRA", false, false }, { false, "TEPHRA", true, false },
{ false, "OMID", false, false }, { false, "OMID", true, false },
- });
+ }),1);
}
}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SysTableNamespaceMappedStatsCollectorIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SysTableNamespaceMappedStatsCollectorIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SysTableNamespaceMappedStatsCollectorIT.java
index 81d2bf6..8f0a1d8 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SysTableNamespaceMappedStatsCollectorIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SysTableNamespaceMappedStatsCollectorIT.java
@@ -24,6 +24,7 @@ import java.util.Map;
import org.apache.phoenix.query.QueryServices;
import org.apache.phoenix.schema.stats.StatsCollectorIT;
import org.apache.phoenix.util.ReadOnlyProps;
+import org.apache.phoenix.util.TestUtil;
import org.junit.BeforeClass;
import org.junit.runners.Parameterized.Parameters;
@@ -38,11 +39,11 @@ public class SysTableNamespaceMappedStatsCollectorIT extends StatsCollectorIT {
@Parameters(name = "mutable={0},transactionProvider={1},isUserTableNamespaceMapped={2},columnEncoded={3}")
public static Collection<Object[]> data() {
- return Arrays.asList(
+ return TestUtil.filterTxParamData(Arrays.asList(
new Object[][] {
{ true, "TEPHRA", false, false }, { true, "TEPHRA", false, true },
{ true, "OMID", false, false },
- });
+ }), 1);
}
@BeforeClass
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TransactionalViewIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TransactionalViewIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TransactionalViewIT.java
index 5a0c6e2..f8910c1 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TransactionalViewIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TransactionalViewIT.java
@@ -50,8 +50,8 @@ public class TransactionalViewIT extends ParallelStatsEnabledIT {
@Parameters(name="TransactionalViewIT_transactionProvider={0}")
public static Collection<Object[]> data() {
- return Arrays.asList(new Object[][] {
- {"TEPHRA"},{"OMID"}});
+ return TestUtil.filterTxParamData(Arrays.asList(new Object[][] {
+ {"TEPHRA"},{"OMID"}}),0);
}
@Before
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalImmutableTxIndexIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalImmutableTxIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalImmutableTxIndexIT.java
index 66fc583..76deb99 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalImmutableTxIndexIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalImmutableTxIndexIT.java
@@ -20,6 +20,7 @@ package org.apache.phoenix.end2end.index;
import java.util.Arrays;
import java.util.Collection;
+import org.apache.phoenix.util.TestUtil;
import org.junit.runners.Parameterized.Parameters;
public class GlobalImmutableTxIndexIT extends BaseIndexIT {
@@ -30,10 +31,11 @@ public class GlobalImmutableTxIndexIT extends BaseIndexIT {
@Parameters(name="GlobalImmutableTxIndexIT_localIndex={0},mutable={1},transactionProvider={2},columnEncoded={3}") // name is used by failsafe as file name in reports
public static Collection<Object[]> data() {
- return Arrays.asList(new Object[][] {
- { false, false, "TEPHRA", false }, { false, false, "TEPHRA", true },
- { false, false, "OMID", false },
- });
+ return TestUtil.filterTxParamData(
+ Arrays.asList(new Object[][] {
+ { false, false, "TEPHRA", false }, { false, false, "TEPHRA", true },
+ { false, false, "OMID", false },
+ }), 2);
}
}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalMutableTxIndexIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalMutableTxIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalMutableTxIndexIT.java
index 2440832..b33cce7 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalMutableTxIndexIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalMutableTxIndexIT.java
@@ -20,6 +20,7 @@ package org.apache.phoenix.end2end.index;
import java.util.Arrays;
import java.util.Collection;
+import org.apache.phoenix.util.TestUtil;
import org.junit.runners.Parameterized.Parameters;
public class GlobalMutableTxIndexIT extends BaseIndexIT {
@@ -30,10 +31,11 @@ public class GlobalMutableTxIndexIT extends BaseIndexIT {
@Parameters(name="GlobalMutableTxIndexIT_localIndex={0},mutable={1},transactionProvider={2},columnEncoded={3}") // name is used by failsafe as file name in reports
public static Collection<Object[]> data() {
- return Arrays.asList(new Object[][] {
- { false, true, "TEPHRA", false }, { false, true, "TEPHRA", true },
- { false, true, "OMID", false },
- });
+ return TestUtil.filterTxParamData(
+ Arrays.asList(new Object[][] {
+ { false, true, "TEPHRA", false }, { false, true, "TEPHRA", true },
+ { false, true, "OMID", false },
+ }), 2);
}
}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexIT.java
index 366e850..881c540 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexIT.java
@@ -78,7 +78,6 @@ import com.google.common.collect.Maps;
public class ImmutableIndexIT extends BaseUniqueNamesOwnClusterIT {
private final boolean localIndex;
- private final boolean transactional;
private final PhoenixTransactionProvider transactionProvider;
private final String tableDDLOptions;
@@ -91,7 +90,6 @@ public class ImmutableIndexIT extends BaseUniqueNamesOwnClusterIT {
public ImmutableIndexIT(boolean localIndex, boolean transactional, String transactionProvider, boolean columnEncoded) {
StringBuilder optionBuilder = new StringBuilder("IMMUTABLE_ROWS=true");
this.localIndex = localIndex;
- this.transactional = transactional;
if (!columnEncoded) {
optionBuilder.append(",COLUMN_ENCODED_BYTES=0,IMMUTABLE_STORAGE_SCHEME="+PTableImpl.ImmutableStorageScheme.ONE_CELL_PER_COLUMN);
}
@@ -117,15 +115,15 @@ public class ImmutableIndexIT extends BaseUniqueNamesOwnClusterIT {
@Parameters(name="ImmutableIndexIT_localIndex={0},transactional={1},transactionProvider={2},columnEncoded={3}") // name is used by failsafe as file name in reports
public static Collection<Object[]> data() {
- return Arrays.asList(new Object[][] {
- { false, false, null, false }, { false, false, null, true },
- { false, true, "OMID", false },
- { false, true, "TEPHRA", false }, { false, true, "TEPHRA", true },
- { true, false, null, false }, { true, false, null, true },
- { true, true, "TEPHRA", false }, { true, true, "TEPHRA", true },
- { true, true, "OMID", false },
- }
- );
+ return TestUtil.filterTxParamData(
+ Arrays.asList(new Object[][] {
+ { false, false, null, false }, { false, false, null, true },
+ { false, true, "OMID", false },
+ { false, true, "TEPHRA", false }, { false, true, "TEPHRA", true },
+ { true, false, null, false }, { true, false, null, true },
+ { true, true, "TEPHRA", false }, { true, true, "TEPHRA", true },
+ { true, true, "OMID", false },
+ }), 2);
}
@Test
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalImmutableTxIndexIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalImmutableTxIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalImmutableTxIndexIT.java
index 394d4ed..c1221eb 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalImmutableTxIndexIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalImmutableTxIndexIT.java
@@ -20,6 +20,7 @@ package org.apache.phoenix.end2end.index;
import java.util.Arrays;
import java.util.Collection;
+import org.apache.phoenix.util.TestUtil;
import org.junit.runners.Parameterized.Parameters;
public class LocalImmutableTxIndexIT extends BaseIndexIT {
@@ -30,10 +31,11 @@ public class LocalImmutableTxIndexIT extends BaseIndexIT {
@Parameters(name="LocalImmutableTxIndexIT_localIndex={0},mutable={1},transactionProvider={2},columnEncoded={3}") // name is used by failsafe as file name in reports
public static Collection<Object[]> data() {
- return Arrays.asList(new Object[][] {
- { true, false, "TEPHRA", false }, { true, false, "TEPHRA", true },
- { true, false, "OMID", false }
- });
+ return TestUtil.filterTxParamData(
+ Arrays.asList(new Object[][] {
+ { true, false, "TEPHRA", false }, { true, false, "TEPHRA", true },
+ { true, false, "OMID", false }
+ }), 2);
}
}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalMutableTxIndexIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalMutableTxIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalMutableTxIndexIT.java
index 1486d60..c723dfe 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalMutableTxIndexIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalMutableTxIndexIT.java
@@ -20,6 +20,7 @@ package org.apache.phoenix.end2end.index;
import java.util.Arrays;
import java.util.Collection;
+import org.apache.phoenix.util.TestUtil;
import org.junit.runners.Parameterized.Parameters;
public class LocalMutableTxIndexIT extends BaseIndexIT {
@@ -30,9 +31,10 @@ public class LocalMutableTxIndexIT extends BaseIndexIT {
@Parameters(name="LocalMutableTxIndexIT_localIndex={0},mutable={1},transactionProvider={2},columnEncoded={3}") // name is used by failsafe as file name in reports
public static Collection<Object[]> data() {
- return Arrays.asList(new Object[][] {
- { true, true, "TEPHRA", false }, { true, true, "TEPHRA", true },
- { true, true, "OMID", false },
- });
+ return TestUtil.filterTxParamData(
+ Arrays.asList(new Object[][] {
+ { true, true, "TEPHRA", false }, { true, true, "TEPHRA", true },
+ { true, true, "OMID", false },
+ }), 2);
}
}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java
index 1af42ac..8f995f5 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java
@@ -29,6 +29,7 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Arrays;
+import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -157,38 +158,38 @@ public class MutableIndexFailureIT extends BaseTest {
indexRebuildTaskRegionEnvironment.getConfiguration());
}
- @Parameters(name = "MutableIndexFailureIT_transactional={0},localIndex={1},isNamespaceMapped={2},disableIndexOnWriteFailure={3},failRebuildTask={4},throwIndexWriteFailure={5}") // name is used by failsafe as file name in reports
- public static List<Object[]> data() {
- return Arrays.asList(new Object[][] {
- // note - can't disableIndexOnWriteFailure without throwIndexWriteFailure, PHOENIX-4130
- { null, false, false, false, false, false},
- { null, false, true, true, false, null},
- { null, false, true, true, false, true},
- { null, false, false, true, false, null},
- { null, true, true, true, false, null},
- { null, true, false, null, false, null},
- { "TEPHRA", true, false, true, false, null},
- { "TEPHRA", true, true, null, false, null},
- { "TEPHRA", false, false, true, false, null},
- { "TEPHRA", false, true, true, false, null},
- { "OMID", true, false, true, false, null},
- { "OMID", true, true, null, false, null},
- { "OMID", false, false, true, false, null},
- { "OMID", false, true, true, false, null},
-
- { null, false, false, false, false, null},
- { null, true, false, false, false, null},
- { null, false, false, false, false, null},
- { null, false, false, true, false, null},
- { null, false, false, true, false, null},
- { null, true, false, true, false, null},
- { null, true, false, true, false, null},
- { null, false, false, true, true, null},
- { null, false, true, true, true, null},
- { null, false, false, false, true, false},
- { null, false, true, false, true, false},
- }
- );
+ @Parameters(name = "MutableIndexFailureIT_transactionProvider={0},localIndex={1},isNamespaceMapped={2},disableIndexOnWriteFailure={3},failRebuildTask={4},throwIndexWriteFailure={5}") // name is used by failsafe as file name in reports
+ public static Collection<Object[]> data() {
+ return TestUtil.filterTxParamData(
+ Arrays.asList(new Object[][] {
+ // note - can't disableIndexOnWriteFailure without throwIndexWriteFailure, PHOENIX-4130
+ { null, false, false, false, false, false},
+ { null, false, true, true, false, null},
+ { null, false, true, true, false, true},
+ { null, false, false, true, false, null},
+ { null, true, true, true, false, null},
+ { null, true, false, null, false, null},
+ { "TEPHRA", true, false, true, false, null},
+ { "TEPHRA", true, true, null, false, null},
+ { "TEPHRA", false, false, true, false, null},
+ { "TEPHRA", false, true, true, false, null},
+ { "OMID", true, false, true, false, null},
+ { "OMID", true, true, null, false, null},
+ { "OMID", false, false, true, false, null},
+ { "OMID", false, true, true, false, null},
+
+ { null, false, false, false, false, null},
+ { null, true, false, false, false, null},
+ { null, false, false, false, false, null},
+ { null, false, false, true, false, null},
+ { null, false, false, true, false, null},
+ { null, true, false, true, false, null},
+ { null, true, false, true, false, null},
+ { null, false, false, true, true, null},
+ { null, false, true, true, true, null},
+ { null, false, false, false, true, false},
+ { null, false, true, false, true, false},
+ }), 0);
}
private void runRebuildTask(Connection conn) throws InterruptedException, SQLException {
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/MutableRollbackIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/MutableRollbackIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/MutableRollbackIT.java
index a73beb9..40c6cab 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/MutableRollbackIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/MutableRollbackIT.java
@@ -55,10 +55,10 @@ public class MutableRollbackIT extends ParallelStatsDisabledIT {
@Parameters(name="MutableRollbackIT_localIndex={0},transactionProvider={1}") // name is used by failsafe as file name in reports
public static Collection<Object[]> data() {
- return Arrays.asList(new Object[][] {
+ return TestUtil.filterTxParamData(Arrays.asList(new Object[][] {
{ false, "TEPHRA"}, { true, "TEPHRA"},
{ false, "OMID"}, { true, "OMID"},
- });
+ }),1);
}
private static Connection getConnection() throws SQLException {
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/RollbackIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/RollbackIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/RollbackIT.java
index 2c6ecbe..4b5fa09 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/RollbackIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/RollbackIT.java
@@ -66,12 +66,12 @@ public class RollbackIT extends ParallelStatsDisabledIT {
@Parameters(name="RollbackIT_localIndex={0},mutable={1},transactionProvider={2}") // name is used by failsafe as file name in reports
public static Collection<Object[]> data() {
- return Arrays.asList(new Object[][] {
+ return TestUtil.filterTxParamData(Arrays.asList(new Object[][] {
{ false, false, "TEPHRA" }, { false, true, "TEPHRA" },
{ true, false, "TEPHRA" }, { true, true, "TEPHRA" },
{ false, false, "OMID" }, { false, true, "OMID" },
{ true, false, "OMID" }, { true, true, "OMID" },
- });
+ }),2);
}
@Test
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/TxWriteFailureIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/TxWriteFailureIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/TxWriteFailureIT.java
index a5b613a..70ea133 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/TxWriteFailureIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/TxWriteFailureIT.java
@@ -48,6 +48,7 @@ import org.apache.phoenix.util.PropertiesUtil;
import org.apache.phoenix.util.QueryUtil;
import org.apache.phoenix.util.ReadOnlyProps;
import org.apache.phoenix.util.SchemaUtil;
+import org.apache.phoenix.util.TestUtil;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -94,10 +95,10 @@ public class TxWriteFailureIT extends BaseUniqueNamesOwnClusterIT {
@Parameters(name="TxWriteFailureIT_localIndex={0},mutable={1},transactionProvider={2}") // name is used by failsafe as file name in reports
public static Collection<Object[]> data() {
- return Arrays.asList(new Object[][] {
+ return TestUtil.filterTxParamData(Arrays.asList(new Object[][] {
{ false, false, "TEPHRA" }, { false, true, "TEPHRA" }, { true, false, "TEPHRA" }, { true, true, "TEPHRA" },
{ false, false, "OMID" }, { false, true, "OMID" }, { true, false, "OMID" }, { true, true, "OMID" },
- });
+ }), 2);
}
@Before
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
index 4da9de7..6a5c73d 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
@@ -58,6 +58,7 @@ import org.apache.phoenix.query.QueryServices;
import org.apache.phoenix.schema.TableRef;
import org.apache.phoenix.util.PhoenixRuntime;
import org.apache.phoenix.util.ReadOnlyProps;
+import org.apache.phoenix.util.TestUtil;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -100,8 +101,8 @@ public class PartialCommitIT extends BaseUniqueNamesOwnClusterIT {
@Parameters(name="PartialCommitIT_transactionProvider={0}")
public static Collection<Object[]> data() {
- return Arrays.asList(new Object[][] {
- {"TEPHRA"},{"OMID"}});
+ return TestUtil.filterTxParamData(Arrays.asList(new Object[][] {
+ {"TEPHRA"},{"OMID"}}),0);
}
public PartialCommitIT(String transactionProvider) {
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/it/java/org/apache/phoenix/rpc/UpdateCacheIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/rpc/UpdateCacheIT.java b/phoenix-core/src/it/java/org/apache/phoenix/rpc/UpdateCacheIT.java
index c9b09e9..009ee06 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/rpc/UpdateCacheIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/rpc/UpdateCacheIT.java
@@ -67,11 +67,13 @@ public class UpdateCacheIT extends ParallelStatsDisabledIT {
@Test
public void testUpdateCacheForTxnTable() throws Exception {
for (TransactionFactory.Provider provider : TransactionFactory.Provider.values()) {
- String tableName = generateUniqueName();
- String fullTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + tableName;
- Connection conn = DriverManager.getConnection(getUrl(), PropertiesUtil.deepCopy(TEST_PROPERTIES));
- conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA + "TRANSACTIONAL=true,TRANSACTION_PROVIDER='" + provider + "'");
- helpTestUpdateCache(fullTableName, new int[] {1, 1});
+ if (provider.runTests()) {
+ String tableName = generateUniqueName();
+ String fullTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + tableName;
+ Connection conn = DriverManager.getConnection(getUrl(), PropertiesUtil.deepCopy(TEST_PROPERTIES));
+ conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA + "TRANSACTIONAL=true,TRANSACTION_PROVIDER='" + provider + "'");
+ helpTestUpdateCache(fullTableName, new int[] {1, 1});
+ }
}
}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/it/java/org/apache/phoenix/tx/FlappingTransactionIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/tx/FlappingTransactionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/tx/FlappingTransactionIT.java
index 7f4b373..3c164ea 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/tx/FlappingTransactionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/tx/FlappingTransactionIT.java
@@ -69,9 +69,9 @@ public class FlappingTransactionIT extends ParallelStatsDisabledIT {
@Parameters(name="FlappingTransactionIT_transactionProvider={0}") // name is used by failsafe as file name in reports
public static Collection<Object[]> data() {
- return Arrays.asList(new Object[][] {
+ return TestUtil.filterTxParamData(Arrays.asList(new Object[][] {
{"TEPHRA"}, {"OMID"}
- });
+ }),0);
}
@Test
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/it/java/org/apache/phoenix/tx/ParameterizedTransactionIT.java
----------------------------------------------------------------------
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 170a86a..f94ec17 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
@@ -101,10 +101,10 @@ public class ParameterizedTransactionIT extends ParallelStatsDisabledIT {
@Parameters(name="ParameterizedTransactionIT_mutable={0},columnEncoded={1},transactionProvider={2}") // name is used by failsafe as file name in reports
public static Collection<Object[]> data() {
- return Arrays.asList(new Object[][] {
+ return TestUtil.filterTxParamData(Arrays.asList(new Object[][] {
{false, false, "TEPHRA" }, {false, true, "TEPHRA" }, {true, false, "TEPHRA" }, { true, true, "TEPHRA" },
{false, false, "OMID" }, {true, false, "OMID" },
- });
+ }), 2);
}
@Test
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
index ba7b34c..853f84d 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
@@ -76,8 +76,8 @@ public class TransactionIT extends ParallelStatsDisabledIT {
@Parameters(name="TransactionIT_provider={0}") // name is used by failsafe as file name in reports
public static Collection<Object[]> data() {
- return Arrays.asList(new Object[][] {
- {"TEPHRA"},{"OMID"}});
+ return TestUtil.filterTxParamData(Arrays.asList(new Object[][] {
+ {"TEPHRA"},{"OMID"}}),0);
}
@Test
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/it/java/org/apache/phoenix/tx/TxCheckpointIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/tx/TxCheckpointIT.java b/phoenix-core/src/it/java/org/apache/phoenix/tx/TxCheckpointIT.java
index 939deff..9c49a5e 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/tx/TxCheckpointIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/tx/TxCheckpointIT.java
@@ -40,6 +40,7 @@ import org.apache.phoenix.schema.PTableImpl;
import org.apache.phoenix.transaction.PhoenixTransactionContext.PhoenixVisibilityLevel;
import org.apache.phoenix.util.PropertiesUtil;
import org.apache.phoenix.util.SchemaUtil;
+import org.apache.phoenix.util.TestUtil;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
@@ -79,12 +80,12 @@ public class TxCheckpointIT extends ParallelStatsDisabledIT {
@Parameters(name="TxCheckpointIT_localIndex={0},mutable={1},columnEncoded={2},transactionProvider={3}") // name is used by failsafe as file name in reports
public static Collection<Object[]> data() {
- return Arrays.asList(new Object[][] {
+ return TestUtil.filterTxParamData(Arrays.asList(new Object[][] {
{ false, false, false, "TEPHRA" }, { false, false, true, "TEPHRA" }, { false, true, false, "TEPHRA" }, { false, true, true, "TEPHRA" },
{ true, false, false, "TEPHRA" }, { true, false, true, "TEPHRA" }, { true, true, false, "TEPHRA" }, { true, true, true, "TEPHRA" },
{ false, false, false, "OMID" }, { false, true, false, "OMID" },
{ true, false, false, "OMID" }, { true, true, false, "OMID" },
- });
+ }),3);
}
@Test
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/main/java/org/apache/phoenix/transaction/TransactionFactory.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/transaction/TransactionFactory.java b/phoenix-core/src/main/java/org/apache/phoenix/transaction/TransactionFactory.java
index 5e2630a..4329894 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/transaction/TransactionFactory.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/transaction/TransactionFactory.java
@@ -25,15 +25,17 @@ import org.apache.phoenix.coprocessor.MetaDataProtocol;
public class TransactionFactory {
public enum Provider {
- TEPHRA((byte)1, TephraTransactionProvider.getInstance()),
- OMID((byte)2, OmidTransactionProvider.getInstance());
+ TEPHRA((byte)1, TephraTransactionProvider.getInstance(), false),
+ OMID((byte)2, OmidTransactionProvider.getInstance(), true);
private final byte code;
private final PhoenixTransactionProvider provider;
+ private final boolean runTests;
- Provider(byte code, PhoenixTransactionProvider provider) {
+ Provider(byte code, PhoenixTransactionProvider provider, boolean runTests) {
this.code = code;
this.provider = provider;
+ this.runTests = runTests;
}
public byte getCode() {
@@ -54,6 +56,10 @@ public class TransactionFactory {
public PhoenixTransactionProvider getTransactionProvider() {
return provider;
}
+
+ public boolean runTests() {
+ return runTests;
+ }
}
public static PhoenixTransactionProvider getTransactionProvider(Provider provider) {
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5af5980a/phoenix-core/src/test/java/org/apache/phoenix/util/TestUtil.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/test/java/org/apache/phoenix/util/TestUtil.java b/phoenix-core/src/test/java/org/apache/phoenix/util/TestUtil.java
index 6e50c4f..e3ee359 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/util/TestUtil.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/util/TestUtil.java
@@ -122,6 +122,7 @@ import org.apache.phoenix.schema.stats.GuidePostsInfo;
import org.apache.phoenix.schema.stats.GuidePostsKey;
import org.apache.phoenix.schema.tuple.Tuple;
import org.apache.phoenix.schema.types.PDataType;
+import org.apache.phoenix.transaction.TransactionFactory;
import com.google.common.base.Objects;
import com.google.common.collect.Lists;
@@ -1058,4 +1059,28 @@ public class TestUtil {
}
assertTrue(!rs.next());
}
+
+ public static Collection<Object[]> filterTxParamData(Collection<Object[]> data, int index) {
+ boolean runAllTests = true;
+ boolean runNoTests = true;
+
+ for (TransactionFactory.Provider provider : TransactionFactory.Provider.values()) {
+ runAllTests &= provider.runTests();
+ runNoTests &= !provider.runTests();
+ }
+ if (runNoTests) {
+ return Collections.emptySet();
+ }
+ if (runAllTests) {
+ return data;
+ }
+ List<Object[]> filteredData = Lists.newArrayListWithExpectedSize(data.size());
+ for (Object[] params : data) {
+ String provider = (String)params[index];
+ if (provider == null || TransactionFactory.Provider.valueOf(provider).runTests()) {
+ filteredData.add(params);
+ }
+ }
+ return filteredData;
+ }
}