HDDS-15121. Unify SCM list container on SCMListContainerRequestProto#10144
Open
sarvekshayr wants to merge 1 commit intoapache:masterfrom
Open
HDDS-15121. Unify SCM list container on SCMListContainerRequestProto#10144sarvekshayr wants to merge 1 commit intoapache:masterfrom
sarvekshayr wants to merge 1 commit intoapache:masterfrom
Conversation
Contributor
sreejasahithi
left a comment
There was a problem hiding this comment.
Thanks @sarvekshayr
Comment on lines
+131
to
+133
| containerOperationClient.listContainer(ScmListContainerRequestCodec.toProto( | ||
| 0L, 1_000_000, null, null, null, null, null, null)) | ||
| .getContainerInfoList(); |
Contributor
There was a problem hiding this comment.
nit: create a named constant for 1_000_000
Comment on lines
+171
to
+173
| if (request.hasFactor()) { | ||
| repConfig = ReplicationConfig | ||
| .fromProtoTypeAndFactor(request.getType(), request.getFactor()); |
Contributor
There was a problem hiding this comment.
request.getType() is already stored in variable replicationType, so we can directly use that instead of reading the proto field again here.
Comment on lines
+166
to
+167
| if (replicationType == HddsProtos.ReplicationType.EC) { | ||
| if (request.hasEcReplicationConfig()) { |
Contributor
There was a problem hiding this comment.
can directly use EC instead of HddsProtos.ReplicationType.EC similar to how it is used in toProto
Comment on lines
+129
to
+136
| if (repConfig != null) { | ||
| if (repConfig.getReplicationType() == EC) { | ||
| builder.setType(EC); | ||
| builder.setEcReplicationConfig(((ECReplicationConfig) repConfig).toProto()); | ||
| } else { | ||
| builder.setType(repConfig.getReplicationType()); | ||
| builder.setFactor(((ReplicatedReplicationConfig) repConfig) | ||
| .getReplicationFactor()); |
Contributor
There was a problem hiding this comment.
repConfig.getReplicationType() called twice instead we can call once and store into a local and use that.
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?
Unified SCM list container on
SCMListContainerRequestProtoso one message carries paging and filters, and route client/server code throughScmListContainerRequestCodec+ListContainerQuery.Drop the old
listContainer(long, …)overloads fromStorageContainerLocationProtocol, the client side PB translator, andSCMClientProtocolServer; keep thin@Deprecatedwrappers onScmClient/ContainerOperationClientthat build the proto.New list filters can be added as optional proto fields plus codec/server logic, without new Java overloads on the core protocol.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15121
How was this patch tested?
CI: https://github.com/sarvekshayr/ozone/actions/runs/24960197016