jihoonson commented on a change in pull request #6828: Kill Hadoop MR task on
kill of Hadoop ingestion task
URL: https://github.com/apache/incubator-druid/pull/6828#discussion_r248163181
##########
File path:
indexing-service/src/main/java/org/apache/druid/indexing/common/task/HadoopIndexTask.java
##########
@@ -412,6 +430,57 @@ private TaskStatus runInternal(TaskToolbox toolbox)
throws Exception
}
}
+ @Override
+ public void stopGracefully()
+ {
+ final ClassLoader oldLoader =
Thread.currentThread().getContextClassLoader();
+ ObjectMapper objectMapper = new ObjectMapper();
+ File hadoopJobIdFile = new File(getHadoopJobIdFileName());
+ String jobId = null;
+
+ try {
+ if (hadoopJobIdFile.exists()) {
+ jobId = objectMapper.readValue(hadoopJobIdFile, String.class);
+ }
+ }
+ catch (Exception e) {
+ log.info("Exeption while reading json file from path: " +
hadoopJobIdFile);
+ log.error(Throwables.getStackTraceAsString(e));
Review comment:
You don't need to print two logs. Please replace them with `log.warn(e,
"Exeption while reading Hadoop Job ID from: %s", hadoopJobIdFile);`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]