HDDS-15191. Add ScmInvoker subclasses for the remaining SCMHandler(s)#10252
HDDS-15191. Add ScmInvoker subclasses for the remaining SCMHandler(s)#10252YutaLin wants to merge 4 commits into
Conversation
|
Hi @Russole, can you help me review this? Thanks! |
szetszwo
left a comment
There was a problem hiding this comment.
@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> { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
We should fix ScmInvokerCodeGenerator for the casting.
| } | ||
|
|
||
| @Override | ||
| public void reinitialize(Table<String, Long> arg0) throws IOException { |
There was a problem hiding this comment.
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.
What changes were proposed in this pull request?
The remaining SCMHandler(s) are:
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)