Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
import java.security.PrivilegedExceptionAction;
import java.util.concurrent.atomic.AtomicBoolean;

import org.apache.commons.lang.StringUtils;
import org.apache.hadoop.fs.statistics.IOStatisticsContext;
import org.apache.hadoop.fs.statistics.IOStatisticsLogging;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.tez.common.CallableWithNdc;
import org.apache.tez.common.TezCommonUtils;
Expand Down Expand Up @@ -75,6 +78,7 @@ public TaskRunner2CallableResult run() throws Exception {
LOG.info("Initializing task" + ", taskAttemptId={}", task.getTaskAttemptID());
TezUtilsInternal.setHadoopCallerContext(task.getHadoopShim(), task.getTaskAttemptID());
TezCommonUtils.logCredentials(LOG, ugi.getCredentials(), "taskInit");
IOStatisticsContext.getCurrentIOStatisticsContext().reset();
task.initialize();

if (!stopRequested.get() && !Thread.currentThread().isInterrupted()) {
Expand Down Expand Up @@ -116,6 +120,11 @@ public TaskRunner2CallableResult run() throws Exception {
// For a successful task, however, this should be almost no delay since close has already happened.
maybeFixInterruptStatus();
LOG.info("Cleaning up task {}, stopRequested={}", task.getTaskAttemptID(), stopRequested.get());
String ioStats = IOStatisticsLogging.ioStatisticsToPrettyString(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. you know you can take a snapshot of it and serialize it as java serializable or json; been some discussion about making a Writable too.

IOStatisticsContext.getCurrentIOStatisticsContext().getIOStatistics());
if (StringUtils.isNotEmpty(ioStats)) {
LOG.info("TaskAttemptId={}, {}", task.getTaskAttemptID(), ioStats);
}
task.getOutputContexts().forEach(outputContext
-> outputContext.trapEvents(new TezTrapEventHandler(outputContext,
this.tezUmbilical)));
Expand Down