Skip to content

Commit

Permalink
Merge branch 'master' into run_int_test_with_any_jdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Torch3333 authored May 24, 2024
2 parents c7a46ab + 5adae62 commit f2a51aa
Show file tree
Hide file tree
Showing 68 changed files with 2,470 additions and 470 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ subprojects {
guavaVersion = '32.1.3-jre'
slf4jVersion = '1.7.36'
cassandraDriverVersion = '3.11.5'
azureCosmosVersion = '4.59.0'
azureCosmosVersion = '4.60.0'
jooqVersion = '3.14.16'
awssdkVersion = '2.25.1'
commonsDbcp2Version = '2.12.0'
Expand All @@ -51,7 +51,7 @@ subprojects {
spotbugsVersion = '4.8.5'
errorproneVersion = '2.10.0'
errorproneJavacVersion = '9+181-r4173-1'
gsonVersion = '2.10.1'
gsonVersion = '2.11.0'
log4jVersion = '2.23.1'
stefanbirknerSystemLambdaVersion = '1.2.1'
spotbugsPluginVersion = '5.2.5'
Expand Down
1 change: 1 addition & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ sourceSets {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/java')
include '**/com/scalar/db/storage/jdbc/*.java'
include '**/com/scalar/db/storage/multistorage/*.java'
}
resources.srcDir file('src/integration-test/resources')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.scalar.db.storage.cassandra;

import com.scalar.db.api.DistributedStorageCrossPartitionScanIntegrationTestBase;
import java.util.Collections;
import java.util.Map;
import java.util.Properties;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

public class CassandraCrossPartitionScanIntegrationTest
extends DistributedStorageCrossPartitionScanIntegrationTestBase {

@Override
protected Properties getProperties(String testName) {
return CassandraEnv.getProperties(testName);
}

@Override
protected Map<String, String> getCreationOptions() {
return Collections.singletonMap(CassandraAdmin.REPLICATION_FACTOR, "1");
}

@Test
@Override
@Disabled("Cross partition scan with ordering is not supported in Cassandra")
public void scan_WithOrderingForNonPrimaryColumns_ShouldReturnProperResult() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static Properties getProperties(String testName) {
properties.setProperty(DatabaseConfig.USERNAME, username);
properties.setProperty(DatabaseConfig.PASSWORD, password);
properties.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN, "true");
properties.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN_FILTERING, "false");
properties.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN_FILTERING, "true");
properties.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN_ORDERING, "false");

// Add testName as a metadata schema suffix
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.scalar.db.storage.cassandra;

import com.scalar.db.transaction.consensuscommit.ConsensusCommitConfig;
import com.scalar.db.transaction.consensuscommit.ConsensusCommitCrossPartitionScanIntegrationTestBase;
import java.util.Collections;
import java.util.Map;
import java.util.Properties;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

