Skip to content
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

Refactor operations and their builders #2329

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

brfrn169
Copy link
Collaborator

@brfrn169 brfrn169 commented Nov 7, 2024

Description

This PR refactors operations (Get, Scan, Put, Insert, Upsert, Update, and Delete) and their builders.

Related issues and/or PRs

N/A

Changes made

  • Added constructors to set all parameters for operations.
  • Use the added constructors in operation builders.

Checklist

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • Tests (unit, integration, etc.) have been added for the changes.
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

Additional notes (optional)

N/A

Release notes

N/A

@brfrn169 brfrn169 self-assigned this Nov 7, 2024
@@ -18,6 +19,16 @@
@NotThreadSafe
public class Delete extends Mutation {

Delete(
Copy link
Collaborator Author

@brfrn169 brfrn169 Nov 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added constructors to set all parameters for operations.

}

return delete;
return new Delete(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the added constructors in operation builders.

private final Optional<Key> clusteringKey;
private Optional<String> namespace;
private Optional<String> tableName;
@Nullable private final Key clusteringKey;
@Nullable private String namespace;
private String tableName;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stopped using Optional in operations.

@brfrn169 brfrn169 marked this pull request as draft November 7, 2024 06:46
@brfrn169 brfrn169 force-pushed the refactor-operations-and-builders branch 3 times, most recently from 40576ee to 4045728 Compare November 8, 2024 04:03
@brfrn169 brfrn169 force-pushed the refactor-operations-and-builders branch from 4045728 to adb8fa7 Compare November 8, 2024 04:39
@brfrn169 brfrn169 marked this pull request as ready for review November 8, 2024 06:43
@@ -1221,13 +1207,15 @@ public BuildableScanFromExistingWithOngoingWhereOr whereOr(
public BuildableScanOrScanAllFromExisting clearStart() {
checkNotScanWithIndexOrScanAll();
this.startClusteringKey = null;
this.startInclusive = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a (very minor) compatibility issue for those who expect this method to keep the inclusion setting? I think this is a reasonable bugfix, though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strictly speaking, it could be. But we basically don't use startInclusive if startClusteringKey is null, so this shouldn't cause any issues actually. Thanks.

Copy link
Contributor

@Torch3333 Torch3333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

Copy link
Contributor

@komamitsu komamitsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!

@feeblefakie feeblefakie merged commit 5a9f751 into master Nov 13, 2024
48 checks passed
@feeblefakie feeblefakie deleted the refactor-operations-and-builders branch November 13, 2024 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants