-
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
Conversation
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces data manipulation language (DML) support for the Blob Storage adapter, which is a significant and well-implemented feature. The changes include the core logic for handling mutations, numerous integration tests to ensure correctness, and necessary updates to error codes and utility classes. My review focuses on improving code clarity, robustness, and performance in the new classes. I've identified opportunities to remove dead code, enhance immutability, improve test coverage for conditional operations, and optimize a hashCode implementation. Overall, this is a solid contribution that greatly enhances the capabilities of the object storage adapter.
core/src/main/java/com/scalar/db/storage/objectstorage/ObjectStorageRecord.java
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/ObjectStorageRecord.java
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/ObjectStorageRecord.java
Show resolved
Hide resolved
...ava/com/scalar/db/storage/objectstorage/ObjectStorageConditionalMutationIntegrationTest.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/ObjectStorageMutation.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/ObjectStorageMutation.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/PartitionIdentifier.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request adds significant data manipulation capabilities to the Blob Storage adapter, a major step forward. The overall implementation is solid, with good use of handlers for different statement types and a clear read-modify-write pattern for mutations. I've identified a few areas for improvement, including a bug in data serialization, a suboptimal hash implementation, and opportunities to enhance test coverage and code readability. My detailed comments are below.
...ava/com/scalar/db/storage/objectstorage/ObjectStorageConditionalMutationIntegrationTest.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/ObjectStorage.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/PartitionIdentifier.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces Data Manipulation Language (DML) support for the Azure Blob Storage adapter, which is a significant enhancement. The changes include new classes for handling mutations and selections, as well as comprehensive integration and unit tests. The implementation correctly identifies and enforces several limitations inherent to object storage, such as the lack of index support, restricted conditional operations for BLOB types, and limitations on cross-partition scan ordering. The addition of specific error codes for these scenarios is also a positive step for clarity and debugging. Overall, the changes are well-structured and provide a solid foundation for DML operations in Object Storage.
core/src/main/java/com/scalar/db/storage/objectstorage/SelectStatementHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/ObjectStorageRecord.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/ResultInterpreter.java
Show resolved
Hide resolved
core/src/integration-test/java/com/scalar/db/storage/objectstorage/ObjectStorageTestUtils.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 56 out of 56 changed files in this pull request and generated no comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...ation-test/java/com/scalar/db/storage/objectstorage/ObjectStorageWrapperIntegrationTest.java
Show resolved
Hide resolved
70f2d31 to
0a73daf
Compare
core/src/main/java/com/scalar/db/storage/objectstorage/ClusteringKeyComparator.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/MutateStatementHandler.java
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/StatementHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/SelectStatementHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/SelectStatementHandler.java
Outdated
Show resolved
Hide resolved
feeblefakie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a glance, and the code overall looks OK, but I felt that the class design can be improved.
I left one suggestion. so PTAL.
core/src/main/java/com/scalar/db/storage/objectstorage/MutateStatementHandler.java
Outdated
Show resolved
Hide resolved
63647e2 to
0de9149
Compare
8cef4ad to
493419b
Compare
core/src/main/java/com/scalar/db/storage/objectstorage/MutateStatementHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/SelectStatementHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/MutateStatementHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/MutateStatementHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/MutateStatementHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/MutateStatementHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/MutateStatementHandler.java
Outdated
Show resolved
Hide resolved
komamitsu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
josh-wong
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added some minor suggestions. PTAL!
...storage/objectstorage/ConsensusCommitCrossPartitionScanIntegrationTestWithObjectStorage.java
Outdated
Show resolved
Hide resolved
...java/com/scalar/db/storage/objectstorage/ObjectStorageCrossPartitionScanIntegrationTest.java
Outdated
Show resolved
Hide resolved
...objectstorage/TwoPhaseConsensusCommitCrossPartitionScanIntegrationTestWithObjectStorage.java
Outdated
Show resolved
Hide resolved
josh-wong
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!🙇🏻♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM. Left several comments. PTAL!
Just in case, I’ll take another look later.
core/src/main/java/com/scalar/db/storage/objectstorage/SelectStatementHandler.java
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/SelectStatementHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/SelectStatementHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/SelectStatementHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/SelectStatementHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/StatementHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/StatementHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/ObjectStorageMutation.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/ObjectStorageMutation.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/MutateStatementHandler.java
Show resolved
Hide resolved
brfrn169
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left several comments. PTAL!
core/src/main/java/com/scalar/db/storage/objectstorage/StatementHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/StatementHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/StatementHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/storage/objectstorage/StreamingRecordIterator.java
Show resolved
Hide resolved
feeblefakie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
brfrn169
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
|
@Torch3333 Can you check? |
Torch3333
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
Description
This PR adds DML support for the Blob adapter, enabling data manipulation operations on Azure Blob Storage.
Support for S3 and GCS will be addressed in subsequent PRs.
Related issues and/or PRs
Changes made
DistributedStorageimplementation for Object Storage.Checklist
Additional notes (optional)
N/A
Release notes
Added support for data manipulation operations over Azure Blob Storage.