Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,32 @@
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()
.setEnableSeqSpaceCompaction(false)
.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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,32 @@
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()
.setEnableSeqSpaceCompaction(false)
.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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}

Expand All @@ -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);

Expand Down
Loading