in core/src/main/java/com/twitter/elephantbird/util/ExecuteOnClusterTool.java [75:101]
protected void map(NullWritable key, NullWritable value, Context context)
throws IOException, InterruptedException {
ExecuteOnClusterTool tool;
try {
tool = (ExecuteOnClusterTool) Class.forName(
HadoopCompat.getConfiguration(context).get(IMPL_KEY)).newInstance();
} catch (InstantiationException e) {
throw new IOException(e);
} catch (IllegalAccessException e) {
throw new IOException(e);
} catch (ClassNotFoundException e) {
throw new IOException(e);
}
TaskHeartbeatThread beat = new TaskHeartbeatThread(context) {
@Override
protected void progress() {
LOG.info("Sending heartbeat");
}
};
try {
beat.start();
tool.execute(context);
} finally {
beat.stop();
}
}