From f333f92b0d86374ffdb62c54d1ca9e52eaa592ad Mon Sep 17 00:00:00 2001 From: Mitsunori Komatsu Date: Tue, 18 Jun 2024 14:52:42 +0900 Subject: [PATCH 1/2] Remove "scalardb.cosmos.database_prefix" property --- ...sCommitAdminIntegrationTestWithCosmos.java | 8 ------ ...tAdminRepairIntegrationTestWithCosmos.java | 11 -------- ...artitionScanIntegrationTestWithCosmos.java | 8 ------ ...sensusCommitIntegrationTestWithCosmos.java | 8 ------ ...NullMetadataIntegrationTestWithCosmos.java | 16 ----------- ...mmitSpecificIntegrationTestWithCosmos.java | 16 ----------- ...adataEnabledIntegrationTestWithCosmos.java | 8 ------ .../cosmos/CosmosAdminIntegrationTest.java | 21 -------------- .../CosmosAdminRepairIntegrationTest.java | 11 -------- .../CosmosColumnValueIntegrationTest.java | 8 ------ ...mosConditionalMutationIntegrationTest.java | 8 ------ ...smosCrossPartitionScanIntegrationTest.java | 8 ------ .../scalar/db/storage/cosmos/CosmosEnv.java | 28 +++---------------- .../storage/cosmos/CosmosIntegrationTest.java | 8 ------ .../cosmos/CosmosJapaneseIntegrationTest.java | 8 ------ ...tipleClusteringKeyScanIntegrationTest.java | 8 ------ ...osMultiplePartitionKeyIntegrationTest.java | 8 ------ .../CosmosSchemaLoaderIntegrationTest.java | 16 ----------- .../CosmosSecondaryIndexIntegrationTest.java | 8 ------ ...ingleClusteringKeyScanIntegrationTest.java | 8 ------ ...smosSinglePartitionKeyIntegrationTest.java | 8 ------ ...mosWithReservedKeywordIntegrationTest.java | 5 +--- ...sactionAdminIntegrationTestWithCosmos.java | 8 ------ ...nTransactionIntegrationTestWithCosmos.java | 8 ------ ...sensusCommitIntegrationTestWithCosmos.java | 8 ------ ...mmitSpecificIntegrationTestWithCosmos.java | 16 ----------- ...adataEnabledIntegrationTestWithCosmos.java | 8 ------ 27 files changed, 5 insertions(+), 279 deletions(-) diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitAdminIntegrationTestWithCosmos.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitAdminIntegrationTestWithCosmos.java index ebf8751f8e..b372b419fb 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitAdminIntegrationTestWithCosmos.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitAdminIntegrationTestWithCosmos.java @@ -3,7 +3,6 @@ import com.scalar.db.transaction.consensuscommit.ConsensusCommitAdminIntegrationTestBase; import com.scalar.db.util.AdminTestUtils; import java.util.Map; -import java.util.Optional; import java.util.Properties; public class ConsensusCommitAdminIntegrationTestWithCosmos @@ -14,13 +13,6 @@ protected Properties getProps(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespaceBaseName() { - String namespaceBaseName = super.getNamespaceBaseName(); - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespaceBaseName).orElse(namespaceBaseName); - } - @Override protected Map getCreationOptions() { return CosmosEnv.getCreationOptions(); diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitAdminRepairIntegrationTestWithCosmos.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitAdminRepairIntegrationTestWithCosmos.java index 4ee1229f06..4831239269 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitAdminRepairIntegrationTestWithCosmos.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitAdminRepairIntegrationTestWithCosmos.java @@ -5,7 +5,6 @@ import com.scalar.db.exception.storage.ExecutionException; import com.scalar.db.transaction.consensuscommit.ConsensusCommitAdminRepairIntegrationTestBase; import java.util.Map; -import java.util.Optional; import java.util.Properties; import org.junit.jupiter.api.Test; @@ -17,16 +16,6 @@ protected Properties getProps(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespace() { - return getNamespace(super.getNamespace()); - } - - private String getNamespace(String namespace) { - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespace).orElse(namespace); - } - @Override protected Map getCreationOptions() { return CosmosEnv.getCreationOptions(); diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitCrossPartitionScanIntegrationTestWithCosmos.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitCrossPartitionScanIntegrationTestWithCosmos.java index 3ad6f3f401..73f6ba7578 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitCrossPartitionScanIntegrationTestWithCosmos.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitCrossPartitionScanIntegrationTestWithCosmos.java @@ -3,7 +3,6 @@ import com.scalar.db.transaction.consensuscommit.ConsensusCommitConfig; import com.scalar.db.transaction.consensuscommit.ConsensusCommitCrossPartitionScanIntegrationTestBase; import java.util.Map; -import java.util.Optional; import java.util.Properties; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -18,13 +17,6 @@ protected Properties getProps(String testName) { return properties; } - @Override - protected String getNamespaceBaseName() { - String namespaceBaseName = super.getNamespaceBaseName(); - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespaceBaseName).orElse(namespaceBaseName); - } - @Override protected Map getCreationOptions() { return CosmosEnv.getCreationOptions(); diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitIntegrationTestWithCosmos.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitIntegrationTestWithCosmos.java index 81eece0ae2..f996084c2e 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitIntegrationTestWithCosmos.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitIntegrationTestWithCosmos.java @@ -2,7 +2,6 @@ import com.scalar.db.transaction.consensuscommit.ConsensusCommitIntegrationTestBase; import java.util.Map; -import java.util.Optional; import java.util.Properties; public class ConsensusCommitIntegrationTestWithCosmos extends ConsensusCommitIntegrationTestBase { @@ -12,13 +11,6 @@ protected Properties getProps(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespaceBaseName() { - String namespaceBaseName = super.getNamespaceBaseName(); - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespaceBaseName).orElse(namespaceBaseName); - } - @Override protected Map getCreationOptions() { return CosmosEnv.getCreationOptions(); diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitNullMetadataIntegrationTestWithCosmos.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitNullMetadataIntegrationTestWithCosmos.java index 283b34d0cf..67ec283275 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitNullMetadataIntegrationTestWithCosmos.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitNullMetadataIntegrationTestWithCosmos.java @@ -2,7 +2,6 @@ import com.scalar.db.transaction.consensuscommit.ConsensusCommitNullMetadataIntegrationTestBase; import java.util.Map; -import java.util.Optional; import java.util.Properties; public class ConsensusCommitNullMetadataIntegrationTestWithCosmos @@ -13,21 +12,6 @@ protected Properties getProperties(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespace1() { - return getNamespace(super.getNamespace1()); - } - - @Override - protected String getNamespace2() { - return getNamespace(super.getNamespace2()); - } - - private String getNamespace(String namespace) { - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespace).orElse(namespace); - } - @Override protected Map getCreationOptions() { return CosmosEnv.getCreationOptions(); diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitSpecificIntegrationTestWithCosmos.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitSpecificIntegrationTestWithCosmos.java index 6e2d42de3d..7cc70a3544 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitSpecificIntegrationTestWithCosmos.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitSpecificIntegrationTestWithCosmos.java @@ -2,7 +2,6 @@ import com.scalar.db.transaction.consensuscommit.ConsensusCommitSpecificIntegrationTestBase; import java.util.Map; -import java.util.Optional; import java.util.Properties; public class ConsensusCommitSpecificIntegrationTestWithCosmos @@ -13,21 +12,6 @@ protected Properties getProperties(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespace1() { - return getNamespace(super.getNamespace1()); - } - - @Override - protected String getNamespace2() { - return getNamespace(super.getNamespace2()); - } - - private String getNamespace(String namespace) { - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespace).orElse(namespace); - } - @Override protected Map getCreationOptions() { return CosmosEnv.getCreationOptions(); diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitWithIncludeMetadataEnabledIntegrationTestWithCosmos.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitWithIncludeMetadataEnabledIntegrationTestWithCosmos.java index fc2c35bed6..241b637217 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitWithIncludeMetadataEnabledIntegrationTestWithCosmos.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitWithIncludeMetadataEnabledIntegrationTestWithCosmos.java @@ -2,7 +2,6 @@ import com.scalar.db.transaction.consensuscommit.ConsensusCommitWithIncludeMetadataEnabledIntegrationTestBase; import java.util.Map; -import java.util.Optional; import java.util.Properties; public class ConsensusCommitWithIncludeMetadataEnabledIntegrationTestWithCosmos @@ -13,13 +12,6 @@ protected Properties getProperties(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespace() { - String namespace = super.getNamespace(); - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespace).orElse(namespace); - } - @Override protected Map getCreationOptions() { return CosmosEnv.getCreationOptions(); diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosAdminIntegrationTest.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosAdminIntegrationTest.java index 6b051f9b78..03c2fbf59a 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosAdminIntegrationTest.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosAdminIntegrationTest.java @@ -3,7 +3,6 @@ import com.scalar.db.api.DistributedStorageAdminIntegrationTestBase; import com.scalar.db.util.AdminTestUtils; import java.util.Map; -import java.util.Optional; import java.util.Properties; public class CosmosAdminIntegrationTest extends DistributedStorageAdminIntegrationTestBase { @@ -13,26 +12,6 @@ protected Properties getProperties(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespace1() { - return getNamespace(super.getNamespace1()); - } - - @Override - protected String getNamespace2() { - return getNamespace(super.getNamespace2()); - } - - @Override - protected String getNamespace3() { - return getNamespace(super.getNamespace3()); - } - - private String getNamespace(String namespace) { - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespace).orElse(namespace); - } - @Override protected Map getCreationOptions() { return CosmosEnv.getCreationOptions(); diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosAdminRepairIntegrationTest.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosAdminRepairIntegrationTest.java index a5c734626e..039f934aa2 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosAdminRepairIntegrationTest.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosAdminRepairIntegrationTest.java @@ -5,7 +5,6 @@ import com.scalar.db.api.DistributedStorageAdminRepairIntegrationTestBase; import com.scalar.db.exception.storage.ExecutionException; import java.util.Map; -import java.util.Optional; import java.util.Properties; import org.junit.jupiter.api.Test; @@ -17,16 +16,6 @@ protected Properties getProperties(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespace() { - return getNamespace(super.getNamespace()); - } - - private String getNamespace(String namespace) { - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespace).orElse(namespace); - } - @Override protected Map getCreationOptions() { return CosmosEnv.getCreationOptions(); diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosColumnValueIntegrationTest.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosColumnValueIntegrationTest.java index f7513204da..5aa6648f9e 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosColumnValueIntegrationTest.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosColumnValueIntegrationTest.java @@ -2,7 +2,6 @@ import com.scalar.db.api.DistributedStorageColumnValueIntegrationTestBase; import java.util.Map; -import java.util.Optional; import java.util.Properties; public class CosmosColumnValueIntegrationTest @@ -12,13 +11,6 @@ protected Properties getProperties(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespace() { - String namespace = super.getNamespace(); - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespace).orElse(namespace); - } - @Override protected Map getCreationOptions() { return CosmosEnv.getCreationOptions(); diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosConditionalMutationIntegrationTest.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosConditionalMutationIntegrationTest.java index 5d6208de89..0d9fc650ad 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosConditionalMutationIntegrationTest.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosConditionalMutationIntegrationTest.java @@ -5,7 +5,6 @@ import com.scalar.db.io.DataType; import java.util.List; import java.util.Map; -import java.util.Optional; import java.util.Properties; import java.util.stream.Collectors; @@ -16,13 +15,6 @@ protected Properties getProperties(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespace() { - String namespace = super.getNamespace(); - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespace).orElse(namespace); - } - @Override protected int getThreadNum() { return 3; diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosCrossPartitionScanIntegrationTest.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosCrossPartitionScanIntegrationTest.java index bdfe5aeeef..49a4a8b55d 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosCrossPartitionScanIntegrationTest.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosCrossPartitionScanIntegrationTest.java @@ -2,7 +2,6 @@ import com.scalar.db.api.DistributedStorageCrossPartitionScanIntegrationTestBase; import java.util.Map; -import java.util.Optional; import java.util.Properties; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -15,13 +14,6 @@ protected Properties getProperties(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespaceBaseName() { - String namespaceBaseName = super.getNamespaceBaseName(); - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespaceBaseName).orElse(namespaceBaseName); - } - @Override protected Map getCreationOptions() { return CosmosEnv.getCreationOptions(); diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosEnv.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosEnv.java index ebf5238541..7fa1908ba1 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosEnv.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosEnv.java @@ -2,16 +2,12 @@ import com.google.common.collect.ImmutableMap; import com.scalar.db.config.DatabaseConfig; -import com.scalar.db.transaction.consensuscommit.ConsensusCommitConfig; -import com.scalar.db.transaction.consensuscommit.Coordinator; import java.util.Map; -import java.util.Optional; import java.util.Properties; public final class CosmosEnv { private static final String PROP_COSMOS_URI = "scalardb.cosmos.uri"; private static final String PROP_COSMOS_PASSWORD = "scalardb.cosmos.password"; - private static final String PROP_COSMOS_DATABASE_PREFIX = "scalardb.cosmos.database_prefix"; private static final String PROP_COSMOS_CREATE_OPTIONS = "scalardb.cosmos.create_options"; private static final ImmutableMap DEFAULT_COSMOS_CREATE_OPTIONS = @@ -22,7 +18,6 @@ private CosmosEnv() {} public static Properties getProperties(String testName) { String contactPoint = System.getProperty(PROP_COSMOS_URI); String password = System.getProperty(PROP_COSMOS_PASSWORD); - Optional databasePrefix = getDatabasePrefix(); Properties properties = new Properties(); properties.setProperty(DatabaseConfig.CONTACT_POINTS, contactPoint); @@ -32,29 +27,14 @@ public static Properties getProperties(String testName) { properties.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN_FILTERING, "true"); properties.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN_ORDERING, "false"); - if (databasePrefix.isPresent()) { - // Add the prefix and testName as a metadata database suffix - properties.setProperty( - DatabaseConfig.SYSTEM_NAMESPACE_NAME, - databasePrefix.get() + DatabaseConfig.DEFAULT_SYSTEM_NAMESPACE_NAME + "_" + testName); - - properties.setProperty( - ConsensusCommitConfig.COORDINATOR_NAMESPACE, - databasePrefix.get() + Coordinator.NAMESPACE); - } else { - // Add testName as a metadata database suffix - properties.setProperty( - DatabaseConfig.SYSTEM_NAMESPACE_NAME, - DatabaseConfig.DEFAULT_SYSTEM_NAMESPACE_NAME + "_" + testName); - } + // Add testName as a metadata database suffix + properties.setProperty( + DatabaseConfig.SYSTEM_NAMESPACE_NAME, + DatabaseConfig.DEFAULT_SYSTEM_NAMESPACE_NAME + "_" + testName); return properties; } - public static Optional getDatabasePrefix() { - return Optional.ofNullable(System.getProperty(PROP_COSMOS_DATABASE_PREFIX)); - } - public static Map getCreationOptions() { String createOptionsString = System.getProperty(PROP_COSMOS_CREATE_OPTIONS); if (createOptionsString == null) { diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosIntegrationTest.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosIntegrationTest.java index 2fa4f46afc..797ecad64d 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosIntegrationTest.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosIntegrationTest.java @@ -2,7 +2,6 @@ import com.scalar.db.api.DistributedStorageIntegrationTestBase; import java.util.Map; -import java.util.Optional; import java.util.Properties; public class CosmosIntegrationTest extends DistributedStorageIntegrationTestBase { @@ -12,13 +11,6 @@ protected Properties getProperties(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespace() { - String namespace = super.getNamespace(); - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespace).orElse(namespace); - } - @Override protected Map getCreationOptions() { return CosmosEnv.getCreationOptions(); diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosJapaneseIntegrationTest.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosJapaneseIntegrationTest.java index 9c6001f10d..99975855a1 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosJapaneseIntegrationTest.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosJapaneseIntegrationTest.java @@ -2,7 +2,6 @@ import com.scalar.db.api.DistributedStorageJapaneseIntegrationTestBase; import java.util.Map; -import java.util.Optional; import java.util.Properties; public class CosmosJapaneseIntegrationTest extends DistributedStorageJapaneseIntegrationTestBase { @@ -12,13 +11,6 @@ protected Properties getProperties(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespace() { - String namespace = super.getNamespace(); - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespace).orElse(namespace); - } - @Override protected Map getCreationOptions() { return CosmosEnv.getCreationOptions(); diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosMultipleClusteringKeyScanIntegrationTest.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosMultipleClusteringKeyScanIntegrationTest.java index fe6be83529..4c5319e830 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosMultipleClusteringKeyScanIntegrationTest.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosMultipleClusteringKeyScanIntegrationTest.java @@ -5,7 +5,6 @@ import com.scalar.db.api.DistributedStorageMultipleClusteringKeyScanIntegrationTestBase; import com.scalar.db.io.DataType; import java.util.Map; -import java.util.Optional; import java.util.Properties; public class CosmosMultipleClusteringKeyScanIntegrationTest @@ -16,13 +15,6 @@ protected Properties getProperties(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespaceBaseName() { - String namespaceBaseName = super.getNamespaceBaseName(); - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespaceBaseName).orElse(namespaceBaseName); - } - @Override protected ListMultimap getClusteringKeyTypes() { // Return types without BLOB because blob is not supported for clustering key for now diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosMultiplePartitionKeyIntegrationTest.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosMultiplePartitionKeyIntegrationTest.java index 3cff4464e6..000a2d0958 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosMultiplePartitionKeyIntegrationTest.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosMultiplePartitionKeyIntegrationTest.java @@ -2,7 +2,6 @@ import com.scalar.db.api.DistributedStorageMultiplePartitionKeyIntegrationTestBase; import java.util.Map; -import java.util.Optional; import java.util.Properties; public class CosmosMultiplePartitionKeyIntegrationTest @@ -12,13 +11,6 @@ protected Properties getProperties(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespaceBaseName() { - String namespaceBaseName = super.getNamespaceBaseName(); - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespaceBaseName).orElse(namespaceBaseName); - } - @Override protected int getThreadNum() { return 3; diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosSchemaLoaderIntegrationTest.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosSchemaLoaderIntegrationTest.java index 490795e609..78d2998252 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosSchemaLoaderIntegrationTest.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosSchemaLoaderIntegrationTest.java @@ -2,7 +2,6 @@ import com.scalar.db.schemaloader.SchemaLoaderIntegrationTestBase; import com.scalar.db.util.AdminTestUtils; -import java.util.Optional; import java.util.Properties; public class CosmosSchemaLoaderIntegrationTest extends SchemaLoaderIntegrationTestBase { @@ -12,21 +11,6 @@ protected Properties getProperties(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespace1() { - return getNamespace(super.getNamespace1()); - } - - @Override - protected String getNamespace2() { - return getNamespace(super.getNamespace2()); - } - - private String getNamespace(String namespace) { - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespace).orElse(namespace); - } - @Override protected AdminTestUtils getAdminTestUtils(String testName) { return new CosmosAdminTestUtils(getProperties(testName)); diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosSecondaryIndexIntegrationTest.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosSecondaryIndexIntegrationTest.java index 4fa96b9b00..e021b487ca 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosSecondaryIndexIntegrationTest.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosSecondaryIndexIntegrationTest.java @@ -2,7 +2,6 @@ import com.scalar.db.api.DistributedStorageSecondaryIndexIntegrationTestBase; import java.util.Map; -import java.util.Optional; import java.util.Properties; public class CosmosSecondaryIndexIntegrationTest @@ -12,13 +11,6 @@ protected Properties getProperties(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespace() { - String namespace = super.getNamespace(); - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespace).orElse(namespace); - } - @Override protected Map getCreationOptions() { return CosmosEnv.getCreationOptions(); diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosSingleClusteringKeyScanIntegrationTest.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosSingleClusteringKeyScanIntegrationTest.java index 5fee773aff..c3e77f4c1a 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosSingleClusteringKeyScanIntegrationTest.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosSingleClusteringKeyScanIntegrationTest.java @@ -4,7 +4,6 @@ import com.scalar.db.io.DataType; import java.util.HashSet; import java.util.Map; -import java.util.Optional; import java.util.Properties; import java.util.Set; @@ -15,13 +14,6 @@ protected Properties getProperties(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespace() { - String namespace = super.getNamespace(); - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespace).orElse(namespace); - } - @Override protected Set getClusteringKeyTypes() { // Return types without BLOB because blob is not supported for clustering key for now diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosSinglePartitionKeyIntegrationTest.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosSinglePartitionKeyIntegrationTest.java index e959fa7f28..82c81e1c23 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosSinglePartitionKeyIntegrationTest.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosSinglePartitionKeyIntegrationTest.java @@ -2,7 +2,6 @@ import com.scalar.db.api.DistributedStorageSinglePartitionKeyIntegrationTestBase; import java.util.Map; -import java.util.Optional; import java.util.Properties; public class CosmosSinglePartitionKeyIntegrationTest @@ -12,13 +11,6 @@ protected Properties getProperties(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespace() { - String namespace = super.getNamespace(); - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespace).orElse(namespace); - } - @Override protected Map getCreationOptions() { return CosmosEnv.getCreationOptions(); diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosWithReservedKeywordIntegrationTest.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosWithReservedKeywordIntegrationTest.java index 0a368f5c75..cbae4c4982 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosWithReservedKeywordIntegrationTest.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosWithReservedKeywordIntegrationTest.java @@ -2,7 +2,6 @@ import com.scalar.db.api.DistributedStorageWithReservedKeywordIntegrationTestBase; import java.util.Map; -import java.util.Optional; import java.util.Properties; public class CosmosWithReservedKeywordIntegrationTest @@ -15,9 +14,7 @@ protected Properties getProperties(String testName) { @Override protected String getNamespace() { - String namespace = "reserved_keyword_test"; - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespace).orElse(namespace); + return "reserved_keyword_test"; } @Override diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/SingleCrudOperationTransactionAdminIntegrationTestWithCosmos.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/SingleCrudOperationTransactionAdminIntegrationTestWithCosmos.java index f08010fec6..e9b37a9ea4 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/SingleCrudOperationTransactionAdminIntegrationTestWithCosmos.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/SingleCrudOperationTransactionAdminIntegrationTestWithCosmos.java @@ -2,7 +2,6 @@ import com.scalar.db.transaction.singlecrudoperation.SingleCrudOperationTransactionAdminIntegrationTestBase; import java.util.Map; -import java.util.Optional; import java.util.Properties; public class SingleCrudOperationTransactionAdminIntegrationTestWithCosmos @@ -13,13 +12,6 @@ protected Properties getProps(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespaceBaseName() { - String namespaceBaseName = super.getNamespaceBaseName(); - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespaceBaseName).orElse(namespaceBaseName); - } - @Override protected Map getCreationOptions() { return CosmosEnv.getCreationOptions(); diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/SingleCrudOperationTransactionIntegrationTestWithCosmos.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/SingleCrudOperationTransactionIntegrationTestWithCosmos.java index 372c054660..85ac7dcc3a 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/SingleCrudOperationTransactionIntegrationTestWithCosmos.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/SingleCrudOperationTransactionIntegrationTestWithCosmos.java @@ -2,7 +2,6 @@ import com.scalar.db.transaction.singlecrudoperation.SingleCrudOperationTransactionIntegrationTestBase; import java.util.Map; -import java.util.Optional; import java.util.Properties; public class SingleCrudOperationTransactionIntegrationTestWithCosmos @@ -13,13 +12,6 @@ protected Properties getProps(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespaceBaseName() { - String namespaceBaseName = super.getNamespaceBaseName(); - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespaceBaseName).orElse(namespaceBaseName); - } - @Override protected Map getCreationOptions() { return CosmosEnv.getCreationOptions(); diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/TwoPhaseConsensusCommitIntegrationTestWithCosmos.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/TwoPhaseConsensusCommitIntegrationTestWithCosmos.java index 42c04f4c98..76c13a37a7 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/TwoPhaseConsensusCommitIntegrationTestWithCosmos.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/TwoPhaseConsensusCommitIntegrationTestWithCosmos.java @@ -2,7 +2,6 @@ import com.scalar.db.transaction.consensuscommit.TwoPhaseConsensusCommitIntegrationTestBase; import java.util.Map; -import java.util.Optional; import java.util.Properties; public class TwoPhaseConsensusCommitIntegrationTestWithCosmos @@ -13,13 +12,6 @@ protected Properties getProps1(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespaceBaseName() { - String namespaceBaseName = super.getNamespaceBaseName(); - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespaceBaseName).orElse(namespaceBaseName); - } - @Override protected Map getCreationOptions() { return CosmosEnv.getCreationOptions(); diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/TwoPhaseConsensusCommitSpecificIntegrationTestWithCosmos.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/TwoPhaseConsensusCommitSpecificIntegrationTestWithCosmos.java index 086ce2a161..6059c3d3d5 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/TwoPhaseConsensusCommitSpecificIntegrationTestWithCosmos.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/TwoPhaseConsensusCommitSpecificIntegrationTestWithCosmos.java @@ -2,7 +2,6 @@ import com.scalar.db.transaction.consensuscommit.TwoPhaseConsensusCommitSpecificIntegrationTestBase; import java.util.Map; -import java.util.Optional; import java.util.Properties; public class TwoPhaseConsensusCommitSpecificIntegrationTestWithCosmos @@ -13,21 +12,6 @@ protected Properties getProperties1(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespace1() { - return getNamespace(super.getNamespace1()); - } - - @Override - protected String getNamespace2() { - return getNamespace(super.getNamespace2()); - } - - private String getNamespace(String namespace) { - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespace).orElse(namespace); - } - @Override protected Map getCreationOptions() { return CosmosEnv.getCreationOptions(); diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/TwoPhaseConsensusCommitWithIncludeMetadataEnabledIntegrationTestWithCosmos.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/TwoPhaseConsensusCommitWithIncludeMetadataEnabledIntegrationTestWithCosmos.java index 38179d0928..b3cba27d43 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/TwoPhaseConsensusCommitWithIncludeMetadataEnabledIntegrationTestWithCosmos.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/TwoPhaseConsensusCommitWithIncludeMetadataEnabledIntegrationTestWithCosmos.java @@ -2,7 +2,6 @@ import com.scalar.db.transaction.consensuscommit.TwoPhaseConsensusCommitWithIncludeMetadataEnabledIntegrationTestBase; import java.util.Map; -import java.util.Optional; import java.util.Properties; public class TwoPhaseConsensusCommitWithIncludeMetadataEnabledIntegrationTestWithCosmos @@ -13,13 +12,6 @@ protected Properties getProperties(String testName) { return CosmosEnv.getProperties(testName); } - @Override - protected String getNamespace() { - String namespace = super.getNamespace(); - Optional databasePrefix = CosmosEnv.getDatabasePrefix(); - return databasePrefix.map(prefix -> prefix + namespace).orElse(namespace); - } - @Override protected Map getCreationOptions() { return CosmosEnv.getCreationOptions(); From 5bde079246a02f91e46c04e6b2117ec7d8830be8 Mon Sep 17 00:00:00 2001 From: Mitsunori Komatsu Date: Thu, 20 Jun 2024 09:49:50 +0900 Subject: [PATCH 2/2] Fix compile error --- .../scalar/db/storage/cosmos/ConsensusCommitCosmosEnv.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitCosmosEnv.java b/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitCosmosEnv.java index 8f094876e7..17aa015dc1 100644 --- a/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitCosmosEnv.java +++ b/core/src/integration-test/java/com/scalar/db/storage/cosmos/ConsensusCommitCosmosEnv.java @@ -2,7 +2,6 @@ import com.scalar.db.common.ConsensusCommitTestUtils; import java.util.Map; -import java.util.Optional; import java.util.Properties; public final class ConsensusCommitCosmosEnv { @@ -13,10 +12,6 @@ public static Properties getProperties(String testName) { return ConsensusCommitTestUtils.loadConsensusCommitProperties(properties); } - public static Optional getDatabasePrefix() { - return CosmosEnv.getDatabasePrefix(); - } - public static Map getCreationOptions() { return CosmosEnv.getCreationOptions(); }