Skip to content

Commit

Permalink
Merge pull request tony-framework#5 from linkedin/fixUpdateTrackingURL
Browse files Browse the repository at this point in the history
Update reflection for updateTrackingURL
  • Loading branch information
Keqiu Hu authored Sep 18, 2018
2 parents 8cbbf6d + 16d8f79 commit 40d274a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ dependency-reduced-pom.xml
out/
target
tony-final.xml
tony.xml
Original file line number Diff line number Diff line change
Expand Up @@ -829,24 +829,13 @@ private String registerTensorBoardUrlToRM(String spec) throws Exception {
try {
// Post YARN-7974 or Hadoop 3.1.2 release
// amRMClient.updateTrackingUrl(spec);
} catch (NoSuchMethodError nsme) {
// Pre YARN-7974
YarnClient yarnClient = YarnClient.createYarnClient();
yarnClient.init(yarnConf);
if (!insecureMode) {
String fileLocation = System.getenv(UserGroupInformation.HADOOP_TOKEN_FILE_LOCATION);
Credentials cred = Credentials.readTokenStorageFile(new File(fileLocation), yarnConf);
for (Token<? extends TokenIdentifier> token : cred.getAllTokens()) {
UserGroupInformation.getCurrentUser().addToken(token);
}
for (Token token : UserGroupInformation.getCurrentUser().getTokens()) {
LOG.info("Current user's token : " + token);
}
}
yarnClient.start();
//noinspection JavaReflectionMemberAccess
Method method = YarnClient.class.getMethod("updateTrackingURL", String.class, String.class);
method.invoke(yarnClient, appIdString, spec);
Method method = YarnClient.class.getMethod("updateTrackingURL", String.class);
method.invoke(yarnClient, spec);
} catch (NoSuchMethodException nsme) {
LOG.warn("This Hadoop version doesn't have the YARN-7974 patch, TonY won't register TensorBoard URL with"
+ "application's tracking URL");
}
return "SUCCEEDED";
} else {
Expand Down

0 comments on commit 40d274a

Please sign in to comment.