Skip to content

HDDS-15121. Unify SCM list container on SCMListContainerRequestProto#10144

Open
sarvekshayr wants to merge 1 commit intoapache:masterfrom
sarvekshayr:HDDS-15121
Open

HDDS-15121. Unify SCM list container on SCMListContainerRequestProto#10144
sarvekshayr wants to merge 1 commit intoapache:masterfrom
sarvekshayr:HDDS-15121

Conversation

@sarvekshayr
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Unified SCM list container on SCMListContainerRequestProto so one message carries paging and filters, and route client/server code through ScmListContainerRequestCodec + ListContainerQuery.

Drop the old listContainer(long, …) overloads from StorageContainerLocationProtocol, the client side PB translator, and SCMClientProtocolServer; keep thin @Deprecated wrappers on ScmClient / ContainerOperationClient that 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

@sarvekshayr sarvekshayr requested a review from errose28 April 27, 2026 11:39
Copy link
Copy Markdown
Contributor

@sreejasahithi sreejasahithi left a comment

Choose a reason for hiding this comment

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

Thanks @sarvekshayr

Comment on lines +131 to +133
containerOperationClient.listContainer(ScmListContainerRequestCodec.toProto(
0L, 1_000_000, null, null, null, null, null, null))
.getContainerInfoList();
Copy link
Copy Markdown
Contributor

@sreejasahithi sreejasahithi Apr 27, 2026

Choose a reason for hiding this comment

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

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());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

repConfig.getReplicationType() called twice instead we can call once and store into a local and use that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants