-
Notifications
You must be signed in to change notification settings - Fork 600
HDDS-14974. Change SCMStateMachine to use ScmInvoker #10079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5299231
HDDS-14974. Change SCMStateMachine to use ScmInvoker
Russole 498ad64
Add getReturnType() to DeletedBlockStateManagerInvoker
Russole 7991aae
Change getReturnType() method
Russole 620cac6
Fix CheckStyle
Russole 755c900
Change the format of getReturnType()
Russole ee9f481
format getReturnType()
Russole 95c163f
Add getReturnType to ScmInvokerCodeGenerator
Russole 9de155f
Fix generator formatting to pass checkstyle
Russole a65a5c1
Fix implementation based on comment
Russole 36da113
Restore ScmInvokerCodeGenerator
Russole d00a2cf
Delete getReturn() method
Russole 90c5052
Remove redundant spaces
Russole 874dad7
Updated to return Message.EMPTY
Russole 8d91412
Update Implementation
Russole 77602d4
Avoid invoking invokers via reflection in SCMHAManagerStub
Russole File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,7 @@ | |
| import org.apache.hadoop.hdds.scm.AddSCMRequest; | ||
| import org.apache.hadoop.hdds.scm.RemoveSCMRequest; | ||
| import org.apache.hadoop.hdds.scm.ScmConfigKeys; | ||
| import org.apache.hadoop.hdds.scm.ha.invoker.ScmInvoker; | ||
| import org.apache.hadoop.hdds.scm.server.StorageContainerManager; | ||
| import org.apache.hadoop.hdds.security.SecurityConfig; | ||
| import org.apache.hadoop.ozone.OzoneConsts; | ||
|
|
@@ -223,6 +224,9 @@ public SCMStateMachine getSCMStateMachine() { | |
| @Override | ||
| public void registerStateMachineHandler(final RequestType handlerType, | ||
| final Object handler) { | ||
| if (handler instanceof ScmInvoker) { | ||
| stateMachine.registerInvoker(handlerType, (ScmInvoker) handler); | ||
| } | ||
| stateMachine.registerHandler(handlerType, handler); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should add |
||
| } | ||
|
|
||
|
|
||
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this method is called with
ScmInvoker, ratherinvoker.getImpl().ozone/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMRatisServer.java
Lines 75 to 76 in 874dad7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right -- we need to pass invoker but not getImpl().