-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
YARN-6972. Adding RM ClusterId in AppInfo. #4673
Conversation
💔 -1 overall
This message was automatically generated. |
@@ -182,6 +188,16 @@ public AppInfo(ResourceManager rm, RMApp app, Boolean hasAccess, | |||
this.finalStatus = app.getFinalApplicationStatus(); | |||
this.clusterId = ResourceManager.getClusterTimeStamp(); | |||
if (hasAccess) { | |||
if(rm != null && rm.getConfig() != null) { | |||
try { | |||
subClusterId = new SubClusterIdInfo( |
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.
One line.
Too many parentheses.
We should extract a little.
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.
Your suggestion is correct, I am going to modify the code!
try { | ||
subClusterId = new SubClusterIdInfo( | ||
(YarnConfiguration.getClusterId(rm.getConfig()))); | ||
rmClusterId = |
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.
One line
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 will fix it.
@@ -1825,6 +1826,8 @@ public void verifyAppInfo(JSONObject info, RMApp app, boolean hasResourceReqs) | |||
} | |||
assertEquals("incorrect number of elements", expectedNumberOfElements, | |||
info.length()); | |||
assertEquals("rmClusterId is incorrect", "subCluster1", |
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.
One line
@@ -182,6 +188,16 @@ public AppInfo(ResourceManager rm, RMApp app, Boolean hasAccess, | |||
this.finalStatus = app.getFinalApplicationStatus(); | |||
this.clusterId = ResourceManager.getClusterTimeStamp(); | |||
if (hasAccess) { | |||
if(rm != null && rm.getConfig() != null) { |
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.
Space after if
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 will fix it.
@@ -82,6 +87,7 @@ public class AppInfo { | |||
protected String trackingUrl; | |||
protected String diagnostics; | |||
protected long clusterId; | |||
private String rmClusterId; |
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.
Kind of weird that everything else is protected.
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@goiri I saw the checkstyle problem, but I personally feel that it can be ignored, and I prefer to change the variable to protected. |
@slfan1989 I'm fine ignoring that checkstyle. |
@goiri Thank you very much for your help reviewing the code! |
JIRA: YARN-6972. Adding RM ClusterId in AppInfo.
The content completed by this pr is relatively simple. I refer to the code of YARN-6973 and the Patch of YARN-6972.
YARN-6972 does the following:
When queries appInfo, it will try to read rmClusterId from the current YARN configuration file to identify this application which Cluster does it belong to.