Skip to content

Commit ed60372

Browse files
committed
Apply suggestions
1 parent c885ff8 commit ed60372

File tree

14 files changed

+61
-68
lines changed

14 files changed

+61
-68
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2122,8 +2122,8 @@ jobs:
21222122
name: tidb_8_5_integration_test_reports_${{ matrix.mode.label }}
21232123
path: core/build/reports/tests/integrationTestJdbc
21242124

2125-
integration-test-for-blob:
2126-
name: Azure Blob Storage integration test (${{ matrix.mode.label }})
2125+
integration-test-for-blob-storage:
2126+
name: Blob Storage integration test (${{ matrix.mode.label }})
21272127
runs-on: ubuntu-latest
21282128

21292129
strategy:

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ subprojects {
2828
slf4jVersion = '1.7.36'
2929
cassandraDriverVersion = '3.11.5'
3030
azureCosmosVersion = '4.75.0'
31-
azureBlobVersion = '12.31.3'
31+
azureBlobStorageVersion = '12.31.3'
3232
jooqVersion = '3.14.16'
3333
awssdkVersion = '2.36.2'
3434
commonsDbcp2Version = '2.13.0'

core/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ dependencies {
169169
implementation "org.slf4j:slf4j-api:${slf4jVersion}"
170170
implementation "com.datastax.cassandra:cassandra-driver-core:${cassandraDriverVersion}"
171171
implementation "com.azure:azure-cosmos:${azureCosmosVersion}"
172-
implementation "com.azure:azure-storage-blob:${azureBlobVersion}"
172+
implementation "com.azure:azure-storage-blob:${azureBlobStorageVersion}"
173173
implementation "org.jooq:jooq:${jooqVersion}"
174174
implementation platform("software.amazon.awssdk:bom:${awssdkVersion}")
175175
implementation 'software.amazon.awssdk:applicationautoscaling'

core/src/integration-test/java/com/scalar/db/storage/objectstorage/BlobWrapperIntegrationTest.java

Lines changed: 0 additions & 11 deletions
This file was deleted.

core/src/integration-test/java/com/scalar/db/storage/objectstorage/ObjectStorageEnv.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.scalar.db.storage.objectstorage;
22

33
import com.scalar.db.config.DatabaseConfig;
4-
import com.scalar.db.storage.objectstorage.blob.BlobConfig;
4+
import com.scalar.db.storage.objectstorage.blobstorage.BlobStorageConfig;
55
import java.util.Collections;
66
import java.util.Map;
77
import java.util.Properties;
@@ -30,7 +30,7 @@ public static Properties getProperties(String testName) {
3030
properties.setProperty(DatabaseConfig.CONTACT_POINTS, endpoint);
3131
properties.setProperty(DatabaseConfig.USERNAME, accountName);
3232
properties.setProperty(DatabaseConfig.PASSWORD, accountKey);
33-
properties.setProperty(DatabaseConfig.STORAGE, BlobConfig.STORAGE_NAME);
33+
properties.setProperty(DatabaseConfig.STORAGE, BlobStorageConfig.STORAGE_NAME);
3434
properties.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN, "true");
3535
properties.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN_FILTERING, "true");
3636
properties.setProperty(DatabaseConfig.CROSS_PARTITION_SCAN_ORDERING, "false");

core/src/integration-test/java/com/scalar/db/storage/objectstorage/ObjectStorageWrapperIntegrationTestBase.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import org.slf4j.LoggerFactory;
1616

1717
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
18-
public abstract class ObjectStorageWrapperIntegrationTestBase {
18+
public class ObjectStorageWrapperIntegrationTestBase {
1919
private static final Logger logger =
2020
LoggerFactory.getLogger(ObjectStorageWrapperIntegrationTestBase.class);
2121

@@ -56,7 +56,9 @@ public void afterAll() {
5656
}
5757
}
5858

59-
protected abstract Properties getProperties(String testName);
59+
protected Properties getProperties(String testName) {
60+
return ObjectStorageEnv.getProperties(testName);
61+
}
6062

6163
private void createObjects() throws ObjectStorageWrapperException {
6264
wrapper.insert(TEST_KEY1, TEST_OBJECT1);

core/src/main/java/com/scalar/db/storage/objectstorage/ObjectStorageUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.scalar.db.storage.objectstorage;
22

33
import com.scalar.db.config.DatabaseConfig;
4-
import com.scalar.db.storage.objectstorage.blob.BlobConfig;
4+
import com.scalar.db.storage.objectstorage.blobstorage.BlobStorageConfig;
55
import java.util.Objects;
66

77
public class ObjectStorageUtils {
@@ -17,8 +17,8 @@ public static String getObjectKey(String namespace, String table) {
1717
}
1818

1919
public static ObjectStorageConfig getObjectStorageConfig(DatabaseConfig databaseConfig) {
20-
if (Objects.equals(databaseConfig.getStorage(), BlobConfig.STORAGE_NAME)) {
21-
return new BlobConfig(databaseConfig);
20+
if (Objects.equals(databaseConfig.getStorage(), BlobStorageConfig.STORAGE_NAME)) {
21+
return new BlobStorageConfig(databaseConfig);
2222
} else {
2323
throw new IllegalArgumentException(
2424
"Unsupported Object Storage: " + databaseConfig.getStorage());

core/src/main/java/com/scalar/db/storage/objectstorage/ObjectStorageWrapperFactory.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package com.scalar.db.storage.objectstorage;
22

3-
import com.scalar.db.storage.objectstorage.blob.BlobConfig;
4-
import com.scalar.db.storage.objectstorage.blob.BlobWrapper;
3+
import com.scalar.db.storage.objectstorage.blobstorage.BlobStorageConfig;
4+
import com.scalar.db.storage.objectstorage.blobstorage.BlobStorageWrapper;
55
import java.util.Objects;
66

77
public class ObjectStorageWrapperFactory {
88

99
public static ObjectStorageWrapper create(ObjectStorageConfig objectStorageConfig) {
10-
if (Objects.equals(objectStorageConfig.getStorageName(), BlobConfig.STORAGE_NAME)) {
11-
assert objectStorageConfig instanceof BlobConfig;
12-
return new BlobWrapper((BlobConfig) objectStorageConfig);
10+
if (Objects.equals(objectStorageConfig.getStorageName(), BlobStorageConfig.STORAGE_NAME)) {
11+
assert objectStorageConfig instanceof BlobStorageConfig;
12+
return new BlobStorageWrapper((BlobStorageConfig) objectStorageConfig);
1313
} else {
1414
throw new IllegalArgumentException(
1515
"Unsupported Object Storage: " + objectStorageConfig.getStorageName());

core/src/main/java/com/scalar/db/storage/objectstorage/blob/BlobProvider.java

Lines changed: 0 additions & 11 deletions
This file was deleted.

core/src/main/java/com/scalar/db/storage/objectstorage/blob/BlobConfig.java renamed to core/src/main/java/com/scalar/db/storage/objectstorage/blobstorage/BlobStorageConfig.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.scalar.db.storage.objectstorage.blob;
1+
package com.scalar.db.storage.objectstorage.blobstorage;
22

33
import static com.scalar.db.config.ConfigUtils.getInt;
44
import static com.scalar.db.config.ConfigUtils.getLong;
@@ -10,8 +10,8 @@
1010
import org.slf4j.Logger;
1111
import org.slf4j.LoggerFactory;
1212

13-
public class BlobConfig implements ObjectStorageConfig {
14-
public static final String STORAGE_NAME = "blob";
13+
public class BlobStorageConfig implements ObjectStorageConfig {
14+
public static final String STORAGE_NAME = "blob-storage";
1515
public static final String PREFIX = DatabaseConfig.PREFIX + STORAGE_NAME + ".";
1616

1717
public static final String PARALLEL_UPLOAD_BLOCK_SIZE_IN_BYTES =
@@ -31,7 +31,7 @@ public class BlobConfig implements ObjectStorageConfig {
3131
public static final long DEFAULT_PARALLEL_UPLOAD_THRESHOLD_IN_BYTES = 4 * 1024 * 1024; // 4MB
3232
public static final int DEFAULT_REQUEST_TIMEOUT_IN_SECONDS = 15;
3333

34-
private static final Logger logger = LoggerFactory.getLogger(BlobConfig.class);
34+
private static final Logger logger = LoggerFactory.getLogger(BlobStorageConfig.class);
3535
private final String endpoint;
3636
private final String username;
3737
private final String password;
@@ -43,7 +43,7 @@ public class BlobConfig implements ObjectStorageConfig {
4343
private final long parallelUploadThresholdInBytes;
4444
private final int requestTimeoutInSeconds;
4545

46-
public BlobConfig(DatabaseConfig databaseConfig) {
46+
public BlobStorageConfig(DatabaseConfig databaseConfig) {
4747
String storage = databaseConfig.getStorage();
4848
if (!storage.equals(STORAGE_NAME)) {
4949
throw new IllegalArgumentException(
@@ -82,7 +82,7 @@ public BlobConfig(DatabaseConfig databaseConfig) {
8282
logger.warn(
8383
"The configuration property \""
8484
+ DatabaseConfig.SCAN_FETCH_SIZE
85-
+ "\" is not applicable to Blob storage and will be ignored.");
85+
+ "\" is not applicable to Blob Storage and will be ignored.");
8686
}
8787

8888
parallelUploadBlockSizeInBytes =

0 commit comments

Comments
 (0)