Skip to content

Commit

Permalink
fix spotless error
Browse files Browse the repository at this point in the history
  • Loading branch information
maobaolong committed Jan 2, 2025
1 parent 1399739 commit 1a8af58
Showing 1 changed file with 20 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,26 @@ public void run(Map<String, String> localConf) throws Exception {
localConf.put(Constants.KEY_YARN_APP_ID, appId.toString());
applicationSubmissionContext.setApplicationName("UniffleMockClientOnYarn");

Runtime.getRuntime().addShutdownHook(new Thread(() -> {
System.out.println("Received Ctrl+C, terminating application...");

try {
yarnClient.killApplication(appId);
System.out.println("Application killed: " + appId);
} catch (Exception e) {
e.printStackTrace();
}

try {
ApplicationReport report = yarnClient.getApplicationReport(appId);
System.out.println("Application status: " + report.getYarnApplicationState());
} catch (Exception e) {
e.printStackTrace();
}
}));
Runtime.getRuntime()
.addShutdownHook(
new Thread(
() -> {
System.out.println("Received Ctrl+C, terminating application...");

try {
yarnClient.killApplication(appId);
System.out.println("Application killed: " + appId);
} catch (Exception e) {
e.printStackTrace();
}

try {
ApplicationReport report = yarnClient.getApplicationReport(appId);
System.out.println("Application status: " + report.getYarnApplicationState());
} catch (Exception e) {
e.printStackTrace();
}
}));

// copy jar to hdfs
String jarLocalPathStr = Utils.getCurrentJarPath(UniffleMockClientOnYarnClient.class);
Expand Down

0 comments on commit 1a8af58

Please sign in to comment.