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_r248162354
##########
File path:
indexing-hadoop/src/main/java/org/apache/druid/indexer/JobHelper.java
##########
@@ -349,6 +352,22 @@ public static void ensurePaths(HadoopDruidIndexerConfig
config)
public static boolean runSingleJob(Jobby job, HadoopDruidIndexerConfig
config)
{
+ String hadoopJobId = job.submitAndGetHadoopJobId();
+ ObjectMapper objectMapper = new ObjectMapper();
+ String hadoopJobIdFileName = config.getHadoopJobIdFileName();
+
+ if (hadoopJobIdFileName != null) {
+ try {
+ objectMapper.writeValue(new OutputStreamWriter(
Review comment:
The valid format should be
```java
if (hadoopJobIdFileName != null) {
try {
objectMapper.writeValue(
new OutputStreamWriter(new FileOutputStream(new
File(hadoopJobIdFileName)), StandardCharsets.UTF_8),
hadoopJobId
);
log.info("MR job id: %s is written to the file: %s", hadoopJobId,
hadoopJobIdFileName);
}
catch (IOException e) {
log.error(e, "Error writing job id: %s to the file: %s.",
hadoopJobId, hadoopJobIdFileName);
}
}
```
----------------------------------------------------------------
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]