Skip to content

HDDS-15191. Add ScmInvoker subclasses for the remaining SCMHandler(s)#10252

Open
YutaLin wants to merge 4 commits into
apache:masterfrom
YutaLin:HDDS-15191_Add_ScmInvoker_subclasses_for_the_remaining_SCMHandlers
Open

HDDS-15191. Add ScmInvoker subclasses for the remaining SCMHandler(s)#10252
YutaLin wants to merge 4 commits into
apache:masterfrom
YutaLin:HDDS-15191_Add_ScmInvoker_subclasses_for_the_remaining_SCMHandlers

Conversation

@YutaLin
Copy link
Copy Markdown
Contributor

@YutaLin YutaLin commented May 12, 2026

What changes were proposed in this pull request?

The remaining SCMHandler(s) are:

  • FinalizationStateManager
  • SecretKeyState
  • SequenceIdGenerator$StateManager
  • StatefulServiceStateManager

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-15191

How was this patch tested?

CI(https://github.com/YutaLin/ozone/actions/runs/25711803021)

@YutaLin
Copy link
Copy Markdown
Contributor Author

YutaLin commented May 12, 2026

Hi @Russole, can you help me review this? Thanks!

Copy link
Copy Markdown
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

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

@YutaLin , thanks for working on this! Please see the comments inlined and also https://issues.apache.org/jira/secure/attachment/13082261/10252_review.patch

import org.apache.ratis.protocol.Message;

/** Code generated for {@link StateManager}. Do not modify. */
public class SequenceIdStateManagerInvoker extends ScmInvoker<StateManager> {
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.

Let's use the full outer class name SequenceIdGeneratorStateManagerInvoker.

We should also fix ScmInvokerCodeGenerator.

@Override
public Boolean allocateBatch(String arg0, Long arg1, Long arg2) throws SCMException {
final Object[] args = {arg0, arg1, arg2};
return (Boolean) invoker.invokeReplicateDirect(ReplicateMethod.allocateBatch, args);
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.

We should fix ScmInvokerCodeGenerator for the casting.

}

@Override
public void reinitialize(Table<String, Long> arg0) throws IOException {
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.

Please don't manually add the generic types for the generated code. It is hard to maintain.

It is unfortunate that we cannot get generic types from reflection since they are compile time information but not runtime information.

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