Repository navigation
Conversation
navinko
marked this pull request as draft
October 27, 2026 20:56
adoroszlai
reviewed
Oct 27, 2026
adoroszlai
left a comment
Contributor
There was a problem hiding this comment.
Thanks @navinko for working on this.
Comment on lines
+634
to
+676
| public static final class DatanodeCommand { | ||
| private final DatanodeDetails datanode; | ||
| private final SCMCommand<?> command; | ||
|
|
||
| private DatanodeCommand(DatanodeDetails datanode, SCMCommand<?> command) { | ||
| this.datanode = datanode; | ||
| this.command = command; | ||
| } | ||
|
|
||
| public static DatanodeCommand of(DatanodeDetails datanode, SCMCommand<?> command) { | ||
| return new DatanodeCommand(datanode, command); | ||
| } | ||
|
|
||
| public DatanodeDetails getDatanode() { | ||
| return datanode; | ||
| } | ||
|
|
||
| public SCMCommand<?> getCommand() { | ||
| return command; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object o) { | ||
| if (this == o) { | ||
| return true; | ||
| } | ||
| if (!(o instanceof DatanodeCommand)) { | ||
| return false; | ||
| } | ||
| DatanodeCommand that = (DatanodeCommand) o; | ||
| return Objects.equals(datanode, that.datanode) && Objects.equals(command, that.command); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hash(datanode, command); | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "(" + datanode + ", " + command + ")"; | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
Can you please replace these new value classes using records to avoid the boilerplate?
public record DatanodeCommand(DatanodeDetails datanode, SCMCommand<?> command) { }
Contributor
Author
There was a problem hiding this comment.
Can you please replace these new value classes using records to avoid the boilerplate?
public record DatanodeCommand(DatanodeDetails datanode, SCMCommand<?> command) { }
Thanks @adoroszlai for the review suggestions, updated the value classes to use Java records to eliminate boilerplate, as suggested.
navinko
marked this pull request as ready for review
October 28, 2026 13:29
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changes were proposed in this pull request?
Replaced Pair usage from SCM replication core and tests with semantically named Java records.
Please describe your PR in detail:
Replaced Pair usage in ECUnderReplicationHandler.java and ReplicationManager.java, along with their respective test classes, with semantically named Java records to improve code readability and maintainability.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16614
How was this patch tested?
Updated the existing test cases and tested locally.
Successful CI Build: https://github.com/navinko/ozone/actions/runs/40680692227