}
return ttts;
}
public static ThriftTaskStatus toThrift(TaskStatus ts) {
ThriftTaskStatus tts = new ThriftTaskStatus();
tts.setCounters(new ThriftGroupList(toThrift(ts.getCounters())));
tts.setDiagnosticInfo(ts.getDiagnosticInfo());
tts.setFinishTime(ts.getFinishTime());
tts.setOutputSize(ts.getOutputSize());
tts.setPhase(toThrift(ts.getPhase()));
tts.setProgress(ts.getProgress());
tts.setStartTime(ts.getStartTime());
tts.setStateString(ts.getStateString());
tts.setTaskID(toThrift(ts.getTaskID()));
tts.setTaskTracker(ts.getTaskTracker());
tts.setState(toThrift(ts.getRunState()));
if (ts.getIsMap()) {
// not available in 0.20: tts.setMapFinishTime(ts.getMapFinishTime());
tts.setShuffleFinishTime(0);
tts.setSortFinishTime(0);
} else {
tts.setMapFinishTime(0);
tts.setShuffleFinishTime(ts.getShuffleFinishTime());
tts.setSortFinishTime(ts.getSortFinishTime());
}
return tts;
}