Skip to content

Commit 1d34b59

Browse files
committed
Add more information in log
1 parent 5f8ac9d commit 1d34b59

File tree

1 file changed

+9
-5
lines changed
  • hadoop-submarine/hadoop-submarine-core/src/main/java/org/apache/hadoop/yarn/submarine/client/cli

1 file changed

+9
-5
lines changed

hadoop-submarine/hadoop-submarine-core/src/main/java/org/apache/hadoop/yarn/submarine/client/cli/KillJobCli.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,23 @@ private void parseCommandLineAndGetKillJobParameters(String[] args)
6767
ParametersHolder.createWithCmdLine(cli, Command.KILL_JOB);
6868
parametersHolder.updateParameters(clientContext);
6969
} catch (ParseException e) {
70+
LOG.error(("Error parsing command-line options: " + e.getMessage()));
7071
printUsages();
7172
}
7273
}
7374

7475
@VisibleForTesting
75-
protected boolean KillJob() throws IOException, YarnException {
76+
protected boolean killJob() throws IOException, YarnException {
7677
String jobName = getParameters().getName();
7778
AppAdminClient appAdminClient = AppAdminClient
7879
.createAppAdminClient(DEFAULT_TYPE, clientContext.getYarnConfig());
7980

80-
if (appAdminClient.actionStop(jobName) != 0
81-
|| appAdminClient.actionDestroy(jobName) != 0) {
82-
LOG.error("Fail to kill job !");
81+
if (appAdminClient.actionStop(jobName) != 0) {
82+
LOG.error("appAdminClient fail to stop application");
83+
return false;
84+
}
85+
if (appAdminClient.actionDestroy(jobName) != 0) {
86+
LOG.error("appAdminClient fail to destroy application");
8387
return false;
8488
}
8589

@@ -100,7 +104,7 @@ public int run(String[] args) throws ParseException, IOException,
100104
return 0;
101105
}
102106
parseCommandLineAndGetKillJobParameters(args);
103-
if (KillJob() == true) {
107+
if (killJob() == true) {
104108
LOG.info("Kill job successfully !");
105109
}
106110
return 0;

0 commit comments

Comments
 (0)