Skip to content

Commit 1231cb7

Browse files
committed
Add DML support for Blob Storage
1 parent b3d44a1 commit 1231cb7

File tree

57 files changed

+6525
-25
lines changed

Some content is hidden

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

57 files changed

+6525
-25
lines changed

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
@@ -18,10 +18,6 @@ protected AdminTestUtils getAdminTestUtils(String testName) {
1818
return new ObjectStorageAdminTestUtils(getProperties(testName));
1919
}
2020

21-
@Override
22-
@Disabled("Temporarily disabled because it includes DML operations")
23-
public void truncateTable_ShouldTruncateProperly() {}
24-
2521
@Override
2622
@Disabled("Object Storage does not support index-related operations")
2723
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 Storages")
22+
public void scan_CrossPartitionScanWithOrderingGivenForCommittedRecord_ShouldReturnRecords() {}
23+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.scalar.db.storage.objectstorage;
2+
3+
import com.scalar.db.transaction.consensuscommit.ConsensusCommitIntegrationTestBase;
4+
import java.util.Properties;
5+
import org.junit.jupiter.api.Disabled;
6+
7+
public class ConsensusCommitIntegrationTestWithObjectStorage
8+
extends ConsensusCommitIntegrationTestBase {
9+
@Override
10+
protected Properties getProps(String testName) {
11+
return ConsensusCommitObjectStorageEnv.getProperties(testName);
12+
}
13+
14+
@Override
15+
protected boolean isTimestampTypeSupported() {
16+
return false;
17+
}
18+
19+
@Override
20+
@Disabled("Object Storage does not support index-related operations")
21+
public void get_GetGivenForIndexColumn_ShouldReturnRecords() {}
22+
23+
@Override
24+
@Disabled("Object Storage does not support index-related operations")
25+
public void scanOrGetScanner_ScanGivenForIndexColumn_ShouldReturnRecords(ScanType scanType) {}
26+
27+
@Override
28+
@Disabled("Object Storage does not support index-related operations")
29+
public void scanOrGetScanner_ScanGivenForIndexColumnWithConjunctions_ShouldReturnRecords(
30+
ScanType scanType) {}
31+
}
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+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
package com.scalar.db.storage.objectstorage;
2+
3+
import com.scalar.db.transaction.consensuscommit.ConsensusCommitSpecificIntegrationTestBase;
4+
import com.scalar.db.transaction.consensuscommit.Isolation;
5+
import java.util.Properties;
6+
import org.junit.jupiter.api.Disabled;
7+
8+
public class ConsensusCommitSpecificIntegrationTestWithObjectStorage
9+
extends ConsensusCommitSpecificIntegrationTestBase {
10+
11+
@Override
12+
protected Properties getProperties(String testName) {
13+
return ConsensusCommitObjectStorageEnv.getProperties(testName);
14+
}
15+
16+
@Override
17+
@Disabled("Object Storage does not support index-related operations")
18+
public void
19+
scanWithIndex_PutWithOverlappedIndexKeyAndNonOverlappedConjunctionsGivenBefore_ShouldScan(
20+
Isolation isolation) {}
21+
22+
@Override
23+
@Disabled("Object Storage does not support index-related operations")
24+
public void
25+
scanWithIndex_OverlappingPutWithNonIndexedColumnGivenBefore_ShouldThrowIllegalArgumentException(
26+
Isolation isolation) {}
27+
28+
@Override
29+
@Disabled("Object Storage does not support index-related operations")
30+
public void
31+
scanWithIndex_NonOverlappingPutWithIndexedColumnGivenBefore_ShouldThrowIllegalArgumentException(
32+
Isolation isolation) {}
33+
34+
@Override
35+
@Disabled("Object Storage does not support index-related operations")
36+
public void
37+
scanWithIndex_OverlappingPutWithIndexedColumnGivenBefore_ShouldThrowIllegalArgumentException(
38+
Isolation isolation) {}
39+
40+
@Override
41+
@Disabled("Object Storage does not support index-related operations")
42+
public void
43+
scanWithIndex_OverlappingPutWithIndexedColumnAndConjunctionsGivenBefore_ShouldThrowIllegalArgumentException(
44+
Isolation isolation) {}
45+
46+
@Override
47+
@Disabled("Object Storage does not support index-related operations")
48+
public void scan_ScanWithIndexGiven_WithSerializable_ShouldNotThrowAnyException() {}
49+
50+
@Override
51+
@Disabled("Object Storage does not support index-related operations")
52+
public void
53+
scan_ScanWithIndexGiven_RecordUpdatedByAnotherTransaction_WithSerializable_ShouldThrowCommitConflictException() {}
54+
55+
@Override
56+
@Disabled("Object Storage does not support index-related operations")
57+
public void
58+
scan_ScanWithIndexGiven_RecordUpdatedByMyself_WithSerializable_ShouldNotThrowAnyException() {}
59+
60+
@Override
61+
@Disabled("Object Storage does not support index-related operations")
62+
public void
63+
scan_ScanWithIndexGiven_RecordDeletedByAnotherTransaction_WithSerializable_ShouldThrowCommitConflictException() {}
64+
65+
@Override
66+
@Disabled("Object Storage does not support index-related operations")
67+
public void
68+
scan_ScanWithIndexGiven_RecordDeletedByMyself_WithSerializable_ShouldNotThrowAnyException() {}
69+
70+
@Override
71+
@Disabled("Object Storage does not support index-related operations")
72+
public void scan_ScanWithIndexWithLimitGiven_WithSerializable_ShouldNotThrowAnyException() {}
73+
74+
@Override
75+
@Disabled("Object Storage does not support index-related operations")
76+
public void get_GetWithIndexGiven_WithSerializable_ShouldNotThrowAnyException() {}
77+
78+
@Override
79+
@Disabled("Object Storage does not support index-related operations")
80+
public void
81+
get_GetWithIndexGiven_RecordUpdatedByAnotherTransaction_WithSerializable_ShouldThrowCommitConflictException() {}
82+
83+
@Override
84+
@Disabled("Object Storage does not support index-related operations")
85+
public void
86+
get_GetWithIndexGiven_RecordUpdatedByMyself_WithSerializable_ShouldNotThrowAnyException() {}
87+
88+
@Override
89+
@Disabled("Object Storage does not support index-related operations")
90+
public void
91+
get_GetWithIndexGiven_RecordDeletedByAnotherTransaction_WithSerializable_ShouldThrowCommitConflictException() {}
92+
93+
@Override
94+
@Disabled("Object Storage does not support index-related operations")
95+
public void
96+
get_GetWithIndexGiven_RecordDeletedByMyself_WithSerializable_ShouldNotThrowAnyException() {}
97+
98+
@Override
99+
@Disabled("Object Storage does not support index-related operations")
100+
public void
101+
get_GetWithIndexGiven_NoRecordsInIndexRange_WithSerializable_ShouldNotThrowAnyException() {}
102+
103+
@Override
104+
@Disabled("Object Storage does not support index-related operations")
105+
public void
106+
get_GetWithIndexGiven_RecordInsertedIntoIndexRangeByMyself_WithSerializable_ShouldNotThrowAnyException() {}
107+
108+
@Override
109+
@Disabled("Object Storage does not support index-related operations")
110+
public void
111+
get_GetWithIndexGiven_RecordInsertedIntoIndexRangeByAnotherTransaction_WithSerializable_ShouldThrowCommitConflictException() {}
112+
113+
@Override
114+
@Disabled("Object Storage does not support index-related operations")
115+
public void
116+
get_GetWithIndexGiven_NoRecordsInIndexRange_RecordInsertedIntoIndexRangeByMyself_WithSerializable_ShouldNotThrowAnyException() {}
117+
118+
@Override
119+
@Disabled("Object Storage does not support index-related operations")
120+
public void
121+
get_GetWithIndexGiven_NoRecordsInIndexRange_RecordInsertedIntoIndexRangeByAnotherTransaction_WithSerializable_ShouldThrowCommitConflictException() {}
122+
123+
@Override
124+
@Disabled("Object Storage does not support index-related operations")
125+
public void getAndUpdate_GetWithIndexGiven_ShouldUpdate(Isolation isolation) {}
126+
127+
@Override
128+
@Disabled("Object Storage does not support index-related operations")
129+
public void scanAndUpdate_ScanWithIndexGiven_ShouldUpdate(Isolation isolation) {}
130+
}
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.ConsensusCommitWithIncludeMetadataEnabledIntegrationTestBase;
4+
import java.util.Properties;
5+
6+
public class ConsensusCommitWithIncludeMetadataEnabledIntegrationTestWithObjectStorage
7+
extends ConsensusCommitWithIncludeMetadataEnabledIntegrationTestBase {
8+
9+
@Override
10+
protected Properties getProperties(String testName) {
11+
return ConsensusCommitObjectStorageEnv.getProperties(testName);
12+
}
13+
}

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

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

27-
@Override
28-
@Disabled("Temporarily disabled because it includes DML operations")
29-
public void truncateTable_ShouldTruncateProperly() {}
30-
3127
@Override
3228
@Disabled("Object Storage does not have a concept of namespaces")
3329
public void

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

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

25-
@Override
26-
@Disabled("Temporarily disabled because it includes DML operations")
27-
public void truncateTable_ShouldTruncateProperly() {}
28-
2925
@Override
3026
@Disabled("Object Storage does not have a concept of namespaces")
3127
public void
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package com.scalar.db.storage.objectstorage;
2+
3+
import com.scalar.db.api.DistributedStorageCaseSensitivityIntegrationTestBase;
4+
import java.util.Map;
5+
import java.util.Properties;
6+
import org.junit.jupiter.api.Disabled;
7+
8+
public class ObjectStorageCaseSensitivityIntegrationTest
9+
extends DistributedStorageCaseSensitivityIntegrationTestBase {
10+
11+
@Override
12+
protected Properties getProperties(String testName) {
13+
return ObjectStorageEnv.getProperties(testName);
14+
}
15+
16+
@Override
17+
protected Map<String, String> getCreationOptions() {
18+
return ObjectStorageEnv.getCreationOptions();
19+
}
20+
21+
@Override
22+
@Disabled("Object Storage does not support index-related operations")
23+
public void get_GetGivenForIndexedColumn_ShouldGet() {}
24+
25+
@Override
26+
@Disabled("Object Storage does not support index-related operations")
27+
public void get_GetGivenForIndexedColumnWithMatchedConjunctions_ShouldGet() {}
28+
29+
@Override
30+
@Disabled("Object Storage does not support index-related operations")
31+
public void get_GetGivenForIndexedColumnWithUnmatchedConjunctions_ShouldReturnEmpty() {}
32+
33+
@Override
34+
@Disabled("Object Storage does not support index-related operations")
35+
public void
36+
get_GetGivenForIndexedColumnMatchingMultipleRecords_ShouldThrowIllegalArgumentException() {}
37+
38+
@Override
39+
@Disabled("Object Storage does not support index-related operations")
40+
public void scan_ScanGivenForIndexedColumn_ShouldScan() {}
41+
42+
@Override
43+
@Disabled("Object Storage does not support index-related operations")
44+
public void scan_ScanGivenForNonIndexedColumn_ShouldThrowIllegalArgumentException() {}
45+
}

0 commit comments

Comments
 (0)