-
Notifications
You must be signed in to change notification settings - Fork 40
Add support for data manipulation operations in Blob Storage adapter #3124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
1231cb7
Add DML support for Blob Storage
KodaiD 4811884
Apply suggestions
KodaiD 0a73daf
Fix to remove BLOB type limitations
KodaiD dcc742e
Update the OperationChecker unit test to reflect the code change
KodaiD 533f3cd
Fix based on review
KodaiD 0de9149
Apply suggestions
KodaiD f9c1da5
Resolve conflicts
KodaiD e0657fd
Add unit tests for ObjectStoragePartition
KodaiD 493419b
Update integration tests to remove secondary indexes from metadata
KodaiD c8e1cf0
Apply suggestions
KodaiD 05c831b
Fix integration tests
KodaiD 7228c1a
Apply suggestions
KodaiD 669501a
Apply suggestions
KodaiD 1ca754a
Fix to suppress warnings
KodaiD 2297d82
Apply suggestions
KodaiD 781c9c7
Merge branch 'master' into add-dml-support-for-blob-storage
KodaiD File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...rage/objectstorage/ConsensusCommitCrossPartitionScanIntegrationTestWithObjectStorage.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| package com.scalar.db.storage.objectstorage; | ||
|
|
||
| import com.scalar.db.transaction.consensuscommit.ConsensusCommitConfig; | ||
| import com.scalar.db.transaction.consensuscommit.ConsensusCommitCrossPartitionScanIntegrationTestBase; | ||
| import java.util.Properties; | ||
| import org.junit.jupiter.api.Disabled; | ||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| public class ConsensusCommitCrossPartitionScanIntegrationTestWithObjectStorage | ||
| extends ConsensusCommitCrossPartitionScanIntegrationTestBase { | ||
|
|
||
| @Override | ||
| protected Properties getProps(String testName) { | ||
| Properties properties = ConsensusCommitObjectStorageEnv.getProperties(testName); | ||
| properties.setProperty(ConsensusCommitConfig.ISOLATION_LEVEL, "SERIALIZABLE"); | ||
| return properties; | ||
| } | ||
|
|
||
| @Test | ||
| @Override | ||
| @Disabled("Cross partition scan with ordering is not supported in Object Storages") | ||
| public void scan_CrossPartitionScanWithOrderingGivenForCommittedRecord_ShouldReturnRecords() {} | ||
| } | ||
31 changes: 31 additions & 0 deletions
31
.../com/scalar/db/storage/objectstorage/ConsensusCommitIntegrationTestWithObjectStorage.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| package com.scalar.db.storage.objectstorage; | ||
|
|
||
| import com.scalar.db.transaction.consensuscommit.ConsensusCommitIntegrationTestBase; | ||
| import java.util.Properties; | ||
| import org.junit.jupiter.api.Disabled; | ||
|
|
||
| public class ConsensusCommitIntegrationTestWithObjectStorage | ||
| extends ConsensusCommitIntegrationTestBase { | ||
| @Override | ||
| protected Properties getProps(String testName) { | ||
| return ConsensusCommitObjectStorageEnv.getProperties(testName); | ||
| } | ||
|
|
||
| @Override | ||
| protected boolean isTimestampTypeSupported() { | ||
| return false; | ||
| } | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void get_GetGivenForIndexColumn_ShouldReturnRecords() {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void scanOrGetScanner_ScanGivenForIndexColumn_ShouldReturnRecords(ScanType scanType) {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void scanOrGetScanner_ScanGivenForIndexColumnWithConjunctions_ShouldReturnRecords( | ||
| ScanType scanType) {} | ||
| } |
13 changes: 13 additions & 0 deletions
13
...db/storage/objectstorage/ConsensusCommitNullMetadataIntegrationTestWithObjectStorage.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package com.scalar.db.storage.objectstorage; | ||
|
|
||
| import com.scalar.db.transaction.consensuscommit.ConsensusCommitNullMetadataIntegrationTestBase; | ||
| import java.util.Properties; | ||
|
|
||
| public class ConsensusCommitNullMetadataIntegrationTestWithObjectStorage | ||
| extends ConsensusCommitNullMetadataIntegrationTestBase { | ||
|
|
||
| @Override | ||
| protected Properties getProperties(String testName) { | ||
| return ConsensusCommitObjectStorageEnv.getProperties(testName); | ||
| } | ||
| } |
22 changes: 22 additions & 0 deletions
22
...ration-test/java/com/scalar/db/storage/objectstorage/ConsensusCommitObjectStorageEnv.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| package com.scalar.db.storage.objectstorage; | ||
|
|
||
| import com.scalar.db.transaction.consensuscommit.ConsensusCommitTestUtils; | ||
| import java.util.Map; | ||
| import java.util.Properties; | ||
|
|
||
| public class ConsensusCommitObjectStorageEnv { | ||
| private ConsensusCommitObjectStorageEnv() {} | ||
|
|
||
| public static Properties getProperties(String testName) { | ||
| Properties properties = ObjectStorageEnv.getProperties(testName); | ||
|
|
||
| // Add testName as a coordinator schema suffix | ||
| ConsensusCommitTestUtils.addSuffixToCoordinatorNamespace(properties, testName); | ||
|
|
||
| return ConsensusCommitTestUtils.loadConsensusCommitProperties(properties); | ||
| } | ||
|
|
||
| public static Map<String, String> getCreationOptions() { | ||
| return ObjectStorageEnv.getCreationOptions(); | ||
| } | ||
| } |
130 changes: 130 additions & 0 deletions
130
...lar/db/storage/objectstorage/ConsensusCommitSpecificIntegrationTestWithObjectStorage.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
| package com.scalar.db.storage.objectstorage; | ||
|
|
||
| import com.scalar.db.transaction.consensuscommit.ConsensusCommitSpecificIntegrationTestBase; | ||
| import com.scalar.db.transaction.consensuscommit.Isolation; | ||
| import java.util.Properties; | ||
| import org.junit.jupiter.api.Disabled; | ||
|
|
||
| public class ConsensusCommitSpecificIntegrationTestWithObjectStorage | ||
| extends ConsensusCommitSpecificIntegrationTestBase { | ||
|
|
||
| @Override | ||
| protected Properties getProperties(String testName) { | ||
| return ConsensusCommitObjectStorageEnv.getProperties(testName); | ||
| } | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void | ||
| scanWithIndex_PutWithOverlappedIndexKeyAndNonOverlappedConjunctionsGivenBefore_ShouldScan( | ||
| Isolation isolation) {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void | ||
| scanWithIndex_OverlappingPutWithNonIndexedColumnGivenBefore_ShouldThrowIllegalArgumentException( | ||
| Isolation isolation) {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void | ||
| scanWithIndex_NonOverlappingPutWithIndexedColumnGivenBefore_ShouldThrowIllegalArgumentException( | ||
| Isolation isolation) {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void | ||
| scanWithIndex_OverlappingPutWithIndexedColumnGivenBefore_ShouldThrowIllegalArgumentException( | ||
| Isolation isolation) {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void | ||
| scanWithIndex_OverlappingPutWithIndexedColumnAndConjunctionsGivenBefore_ShouldThrowIllegalArgumentException( | ||
| Isolation isolation) {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void scan_ScanWithIndexGiven_WithSerializable_ShouldNotThrowAnyException() {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void | ||
| scan_ScanWithIndexGiven_RecordUpdatedByAnotherTransaction_WithSerializable_ShouldThrowCommitConflictException() {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void | ||
| scan_ScanWithIndexGiven_RecordUpdatedByMyself_WithSerializable_ShouldNotThrowAnyException() {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void | ||
| scan_ScanWithIndexGiven_RecordDeletedByAnotherTransaction_WithSerializable_ShouldThrowCommitConflictException() {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void | ||
| scan_ScanWithIndexGiven_RecordDeletedByMyself_WithSerializable_ShouldNotThrowAnyException() {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void scan_ScanWithIndexWithLimitGiven_WithSerializable_ShouldNotThrowAnyException() {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void get_GetWithIndexGiven_WithSerializable_ShouldNotThrowAnyException() {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void | ||
| get_GetWithIndexGiven_RecordUpdatedByAnotherTransaction_WithSerializable_ShouldThrowCommitConflictException() {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void | ||
| get_GetWithIndexGiven_RecordUpdatedByMyself_WithSerializable_ShouldNotThrowAnyException() {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void | ||
| get_GetWithIndexGiven_RecordDeletedByAnotherTransaction_WithSerializable_ShouldThrowCommitConflictException() {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void | ||
| get_GetWithIndexGiven_RecordDeletedByMyself_WithSerializable_ShouldNotThrowAnyException() {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void | ||
| get_GetWithIndexGiven_NoRecordsInIndexRange_WithSerializable_ShouldNotThrowAnyException() {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void | ||
| get_GetWithIndexGiven_RecordInsertedIntoIndexRangeByMyself_WithSerializable_ShouldNotThrowAnyException() {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void | ||
| get_GetWithIndexGiven_RecordInsertedIntoIndexRangeByAnotherTransaction_WithSerializable_ShouldThrowCommitConflictException() {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void | ||
| get_GetWithIndexGiven_NoRecordsInIndexRange_RecordInsertedIntoIndexRangeByMyself_WithSerializable_ShouldNotThrowAnyException() {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void | ||
| get_GetWithIndexGiven_NoRecordsInIndexRange_RecordInsertedIntoIndexRangeByAnotherTransaction_WithSerializable_ShouldThrowCommitConflictException() {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void getAndUpdate_GetWithIndexGiven_ShouldUpdate(Isolation isolation) {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void scanAndUpdate_ScanWithIndexGiven_ShouldUpdate(Isolation isolation) {} | ||
| } |
13 changes: 13 additions & 0 deletions
13
...ectstorage/ConsensusCommitWithIncludeMetadataEnabledIntegrationTestWithObjectStorage.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package com.scalar.db.storage.objectstorage; | ||
|
|
||
| import com.scalar.db.transaction.consensuscommit.ConsensusCommitWithIncludeMetadataEnabledIntegrationTestBase; | ||
| import java.util.Properties; | ||
|
|
||
| public class ConsensusCommitWithIncludeMetadataEnabledIntegrationTestWithObjectStorage | ||
| extends ConsensusCommitWithIncludeMetadataEnabledIntegrationTestBase { | ||
|
|
||
| @Override | ||
| protected Properties getProperties(String testName) { | ||
| return ConsensusCommitObjectStorageEnv.getProperties(testName); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...java/com/scalar/db/storage/objectstorage/ObjectStorageCaseSensitivityIntegrationTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| package com.scalar.db.storage.objectstorage; | ||
|
|
||
| import com.scalar.db.api.DistributedStorageCaseSensitivityIntegrationTestBase; | ||
| import java.util.Map; | ||
| import java.util.Properties; | ||
| import org.junit.jupiter.api.Disabled; | ||
|
|
||
| public class ObjectStorageCaseSensitivityIntegrationTest | ||
| extends DistributedStorageCaseSensitivityIntegrationTestBase { | ||
|
|
||
| @Override | ||
| protected Properties getProperties(String testName) { | ||
| return ObjectStorageEnv.getProperties(testName); | ||
| } | ||
|
|
||
| @Override | ||
| protected Map<String, String> getCreationOptions() { | ||
| return ObjectStorageEnv.getCreationOptions(); | ||
| } | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void get_GetGivenForIndexedColumn_ShouldGet() {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void get_GetGivenForIndexedColumnWithMatchedConjunctions_ShouldGet() {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void get_GetGivenForIndexedColumnWithUnmatchedConjunctions_ShouldReturnEmpty() {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void | ||
| get_GetGivenForIndexedColumnMatchingMultipleRecords_ShouldThrowIllegalArgumentException() {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void scan_ScanGivenForIndexedColumn_ShouldScan() {} | ||
|
|
||
| @Override | ||
| @Disabled("Object Storage does not support index-related operations") | ||
| public void scan_ScanGivenForNonIndexedColumn_ShouldThrowIllegalArgumentException() {} | ||
| } |
12 changes: 12 additions & 0 deletions
12
...est/java/com/scalar/db/storage/objectstorage/ObjectStorageColumnValueIntegrationTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package com.scalar.db.storage.objectstorage; | ||
|
|
||
| import com.scalar.db.api.DistributedStorageColumnValueIntegrationTestBase; | ||
| import java.util.Properties; | ||
|
|
||
| public class ObjectStorageColumnValueIntegrationTest | ||
| extends DistributedStorageColumnValueIntegrationTestBase { | ||
| @Override | ||
| protected Properties getProperties(String testName) { | ||
| return ObjectStorageEnv.getProperties(testName); | ||
| } | ||
| } |
30 changes: 30 additions & 0 deletions
30
.../com/scalar/db/storage/objectstorage/ObjectStorageConditionalMutationIntegrationTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| package com.scalar.db.storage.objectstorage; | ||
|
|
||
| import com.scalar.db.api.ConditionalExpression; | ||
| import com.scalar.db.api.DistributedStorageConditionalMutationIntegrationTestBase; | ||
| import java.util.List; | ||
| import java.util.Properties; | ||
| import java.util.stream.Collectors; | ||
|
|
||
| public class ObjectStorageConditionalMutationIntegrationTest | ||
| extends DistributedStorageConditionalMutationIntegrationTestBase { | ||
| @Override | ||
| protected Properties getProperties(String testName) { | ||
| return ObjectStorageEnv.getProperties(testName); | ||
| } | ||
|
|
||
| @Override | ||
| protected int getThreadNum() { | ||
| return 3; | ||
| } | ||
|
|
||
| @Override | ||
| protected List<OperatorAndDataType> getOperatorAndDataTypeListForTest() { | ||
| return super.getOperatorAndDataTypeListForTest().stream() | ||
| .filter( | ||
| operatorAndDataType -> | ||
| operatorAndDataType.getOperator() == ConditionalExpression.Operator.EQ | ||
| || operatorAndDataType.getOperator() == ConditionalExpression.Operator.NE) | ||
| .collect(Collectors.toList()); | ||
KodaiD marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
KodaiD marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
30 changes: 30 additions & 0 deletions
30
...a/com/scalar/db/storage/objectstorage/ObjectStorageCrossPartitionScanIntegrationTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| package com.scalar.db.storage.objectstorage; | ||
|
|
||
| import com.scalar.db.api.DistributedStorageCrossPartitionScanIntegrationTestBase; | ||
| import java.util.Properties; | ||
| import org.junit.jupiter.api.Disabled; | ||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| public class ObjectStorageCrossPartitionScanIntegrationTest | ||
| extends DistributedStorageCrossPartitionScanIntegrationTestBase { | ||
|
|
||
| @Override | ||
| protected Properties getProperties(String testName) { | ||
| return ObjectStorageEnv.getProperties(testName); | ||
| } | ||
|
|
||
| @Override | ||
| protected int getThreadNum() { | ||
| return 3; | ||
| } | ||
|
|
||
| @Override | ||
| protected boolean isParallelDdlSupported() { | ||
| return false; | ||
| } | ||
|
|
||
| @Test | ||
| @Override | ||
| @Disabled("Cross partition scan with ordering is not supported in Object Storages") | ||
KodaiD marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| public void scan_WithOrderingForNonPrimaryColumns_ShouldReturnProperResult() {} | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.