YARN-11435. [Router] FederationStateStoreFacade is not reinitialized with Router conf.#5967
YARN-11435. [Router] FederationStateStoreFacade is not reinitialized with Router conf.#5967slfan1989 merged 3 commits intoapache:trunkfrom
Conversation
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
@goiri Can you help review this pr? Thank you very much! |
| public static FederationStateStoreFacade getInstance() { | ||
| return FACADE; | ||
| public static FederationStateStoreFacade getInstance(Configuration conf) { | ||
| if(facade == null) { |
There was a problem hiding this comment.
Can we exit early?
if (facade != null) {
return facade;
}
There was a problem hiding this comment.
Thank you very much for your help in reviewing the code! I will improve this part of the code.
| policyConfiguration) throws YarnException { | ||
| FederationStateStoreFacade goodFacade = FederationStateStoreFacade | ||
| .getInstance(); | ||
| .getInstance(new Configuration()); |
There was a problem hiding this comment.
Can we have an empty getInstance() that does the new Configuration?
There was a problem hiding this comment.
Thanks for your suggestion! I will provide an empty getInstance.
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
…with Router conf.
3c28d30 to
ef83c6d
Compare
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
@goiri Thank you very much for your help in reviewing the code! I will continue to follow up YARN-11433 And YARN-11434. |
…with Router conf. (apache#5967) Contributed by Shilun Fan. Reviewed-by: Inigo Goiri <inigoiri@apache.org> Signed-off-by: Shilun Fan <slfan1989@apache.org>
Description of PR
JIRA: YARN-11435. [Router] FederationStateStoreFacade is not reinitialized with Router conf.
When implementing the FederationStateStoreFacade, we opted for the singleton pattern. However, our FederationStateStoreFacade singleton implementation used a newly created Configuration when creating the singleton, without considering the configuration differences of the calling class. In this PR, we have refactored this portion of the code using the Double Checked Locking method of the singleton pattern, allowing the FederationStateStoreFacade to be aware of the configuration differences of the calling class.
How was this patch tested?
Junit Test.
For code changes:
LICENSE,LICENSE-binary,NOTICE-binaryfiles?