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

Use operation attributes for implicit pre-read and insert mode of Put #2351

Conversation

brfrn169
Copy link
Collaborator

@brfrn169 brfrn169 commented Nov 18, 2024

Description

This PR updates the code to use operation attributes (introduced in #2333) for implicit pre-read and insert mode of Put.

Related issues and/or PRs

Changes made

  • Removed the flags for implicit pre-read and insert mode in Put.
  • Added ConsensusCommitOperationAttribute to manage the operations attributes for Consensus Commit.

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 18, 2024
Comment on lines -45 to -47
private boolean implicitPreReadEnabled;

private boolean insertModeEnabled;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed the flags for implicit pre-read and insert mode. Instead, use the operation attributes for them.

import java.util.Optional;

/** A class to manage the operations attributes for Consensus Commit. */
public final class ConsensusCommitOperationAttribute {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added ConsensusCommitOperationAttribute to manage the operations attributes for Consensus Commit.

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! 👍

Put setImplicitPreReadEnabled(boolean implicitPreReadEnabled) {
this.implicitPreReadEnabled = implicitPreReadEnabled;
return this;
return ConsensusCommitOperationAttribute.isImplicitPreReadEnabled(this);
Copy link
Contributor

Choose a reason for hiding this comment

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

Just an idea: Moving these operations to ConsensusCommitOperationAttribute's instance methods and replacing ImmutableMap<String, String> attributes with ConsensusCommitOperationAttribute attributes might be an option in the future.

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

@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 436b6da into master Nov 26, 2024
48 checks passed
@feeblefakie feeblefakie deleted the use-operation-attributes-for-implicit-pre-read-and-insert-mode-of-put branch November 26, 2024 13:32
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