public class ConsensusCommitCrossPartitionScanIntegrationTestWithCassandra
extends ConsensusCommitCrossPartitionScanIntegrationTestBase {

@Override
protected Properties getProps(String testName) {
Properties properties = CassandraEnv.getProperties(testName);
properties.setProperty(ConsensusCommitConfig.ISOLATION_LEVEL, "SERIALIZABLE");
return properties;
}

@Override
protected Map<String, String> getCreationOptions() {
return Collections.singletonMap(CassandraAdmin.REPLICATION_FACTOR, "1");
}

@Test
@Override
@Disabled("Cross partition scan with ordering is not supported in Cassandra")
public void scan_CrossPartitionScanWithOrderingGivenForCommittedRecord_ShouldReturnRecords() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.scalar.db.storage.cassandra;

import com.scalar.db.transaction.consensuscommit.ConsensusCommitConfig;
import com.scalar.db.transaction.consensuscommit.TwoPhaseConsensusCommitCrossPartitionScanIntegrationTestBase;
import java.util.Collections;
import java.util.Map;
import java.util.Properties;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

public class TwoPhaseConsensusCommitCrossPartitionScanIntegrationTestWithCassandra
extends TwoPhaseConsensusCommitCrossPartitionScanIntegrationTestBase {

@Override
protected Properties getProps1(String testName) {
Properties properties = CassandraEnv.getProperties(testName);
properties.setProperty(ConsensusCommitConfig.ISOLATION_LEVEL, "SERIALIZABLE");
return properties;
}

@Override
protected Map<String, String> getCreationOptions() {
return Collections.singletonMap(CassandraAdmin.REPLICATION_FACTOR, "1");
}

@Test
@Override
@Disabled("Cross partition scan with ordering is not supported in Cassandra")
public void scan_ScanWithOrderingGivenForCommittedRecord_ShouldReturnRecords() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.scalar.db.storage.cosmos;

import com.scalar.db.transaction.consensuscommit.ConsensusCommitConfig;
import com.scalar.db.transaction.consensuscommit.ConsensusCommitCrossPartitionScanIntegrationTestBase;
import java.util.Map;
import java.util.Properties;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

public class ConsensusCommitCrossPartitionScanIntegrationTestWithCosmos
extends ConsensusCommitCrossPartitionScanIntegrationTestBase {

@Override
protected Properties getProps(String testName) {
Properties properties = CosmosEnv.getProperties(testName);
properties.setProperty(ConsensusCommitConfig.ISOLATION_LEVEL, "SERIALIZABLE");
return properties;
}

@Override
protected Map<String, String> getCreationOptions() {
return CosmosEnv.getCreationOptions();
}

@Test
@Override
@Disabled("Cross partition scan with ordering is not supported in Cosmos DB")
public void scan_CrossPartitionScanWithOrderingGivenForCommittedRecord_ShouldReturnRecords() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.scalar.db.storage.cosmos;

import com.scalar.db.api.DistributedStorageCrossPartitionScanIntegrationTestBase;
import java.util.Map;
import java.util.Properties;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

public class CosmosCrossPartitionScanIntegrationTest
extends DistributedStorageCrossPartitionScanIntegrationTestBase {

@Override
protected Properties getProperties(String testName) {
return CosmosEnv.getProperties(testName);
}

@Override
protected Map<String, String> getCreationOptions() {
return CosmosEnv.getCreationOptions();
}

@Test
@Override
@Disabled("Cross partition scan with ordering is not supported in Cosmos DB")
public void scan_WithOrderingForNonPrimaryColumns_ShouldReturnProperResult() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static Properties getProperties(String testName) {
properties.setProperty(DatabaseConfig.PASSWORD, password);
properties.setProperty(DatabaseConfig.STORAGE, "cosmos");
properties.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN, "true");
properties.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN_FILTERING, "false");
properties.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN_FILTERING, "true");
properties.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN_ORDERING, "false");

if (databasePrefix.isPresent()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.scalar.db.storage.cosmos;

import com.scalar.db.transaction.consensuscommit.ConsensusCommitConfig;
import com.scalar.db.transaction.consensuscommit.TwoPhaseConsensusCommitCrossPartitionScanIntegrationTestBase;
import java.util.Map;
import java.util.Properties;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

public class TwoPhaseConsensusCommitCrossPartitionScanIntegrationTestWithCosmos
extends TwoPhaseConsensusCommitCrossPartitionScanIntegrationTestBase {

@Override
protected Properties getProps1(String testName) {
Properties properties = CosmosEnv.getProperties(testName);
properties.setProperty(ConsensusCommitConfig.ISOLATION_LEVEL, "SERIALIZABLE");
return properties;
}

@Override
protected Map<String, String> getCreationOptions() {
return CosmosEnv.getCreationOptions();
}

@Test
@Override
@Disabled("Cross partition scan with ordering is not supported in Cosmos DB")
public void scan_ScanWithOrderingGivenForCommittedRecord_ShouldReturnRecords() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.scalar.db.storage.dynamo;

import com.scalar.db.transaction.consensuscommit.ConsensusCommitConfig;
import com.scalar.db.transaction.consensuscommit.ConsensusCommitCrossPartitionScanIntegrationTestBase;
import java.util.Map;
import java.util.Properties;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

public class ConsensusCommitCrossPartitionScanIntegrationTestWithDynamo
extends ConsensusCommitCrossPartitionScanIntegrationTestBase {

@Override
protected Properties getProps(String testName) {
Properties properties = DynamoEnv.getProperties(testName);
properties.setProperty(ConsensusCommitConfig.ISOLATION_LEVEL, "SERIALIZABLE");
return properties;
}

@Override
protected Map<String, String> getCreationOptions() {
return DynamoEnv.getCreationOptions();
}

@Test
@Override
@Disabled("Cross partition scan with ordering is not supported in DynamoDB")
public void scan_CrossPartitionScanWithOrderingGivenForCommittedRecord_ShouldReturnRecords() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.scalar.db.storage.dynamo;

import com.scalar.db.api.DistributedStorageCrossPartitionScanIntegrationTestBase;
import java.util.Map;
import java.util.Properties;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

public class DynamoCrossPartitionScanIntegrationTest
extends DistributedStorageCrossPartitionScanIntegrationTestBase {

@Override
protected Properties getProperties(String testName) {
return DynamoEnv.getProperties(testName);
}

@Override
protected Map<String, String> getCreationOptions() {
return DynamoEnv.getCreationOptions();
}

@Test
@Override
@Disabled("Cross partition scan with ordering is not supported in DynamoDB")
public void scan_WithOrderingForNonPrimaryColumns_ShouldReturnProperResult() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static Properties getProperties(String testName) {
properties.setProperty(DatabaseConfig.PASSWORD, secretAccessKey);
properties.setProperty(DatabaseConfig.STORAGE, "dynamo");
properties.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN, "true");
properties.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN_FILTERING, "false");
properties.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN_FILTERING, "true");
properties.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN_ORDERING, "false");

// Add testName as a metadata namespace suffix
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.scalar.db.storage.dynamo;

import com.scalar.db.transaction.consensuscommit.ConsensusCommitConfig;
import com.scalar.db.transaction.consensuscommit.TwoPhaseConsensusCommitCrossPartitionScanIntegrationTestBase;
import java.util.Map;
import java.util.Properties;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

public class TwoPhaseConsensusCommitCrossPartitionScanIntegrationTestWithDynamo
extends TwoPhaseConsensusCommitCrossPartitionScanIntegrationTestBase {

@Override
protected Properties getProps1(String testName) {
Properties properties = DynamoEnv.getProperties(testName);
properties.setProperty(ConsensusCommitConfig.ISOLATION_LEVEL, "SERIALIZABLE");
return properties;
}

@Override
protected Map<String, String> getCreationOptions() {
return DynamoEnv.getCreationOptions();
}

@Test
@Override
@Disabled("Cross partition scan with ordering is not supported in DynamoDB")
public void scan_ScanWithOrderingGivenForCommittedRecord_ShouldReturnRecords() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected void initialize(String testName) throws Exception {

@Override
protected void waitForDifferentSessionDdl() {
if (rdbEngine instanceof RdbEngineYugabyte) {
if (JdbcTestUtils.isYugabyte(rdbEngine)) {
// This is needed to avoid schema or catalog version mismatch database errors.
Uninterruptibles.sleepUninterruptibly(1000, TimeUnit.MILLISECONDS);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ protected final void finalize() {}
public Map<String, TableMetadata> createExistingDatabaseWithAllDataTypes(String namespace)
throws SQLException {
execute(rdbEngine.createSchemaSqls(namespace));
if (rdbEngine instanceof RdbEngineMysql) {
if (JdbcTestUtils.isMysql(rdbEngine)) {
return createExistingMysqlDatabaseWithAllDataTypes(namespace);
} else if (rdbEngine instanceof RdbEnginePostgresql) {
} else if (JdbcTestUtils.isPostgresql(rdbEngine)) {
return createExistingPostgresDatabaseWithAllDataTypes(namespace);
} else if (rdbEngine instanceof RdbEngineOracle) {
} else if (JdbcTestUtils.isOracle(rdbEngine)) {
return createExistingOracleDatabaseWithAllDataTypes(namespace);
} else if (rdbEngine instanceof RdbEngineSqlServer) {
} else if (JdbcTestUtils.isSqlServer(rdbEngine)) {
return createExistingSqlServerDatabaseWithAllDataTypes(namespace);
} else {
throw new RuntimeException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected void initialize(String testName) throws Exception {

@Override
protected void waitForDifferentSessionDdl() {
if (rdbEngine instanceof RdbEngineYugabyte) {
if (JdbcTestUtils.isYugabyte(rdbEngine)) {
// This is needed to avoid schema or catalog version mismatch database errors.
Uninterruptibles.sleepUninterruptibly(1000, TimeUnit.MILLISECONDS);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,16 @@ public void dropNamespace(String namespace) throws SQLException {
@Override
public boolean namespaceExists(String namespace) throws SQLException {
String sql;
if (rdbEngine instanceof RdbEngineMysql) {
if (JdbcTestUtils.isMysql(rdbEngine)) {
sql = "SELECT 1 FROM information_schema.schemata WHERE schema_name = ?";
} else if (rdbEngine instanceof RdbEngineOracle) {
} else if (JdbcTestUtils.isOracle(rdbEngine)) {
sql = "SELECT 1 FROM all_users WHERE username = ?";
} else if (rdbEngine instanceof RdbEnginePostgresql) {
} else if (JdbcTestUtils.isPostgresql(rdbEngine)) {
sql = "SELECT 1 FROM pg_namespace WHERE nspname = ?";
} else if (rdbEngine instanceof RdbEngineSqlite) {
} else if (JdbcTestUtils.isSqlite(rdbEngine)) {
// SQLite has no concept of namespace
return true;
} else if (rdbEngine instanceof RdbEngineSqlServer) {
} else if (JdbcTestUtils.isSqlServer(rdbEngine)) {
sql = "SELECT 1 FROM sys.schemas WHERE name = ?";
} else {
throw new AssertionError("Unsupported engine : " + rdbEngine.getClass().getSimpleName());
Expand Down
Loading

0 comments on commit f2a51aa

Please sign in to comment.