You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
JIRA: YARN-11371. [Federation] Refactor FederationInterceptorREST#createNewApplication\submitApplication Use FederationActionRetry.
Overview
We use FederationActionRetry to refactor the createNewApplication and submitApplication methods of FederationClientInterceptor. In the process of reading the code, I found that the createNewApplication and submitApplication methods of FederationInterceptorREST should also be optimized.
Improved Effect
After refactoring the code, there are the following benefits:
The readability of the code is enhanced.
Avoid duplicate code.
Modified content
Extract the functions used by (FederationClientInterceptor and FederationInterceptorREST), such as getRandomActiveSubCluster, getActiveSubClustersCount, getRetryNumbers into FederationStateStoreFacade.
Encapsulate the operations of statestore in createNewApplication and submitApplication into FederationStateStoreFacade, which is convenient for invocation of FederationClientInterceptor and FederationInterceptorREST.
Provide invokeGetNewApplication and invokeSubmitApplication in FederationIntercptorREST and call with FederationActionRetry.
@goiri Can you help merge this PR into the trunk branch? Thank you very much! I want to use FederationActionRetry in createNewReservation, submitReservation 2 methods, I can implement it directly in #4892.
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.
JIRA: YARN-11371. [Federation] Refactor FederationInterceptorREST#createNewApplication\submitApplication Use FederationActionRetry.
Overview
We use
FederationActionRetry
to refactor the createNewApplication and submitApplication methods ofFederationClientInterceptor
. In the process of reading the code, I found that thecreateNewApplication
andsubmitApplication
methods ofFederationInterceptorREST
should also be optimized.Improved Effect
After refactoring the code, there are the following benefits:
Modified content
getRandomActiveSubCluster
,getActiveSubClustersCount
,getRetryNumbers
into FederationStateStoreFacade.createNewApplication
andsubmitApplication
intoFederationStateStoreFacade
, which is convenient for invocation ofFederationClientInterceptor
andFederationInterceptorREST
.invokeGetNewApplication
andinvokeSubmitApplication
inFederationIntercptorREST
and call withFederationActionRetry
.