Skip to content

Commit 0ccc67b

Browse files
committed
Merge branch 'master' into feat/data-loader/import-replace-storage
2 parents 7502fe8 + ba20b01 commit 0ccc67b

File tree

77 files changed

+7603
-83
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+7603
-83
lines changed

.github/workflows/ci.yaml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,136 @@ jobs:
254254
name: cassandra_3.11_integration_test_reports_${{ matrix.mode.label }}
255255
path: core/build/reports/tests/integrationTestCassandra
256256

257+
integration-test-for-cassandra-4-1:
258+
name: Cassandra 4.1 integration test (${{ matrix.mode.label }})
259+
runs-on: ubuntu-latest
260+
261+
services:
262+
cassandra:
263+
image: cassandra:4.1
264+
env:
265+
MAX_HEAP_SIZE: 2048m
266+
HEAP_NEWSIZE: 512m
267+
ports:
268+
- 9042:9042
269+
270+
strategy:
271+
fail-fast: false
272+
matrix:
273+
mode:
274+
- label: default
275+
group_commit_enabled: false
276+
- label: with_group_commit
277+
group_commit_enabled: true
278+
279+
steps:
280+
- uses: actions/checkout@v5
281+
282+
- name: Set up JDK ${{ env.JAVA_VERSION }} (${{ env.JAVA_VENDOR }})
283+
uses: actions/setup-java@v5
284+
with:
285+
java-version: ${{ env.JAVA_VERSION }}
286+
distribution: ${{ env.JAVA_VENDOR }}
287+
288+
- name: Set up JDK ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }} (${{ env.INT_TEST_JAVA_RUNTIME_VENDOR }}) to run integration test
289+
uses: actions/setup-java@v5
290+
if: ${{ env.SET_UP_INT_TEST_RUNTIME_NON_ORACLE_JDK == 'true'}}
291+
with:
292+
java-version: ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }}
293+
distribution: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR }}
294+
295+
- name: Login to Oracle container registry
296+
uses: docker/login-action@v3
297+
if: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR == 'oracle' }}
298+
with:
299+
registry: container-registry.oracle.com
300+
username: ${{ secrets.OCR_USERNAME }}
301+
password: ${{ secrets.OCR_TOKEN }}
302+
303+
- name: Set up JDK ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }} (oracle) to run the integration test
304+
if: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR == 'oracle' }}
305+
run: |
306+
container_id=$(docker create "container-registry.oracle.com/java/jdk:${{ env.INT_TEST_JAVA_RUNTIME_VERSION }}")
307+
docker cp -L "$container_id:/usr/java/default" /usr/lib/jvm/oracle-jdk && docker rm "$container_id"
308+
309+
- name: Setup Gradle
310+
uses: gradle/actions/setup-gradle@v5
311+
312+
- name: Execute Gradle 'integrationTestCassandra' task
313+
run: ./gradlew integrationTestCassandra ${{ matrix.mode.group_commit_enabled && env.INT_TEST_GRADLE_OPTIONS_FOR_GROUP_COMMIT || '' }}
314+
315+
- name: Upload Gradle test reports
316+
if: always()
317+
uses: actions/upload-artifact@v5
318+
with:
319+
name: cassandra_4.1_integration_test_reports_${{ matrix.mode.label }}
320+
path: core/build/reports/tests/integrationTestCassandra
321+
322+
integration-test-for-cassandra-5-0:
323+
name: Cassandra 5.0 integration test (${{ matrix.mode.label }})
324+
runs-on: ubuntu-latest
325+
326+
services:
327+
cassandra:
328+
image: cassandra:5.0
329+
env:
330+
MAX_HEAP_SIZE: 2048m
331+
HEAP_NEWSIZE: 512m
332+
ports:
333+
- 9042:9042
334+
335+
strategy:
336+
fail-fast: false
337+
matrix:
338+
mode:
339+
- label: default
340+
group_commit_enabled: false
341+
- label: with_group_commit
342+
group_commit_enabled: true
343+
344+
steps:
345+
- uses: actions/checkout@v5
346+
347+
- name: Set up JDK ${{ env.JAVA_VERSION }} (${{ env.JAVA_VENDOR }})
348+
uses: actions/setup-java@v5
349+
with:
350+
java-version: ${{ env.JAVA_VERSION }}
351+
distribution: ${{ env.JAVA_VENDOR }}
352+
353+
- name: Set up JDK ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }} (${{ env.INT_TEST_JAVA_RUNTIME_VENDOR }}) to run integration test
354+
uses: actions/setup-java@v5
355+
if: ${{ env.SET_UP_INT_TEST_RUNTIME_NON_ORACLE_JDK == 'true'}}
356+
with:
357+
java-version: ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }}
358+
distribution: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR }}
359+
360+
- name: Login to Oracle container registry
361+
uses: docker/login-action@v3
362+
if: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR == 'oracle' }}
363+
with:
364+
registry: container-registry.oracle.com
365+
username: ${{ secrets.OCR_USERNAME }}
366+
password: ${{ secrets.OCR_TOKEN }}
367+
368+
- name: Set up JDK ${{ env.INT_TEST_JAVA_RUNTIME_VERSION }} (oracle) to run the integration test
369+
if: ${{ env.INT_TEST_JAVA_RUNTIME_VENDOR == 'oracle' }}
370+
run: |
371+
container_id=$(docker create "container-registry.oracle.com/java/jdk:${{ env.INT_TEST_JAVA_RUNTIME_VERSION }}")
372+
docker cp -L "$container_id:/usr/java/default" /usr/lib/jvm/oracle-jdk && docker rm "$container_id"
373+
374+
- name: Setup Gradle
375+
uses: gradle/actions/setup-gradle@v5
376+
377+
- name: Execute Gradle 'integrationTestCassandra' task
378+
run: ./gradlew integrationTestCassandra ${{ matrix.mode.group_commit_enabled && env.INT_TEST_GRADLE_OPTIONS_FOR_GROUP_COMMIT || '' }}
379+
380+
- name: Upload Gradle test reports
381+
if: always()
382+
uses: actions/upload-artifact@v5
383+
with:
384+
name: cassandra_5.0_integration_test_reports_${{ matrix.mode.label }}
385+
path: core/build/reports/tests/integrationTestCassandra
386+
257387
integration-test-for-cosmos:
258388
name: Cosmos DB integration test (${{ matrix.mode.label }})
259389
runs-on: windows-latest

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ subprojects {
2626
guiceVersion = '5.1.0'
2727
guavaVersion = '32.1.3-jre'
2828
slf4jVersion = '1.7.36'
29-
cassandraDriverVersion = '3.11.5'
29+
cassandraDriverVersion = '3.12.1'
3030
azureCosmosVersion = '4.75.0'
3131
azureBlobStorageVersion = '12.32.0'
3232
jooqVersion = '3.14.16'

core/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ dependencies {
167167
implementation "com.google.guava:guava:${guavaVersion}"
168168
implementation "com.google.inject:guice:${guiceVersion}"
169169
implementation "org.slf4j:slf4j-api:${slf4jVersion}"
170-
implementation "com.datastax.cassandra:cassandra-driver-core:${cassandraDriverVersion}"
170+
implementation "org.apache.cassandra:cassandra-driver-core:${cassandraDriverVersion}"
171171
implementation "com.azure:azure-cosmos:${azureCosmosVersion}"
172172
implementation "com.azure:azure-storage-blob:${azureBlobStorageVersion}"
173173
implementation "org.jooq:jooq:${jooqVersion}"

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ protected AdminTestUtils getAdminTestUtils(String testName) {
2727
return new ObjectStorageAdminTestUtils(getProperties(testName));
2828
}
2929

30-
@Override
31-
@Disabled("Temporarily disabled because it includes DML operations")
32-
public void truncateTable_ShouldTruncateProperly() {}
33-
3430
@Override
3531
@Disabled("Object Storage does not support index-related operations")
3632
public void createIndex_ForAllDataTypesWithExistingData_ShouldCreateIndexesCorrectly() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.scalar.db.storage.objectstorage;
2+
3+
import com.scalar.db.transaction.consensuscommit.ConsensusCommitConfig;
4+
import com.scalar.db.transaction.consensuscommit.ConsensusCommitCrossPartitionScanIntegrationTestBase;
5+
import java.util.Properties;
6+
import org.junit.jupiter.api.Disabled;
7+
import org.junit.jupiter.api.Test;
8+
9+
public class ConsensusCommitCrossPartitionScanIntegrationTestWithObjectStorage
10+
extends ConsensusCommitCrossPartitionScanIntegrationTestBase {
11+
12+
@Override
13+
protected Properties getProps(String testName) {
14+
Properties properties = ConsensusCommitObjectStorageEnv.getProperties(testName);
15+
properties.setProperty(ConsensusCommitConfig.ISOLATION_LEVEL, "SERIALIZABLE");
16+
return properties;
17+
}
18+
19+
@Test
20+
@Override
21+
@Disabled("Cross-partition scan with ordering is not supported in Object Storage")
22+
public void scan_CrossPartitionScanWithOrderingGivenForCommittedRecord_ShouldReturnRecords() {}
23+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package com.scalar.db.storage.objectstorage;
2+
3+
import com.scalar.db.api.TableMetadata;
4+
import com.scalar.db.io.DataType;
5+
import com.scalar.db.transaction.consensuscommit.ConsensusCommitIntegrationTestBase;
6+
import java.util.Properties;
7+
import org.junit.jupiter.api.Disabled;
8+
9+
public class ConsensusCommitIntegrationTestWithObjectStorage
10+
extends ConsensusCommitIntegrationTestBase {
11+
12+
@Override
13+
protected TableMetadata getTableMetadata() {
14+
return TableMetadata.newBuilder()
15+
.addColumn(ACCOUNT_ID, DataType.INT)
16+
.addColumn(ACCOUNT_TYPE, DataType.INT)
17+
.addColumn(BALANCE, DataType.INT)
18+
.addColumn(SOME_COLUMN, DataType.INT)
19+
.addColumn(BOOLEAN_COL, DataType.BOOLEAN)
20+
.addColumn(BIGINT_COL, DataType.BIGINT)
21+
.addColumn(FLOAT_COL, DataType.FLOAT)
22+
.addColumn(DOUBLE_COL, DataType.DOUBLE)
23+
.addColumn(TEXT_COL, DataType.TEXT)
24+
.addColumn(BLOB_COL, DataType.BLOB)
25+
.addColumn(DATE_COL, DataType.DATE)
26+
.addColumn(TIME_COL, DataType.TIME)
27+
.addColumn(TIMESTAMPTZ_COL, DataType.TIMESTAMPTZ)
28+
.addColumn(TIMESTAMP_COL, DataType.TIMESTAMP)
29+
.addPartitionKey(ACCOUNT_ID)
30+
.addClusteringKey(ACCOUNT_TYPE)
31+
.build();
32+
}
33+
34+
@Override
35+
protected Properties getProps(String testName) {
36+
return ConsensusCommitObjectStorageEnv.getProperties(testName);
37+
}
38+
39+
@Override
40+
@Disabled("Object Storage does not support index-related operations")
41+
public void get_GetGivenForIndexColumn_ShouldReturnRecords() {}
42+
43+
@Override
44+
@Disabled("Object Storage does not support index-related operations")
45+
public void scanOrGetScanner_ScanGivenForIndexColumn_ShouldReturnRecords(ScanType scanType) {}
46+
47+
@Override
48+
@Disabled("Object Storage does not support index-related operations")
49+
public void scanOrGetScanner_ScanGivenForIndexColumnWithConjunctions_ShouldReturnRecords(
50+
ScanType scanType) {}
51+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.scalar.db.storage.objectstorage;
2+
3+
import com.scalar.db.transaction.consensuscommit.ConsensusCommitNullMetadataIntegrationTestBase;
4+
import java.util.Properties;
5+
6+
public class ConsensusCommitNullMetadataIntegrationTestWithObjectStorage
7+
extends ConsensusCommitNullMetadataIntegrationTestBase {
8+
9+
@Override
10+
protected Properties getProperties(String testName) {
11+
return ConsensusCommitObjectStorageEnv.getProperties(testName);
12+
}
13+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.scalar.db.storage.objectstorage;
2+
3+
import com.scalar.db.transaction.consensuscommit.ConsensusCommitTestUtils;
4+
import java.util.Map;
5+
import java.util.Properties;
6+
7+
public class ConsensusCommitObjectStorageEnv {
8+
private ConsensusCommitObjectStorageEnv() {}
9+
10+
public static Properties getProperties(String testName) {
11+
Properties properties = ObjectStorageEnv.getProperties(testName);
12+
13+
// Add testName as a coordinator schema suffix
14+
ConsensusCommitTestUtils.addSuffixToCoordinatorNamespace(properties, testName);
15+
16+
return ConsensusCommitTestUtils.loadConsensusCommitProperties(properties);
17+
}
18+
19+
public static Map<String, String> getCreationOptions() {
20+
return ObjectStorageEnv.getCreationOptions();
21+
}
22+
}

0 commit comments

Comments
 (0)