Skip to content

Commit

Permalink
allow fallback in heartbeat when the task id is lacking
Browse files Browse the repository at this point in the history
relates to #148
  • Loading branch information
costin committed Apr 8, 2014
1 parent 89eaf27 commit f52c6db
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main/java/org/elasticsearch/hadoop/mr/HeartBeat.java
Expand Up @@ -50,14 +50,16 @@ class HeartBeat {
this.log = log;
TaskID taskID = TaskID.forName(HadoopCfgUtils.getTaskId(cfg));

String taskId;
if (taskID == null) {
log.error(String.format("Cannot determine task id - current properties are %s", HadoopCfgUtils.asProperties(cfg)));
log.warn("Cannot determine task id...");
taskId = "<unknown>";
}
else {
taskId = "" + taskID.getId();
}

Assert.notNull(taskID,
"Unable to determine task id - please report your distro/setting through the issue tracker");

this.id = taskID.toString();
id = taskId;
}


Expand Down

0 comments on commit f52c6db

Please sign in to comment.