From 2223b49c10bcfbce22450ff442070384c06fc477 Mon Sep 17 00:00:00 2001 From: Caideyipi <87789683+Caideyipi@users.noreply.github.com> Date: Wed, 17 Jul 2024 10:16:38 +0800 Subject: [PATCH 1/2] refactor --- .../iotdb/db/it/schema/IoTDBTagAlterIT.java | 1 + .../apache/iotdb/db/it/schema/IoTDBTagIT.java | 1 + .../iotdb/db/it/schema/IoTDBTagLimitIT.java | 15 ++++--- .../quota/IoTDBClusterDeviceQuotaIT.java | 3 +- .../it/schema/quota/IoTDBClusterQuotaIT.java | 1 + .../regionscan/IoTDBActiveRegionScanIT.java | 21 ++++----- .../regionscan/IoTDBActiveRegionScanIT2.java | 15 ++++--- .../IoTDBActiveRegionScanWithModsIT.java | 25 ++++++----- .../IoTDBActiveRegionScanWithModsIT2.java | 15 ++++--- .../IoTDBActiveRegionScanWithTTLIT.java | 45 ++++++++++--------- .../it/autocreate/IoTDBPipeIdempotentIT.java | 7 ++- .../it/IoTDBSessionSchemaTemplateIT.java | 4 +- .../apache/iotdb/util/AbstractSchemaIT.java | 15 +++++-- 13 files changed, 97 insertions(+), 71 deletions(-) diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagAlterIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagAlterIT.java index 116d767ab8f97..d4afa4e3d04a7 100644 --- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagAlterIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagAlterIT.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.iotdb.db.it.schema; import org.apache.iotdb.db.queryengine.common.header.ColumnHeaderConstant; diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagIT.java index e8d8596df016c..0fc239067d88f 100644 --- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagIT.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.iotdb.db.it.schema; import org.apache.iotdb.db.queryengine.common.header.ColumnHeaderConstant; diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagLimitIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagLimitIT.java index ff8fc930c429c..aea1e5141514e 100644 --- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagLimitIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagLimitIT.java @@ -25,10 +25,9 @@ import org.apache.iotdb.itbase.category.LocalStandaloneIT; import org.apache.iotdb.util.AbstractSchemaIT; -import org.junit.AfterClass; -import org.junit.BeforeClass; import org.junit.Test; import org.junit.experimental.categories.Category; +import org.junit.runners.Parameterized; import java.sql.Connection; import java.sql.ResultSet; @@ -44,7 +43,7 @@ @Category({LocalStandaloneIT.class, ClusterIT.class}) public class IoTDBTagLimitIT extends AbstractSchemaIT { - public IoTDBTagLimitIT(SchemaTestMode schemaTestMode) { + public IoTDBTagLimitIT(final SchemaTestMode schemaTestMode) { super(schemaTestMode); } @@ -53,16 +52,18 @@ public IoTDBTagLimitIT(SchemaTestMode schemaTestMode) { "create database root.turbine", }; - @BeforeClass - public static void setUp() throws Exception { + @Parameterized.BeforeParam + public static void before() throws Exception { EnvFactory.getEnv().getConfig().getCommonConfig().setTagAttributeTotalSize(50); + setUpEnvironment(); EnvFactory.getEnv().initClusterEnvironment(); prepareData(SQLs); } - @AfterClass - public static void tearDown() throws Exception { + @Parameterized.AfterParam + public static void after() throws Exception { EnvFactory.getEnv().cleanClusterEnvironment(); + tearDownEnvironment(); } @Test diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/quota/IoTDBClusterDeviceQuotaIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/quota/IoTDBClusterDeviceQuotaIT.java index 0d62082f367c4..6c85ab48e4169 100644 --- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/quota/IoTDBClusterDeviceQuotaIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/quota/IoTDBClusterDeviceQuotaIT.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.iotdb.db.it.schema.quota; import org.apache.iotdb.it.env.EnvFactory; @@ -24,7 +25,7 @@ import org.junit.runners.Parameterized; public class IoTDBClusterDeviceQuotaIT extends IoTDBClusterQuotaIT { - public IoTDBClusterDeviceQuotaIT(AbstractSchemaIT.SchemaTestMode schemaTestMode) { + public IoTDBClusterDeviceQuotaIT(final AbstractSchemaIT.SchemaTestMode schemaTestMode) { super(schemaTestMode); } diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/quota/IoTDBClusterQuotaIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/quota/IoTDBClusterQuotaIT.java index b772bd796a694..8eea7fc04709d 100644 --- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/quota/IoTDBClusterQuotaIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/quota/IoTDBClusterQuotaIT.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.iotdb.db.it.schema.quota; import org.apache.iotdb.it.env.EnvFactory; diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanIT.java index aa568b583c1bd..f5c1da1b336c2 100644 --- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanIT.java @@ -24,10 +24,9 @@ import org.apache.iotdb.itbase.category.LocalStandaloneIT; import org.apache.iotdb.util.AbstractSchemaIT; -import org.junit.AfterClass; -import org.junit.BeforeClass; import org.junit.Test; import org.junit.experimental.categories.Category; +import org.junit.runners.Parameterized; import java.sql.Connection; import java.sql.ResultSet; @@ -148,33 +147,35 @@ public IoTDBActiveRegionScanIT(SchemaTestMode schemaTestMode) { } public static void insertData() { - try (Connection connection = EnvFactory.getEnv().getConnection(); - Statement statement = connection.createStatement()) { + try (final Connection connection = EnvFactory.getEnv().getConnection(); + final Statement statement = connection.createStatement()) { // create aligned and non-aligned time series - for (String sql : common_insert_sqls) { + for (final String sql : common_insert_sqls) { statement.addBatch(sql); } statement.executeBatch(); - } catch (Exception e) { + } catch (final Exception e) { fail(e.getMessage()); } } - @BeforeClass - public static void setUp() throws Exception { + @Parameterized.BeforeParam + public static void before() throws Exception { EnvFactory.getEnv() .getConfig() .getCommonConfig() .setEnableSeqSpaceCompaction(false) .setEnableUnseqSpaceCompaction(false) .setEnableCrossSpaceCompaction(false); + setUpEnvironment(); EnvFactory.getEnv().initClusterEnvironment(); insertData(); } - @AfterClass - public static void tearDown() throws Exception { + @Parameterized.AfterParam + public static void after() throws Exception { + tearDownEnvironment(); EnvFactory.getEnv().cleanClusterEnvironment(); } diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanIT2.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanIT2.java index da56d3078b01e..58551e82e78cd 100644 --- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanIT2.java +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanIT2.java @@ -23,18 +23,17 @@ import org.apache.iotdb.itbase.category.ClusterIT; import org.apache.iotdb.itbase.category.LocalStandaloneIT; -import org.junit.AfterClass; -import org.junit.BeforeClass; import org.junit.experimental.categories.Category; +import org.junit.runners.Parameterized; @Category({LocalStandaloneIT.class, ClusterIT.class}) public class IoTDBActiveRegionScanIT2 extends IoTDBActiveRegionScanIT { - public IoTDBActiveRegionScanIT2(SchemaTestMode schemaTestMode) { + public IoTDBActiveRegionScanIT2(final SchemaTestMode schemaTestMode) { super(schemaTestMode); } - @BeforeClass - public static void setUp() throws Exception { + @Parameterized.BeforeParam + public static void before() throws Exception { EnvFactory.getEnv() .getConfig() .getCommonConfig() @@ -42,12 +41,14 @@ public static void setUp() throws Exception { .setEnableUnseqSpaceCompaction(false) .setEnableCrossSpaceCompaction(false) .setMaxTsBlockLineNumber(1); + setUpEnvironment(); EnvFactory.getEnv().initClusterEnvironment(); insertData(); } - @AfterClass - public static void tearDown() throws Exception { + @Parameterized.AfterParam + public static void after() throws Exception { + tearDownEnvironment(); EnvFactory.getEnv().cleanClusterEnvironment(); } } diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanWithModsIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanWithModsIT.java index 0c10f507aa214..e0a99b0590aa5 100644 --- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanWithModsIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanWithModsIT.java @@ -24,10 +24,9 @@ import org.apache.iotdb.itbase.category.LocalStandaloneIT; import org.apache.iotdb.util.AbstractSchemaIT; -import org.junit.AfterClass; -import org.junit.BeforeClass; import org.junit.Test; import org.junit.experimental.categories.Category; +import org.junit.runners.Parameterized; import java.sql.Connection; import java.sql.Statement; @@ -55,41 +54,43 @@ public class IoTDBActiveRegionScanWithModsIT extends AbstractSchemaIT { "delete from root.sg.unaligned.d2.* where time > 40 and time <= 43" }; - public IoTDBActiveRegionScanWithModsIT(SchemaTestMode schemaTestMode) { + public IoTDBActiveRegionScanWithModsIT(final SchemaTestMode schemaTestMode) { super(schemaTestMode); } public static void insertData() { - try (Connection connection = EnvFactory.getEnv().getConnection(); - Statement statement = connection.createStatement()) { + try (final Connection connection = EnvFactory.getEnv().getConnection(); + final Statement statement = connection.createStatement()) { // create aligned and non-aligned time series - for (String sql : common_insert_sqls) { + for (final String sql : common_insert_sqls) { statement.addBatch(sql); } - for (String sql : delete_sqls) { + for (final String sql : delete_sqls) { statement.addBatch(sql); } statement.executeBatch(); - } catch (Exception e) { + } catch (final Exception e) { fail(e.getMessage()); } } - @BeforeClass - public static void setUp() throws Exception { + @Parameterized.BeforeParam + public static void before() throws Exception { EnvFactory.getEnv() .getConfig() .getCommonConfig() .setEnableSeqSpaceCompaction(false) .setEnableUnseqSpaceCompaction(false) .setEnableCrossSpaceCompaction(false); + setUpEnvironment(); EnvFactory.getEnv().initClusterEnvironment(); insertData(); } - @AfterClass - public static void tearDown() throws Exception { + @Parameterized.AfterParam + public static void after() throws Exception { + tearDownEnvironment(); EnvFactory.getEnv().cleanClusterEnvironment(); } diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanWithModsIT2.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanWithModsIT2.java index 5adccd1fd6980..fd6aaf25d46ce 100644 --- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanWithModsIT2.java +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanWithModsIT2.java @@ -23,18 +23,17 @@ import org.apache.iotdb.itbase.category.ClusterIT; import org.apache.iotdb.itbase.category.LocalStandaloneIT; -import org.junit.AfterClass; -import org.junit.BeforeClass; import org.junit.experimental.categories.Category; +import org.junit.runners.Parameterized; @Category({LocalStandaloneIT.class, ClusterIT.class}) public class IoTDBActiveRegionScanWithModsIT2 extends IoTDBActiveRegionScanWithModsIT { - public IoTDBActiveRegionScanWithModsIT2(SchemaTestMode schemaTestMode) { + public IoTDBActiveRegionScanWithModsIT2(final SchemaTestMode schemaTestMode) { super(schemaTestMode); } - @BeforeClass - public static void setUp() throws Exception { + @Parameterized.BeforeParam + public static void before() throws Exception { EnvFactory.getEnv() .getConfig() .getCommonConfig() @@ -42,12 +41,14 @@ public static void setUp() throws Exception { .setEnableUnseqSpaceCompaction(false) .setEnableCrossSpaceCompaction(false) .setMaxTsBlockLineNumber(1); + setUpEnvironment(); EnvFactory.getEnv().initClusterEnvironment(); insertData(); } - @AfterClass - public static void tearDown() throws Exception { + @Parameterized.AfterParam + public static void after() throws Exception { + tearDownEnvironment(); EnvFactory.getEnv().cleanClusterEnvironment(); } } diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanWithTTLIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanWithTTLIT.java index 1e6013da49174..775718628f945 100644 --- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanWithTTLIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/regionscan/IoTDBActiveRegionScanWithTTLIT.java @@ -24,10 +24,9 @@ import org.apache.iotdb.itbase.category.LocalStandaloneIT; import org.apache.iotdb.util.AbstractSchemaIT; -import org.junit.AfterClass; -import org.junit.BeforeClass; import org.junit.Test; import org.junit.experimental.categories.Category; +import org.junit.runners.Parameterized; import java.sql.Connection; import java.sql.Statement; @@ -39,7 +38,7 @@ @Category({LocalStandaloneIT.class, ClusterIT.class}) public class IoTDBActiveRegionScanWithTTLIT extends AbstractSchemaIT { - public IoTDBActiveRegionScanWithTTLIT(SchemaTestMode schemaTestMode) { + public IoTDBActiveRegionScanWithTTLIT(final SchemaTestMode schemaTestMode) { super(schemaTestMode); } @@ -65,64 +64,66 @@ public IoTDBActiveRegionScanWithTTLIT(SchemaTestMode schemaTestMode) { }; public static void insertData() { - try (Connection connection = EnvFactory.getEnv().getConnection(); - Statement statement = connection.createStatement()) { + try (final Connection connection = EnvFactory.getEnv().getConnection(); + final Statement statement = connection.createStatement()) { - for (String sql : sqls) { + for (final String sql : sqls) { statement.addBatch(sql); } statement.executeBatch(); - } catch (Exception e) { + } catch (final Exception e) { fail(e.getMessage()); } } private static void setTTL() { - String[] ttl_sqls = {"set ttl to root.sg.d1 3600000", "set ttl to root.sg.d2 3600000"}; - try (Connection connection = EnvFactory.getEnv().getConnection(); - Statement statement = connection.createStatement()) { - for (String sql : ttl_sqls) { + final String[] ttl_sqls = {"set ttl to root.sg.d1 3600000", "set ttl to root.sg.d2 3600000"}; + try (final Connection connection = EnvFactory.getEnv().getConnection(); + final Statement statement = connection.createStatement()) { + for (final String sql : ttl_sqls) { statement.addBatch(sql); } statement.executeBatch(); - } catch (Exception e) { + } catch (final Exception e) { fail(e.getMessage()); } } private static void unsetTTL() { - String[] ttl_sqls = {"unset ttl to root.sg.d1", "unset ttl to root.sg.d2"}; - try (Connection connection = EnvFactory.getEnv().getConnection(); - Statement statement = connection.createStatement()) { - for (String sql : ttl_sqls) { + final String[] ttl_sqls = {"unset ttl to root.sg.d1", "unset ttl to root.sg.d2"}; + try (final Connection connection = EnvFactory.getEnv().getConnection(); + final Statement statement = connection.createStatement()) { + for (final String sql : ttl_sqls) { statement.addBatch(sql); } statement.executeBatch(); - } catch (Exception e) { + } catch (final Exception e) { fail(e.getMessage()); } } - @BeforeClass - public static void setUp() throws Exception { + @Parameterized.BeforeParam + public static void before() throws Exception { EnvFactory.getEnv() .getConfig() .getCommonConfig() .setEnableSeqSpaceCompaction(false) .setEnableUnseqSpaceCompaction(false) .setEnableCrossSpaceCompaction(false); + setUpEnvironment(); EnvFactory.getEnv().initClusterEnvironment(); insertData(); } - @AfterClass - public static void tearDown() throws Exception { + @Parameterized.AfterParam + public static void after() throws Exception { + tearDownEnvironment(); EnvFactory.getEnv().cleanClusterEnvironment(); } @Test public void showActiveDataWithMods() { - String sql = "show devices where time > 0"; + final String sql = "show devices where time > 0"; String[] retArray = new String[] {"root.sg.d1", "root.sg.d2"}; basicShowActiveDeviceTest(sql, SHOW_DEVICES_COLUMN_NAMES, retArray); diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/autocreate/IoTDBPipeIdempotentIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/autocreate/IoTDBPipeIdempotentIT.java index 2cd7e287796e8..b03e1737be4c7 100644 --- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/autocreate/IoTDBPipeIdempotentIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/autocreate/IoTDBPipeIdempotentIT.java @@ -52,7 +52,9 @@ public void setUp() { MultiEnvFactory.createEnv(2); senderEnv = MultiEnvFactory.getEnv(0); receiverEnv = MultiEnvFactory.getEnv(1); + } + private void innerSetUp(final String schemaEngineMode) { // TODO: delete ratis configurations // All the schema operations must be under the same database to // be in the same region, therefore a non-idempotent operation can block the next one @@ -71,7 +73,10 @@ public void setUp() { .getCommonConfig() .setAutoCreateSchemaEnabled(true) .setConfigNodeConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS) - .setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS); + .setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS) + // Currently sender only supports memory impl to transfer snapshot + // However, we still support PBTree impl at receiver + .setSchemaEngineMode(schemaEngineMode); // 10 min, assert that the operations will not time out senderEnv.getConfig().getCommonConfig().setCnConnectionTimeoutMs(600000); diff --git a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSchemaTemplateIT.java b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSchemaTemplateIT.java index b943df6d8b6aa..96836c7d4432b 100644 --- a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSchemaTemplateIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSchemaTemplateIT.java @@ -59,12 +59,13 @@ public class IoTDBSessionSchemaTemplateIT extends AbstractSchemaIT { private ISession session; - public IoTDBSessionSchemaTemplateIT(SchemaTestMode schemaTestMode) { + public IoTDBSessionSchemaTemplateIT(final SchemaTestMode schemaTestMode) { super(schemaTestMode); } @Before public void setUp() throws Exception { + setUpEnvironmentBeforeMethod(); EnvFactory.getEnv().initClusterEnvironment(); session = EnvFactory.getEnv().getSessionConnection(); } @@ -75,6 +76,7 @@ public void tearDown() throws Exception { session.close(); } EnvFactory.getEnv().cleanClusterEnvironment(); + tearDownEnvironment(); } @Test diff --git a/integration-test/src/test/java/org/apache/iotdb/util/AbstractSchemaIT.java b/integration-test/src/test/java/org/apache/iotdb/util/AbstractSchemaIT.java index 1c3f3708ae374..7b8c2cb74dbb7 100644 --- a/integration-test/src/test/java/org/apache/iotdb/util/AbstractSchemaIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/util/AbstractSchemaIT.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.iotdb.util; import org.apache.iotdb.db.queryengine.common.header.ColumnHeaderConstant; @@ -40,7 +41,8 @@ * full memory, partial memory and non memory. * *

Notice that, all IT class extends AbstractSchemaIT need to call {@link - * AbstractSchemaIT#setUpEnvironment} before test env initialization and call {@link + * AbstractSchemaIT#setUpEnvironment} before test env initialization at {@code @BeforeParam}, or + * call {@link AbstractSchemaIT#setUpEnvironmentBeforeMethod()} at {@code @Before}, and call {@link * AbstractSchemaIT#tearDownEnvironment} after test env cleaning. */ @RunWith(Parameterized.class) @@ -70,7 +72,14 @@ public static void beforeClass() { } protected static SchemaTestMode setUpEnvironment() throws Exception { - SchemaTestMode schemaTestMode = schemaTestModes.get(mode++); + return setUpEnvironmentInternal(schemaTestModes.get(mode++)); + } + + protected void setUpEnvironmentBeforeMethod() { + setUpEnvironmentInternal(schemaTestMode); + } + + private static SchemaTestMode setUpEnvironmentInternal(final SchemaTestMode schemaTestMode) { switch (schemaTestMode) { case Memory: EnvFactory.getEnv().getConfig().getCommonConfig().setSchemaEngineMode("Memory"); @@ -128,7 +137,7 @@ protected static void allocateMemoryForSchemaRegion(int allocateMemoryForSchemaR .setSchemaMemoryAllocate(StringUtils.join(proportion, ':')); } - protected enum SchemaTestMode { + public enum SchemaTestMode { Memory, PBTree } From ff7928f8cef8b240e2451e5b4f42120f7949634c Mon Sep 17 00:00:00 2001 From: Caideyipi <87789683+Caideyipi@users.noreply.github.com> Date: Wed, 17 Jul 2024 12:35:36 +0800 Subject: [PATCH 2/2] roll back --- .../iotdb/pipe/it/autocreate/IoTDBPipeIdempotentIT.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/autocreate/IoTDBPipeIdempotentIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/autocreate/IoTDBPipeIdempotentIT.java index b03e1737be4c7..2cd7e287796e8 100644 --- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/autocreate/IoTDBPipeIdempotentIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/autocreate/IoTDBPipeIdempotentIT.java @@ -52,9 +52,7 @@ public void setUp() { MultiEnvFactory.createEnv(2); senderEnv = MultiEnvFactory.getEnv(0); receiverEnv = MultiEnvFactory.getEnv(1); - } - private void innerSetUp(final String schemaEngineMode) { // TODO: delete ratis configurations // All the schema operations must be under the same database to // be in the same region, therefore a non-idempotent operation can block the next one @@ -73,10 +71,7 @@ private void innerSetUp(final String schemaEngineMode) { .getCommonConfig() .setAutoCreateSchemaEnabled(true) .setConfigNodeConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS) - .setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS) - // Currently sender only supports memory impl to transfer snapshot - // However, we still support PBTree impl at receiver - .setSchemaEngineMode(schemaEngineMode); + .setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS); // 10 min, assert that the operations will not time out senderEnv.getConfig().getCommonConfig().setCnConnectionTimeoutMs(600000);