Repository: tez Updated Branches: refs/heads/master 91279010b -> e6be19695
TEZ-3337. Do not log empty fields of TaskAttemptFinishedEvent to avoid confusion. (Zhiyuan Yang via hitesh) Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/e6be1969 Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/e6be1969 Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/e6be1969 Branch: refs/heads/master Commit: e6be196951307057dc8561441996445232edfa24 Parents: 9127901 Author: Hitesh Shah <[email protected]> Authored: Wed Jul 13 10:52:29 2016 -0700 Committer: Hitesh Shah <[email protected]> Committed: Wed Jul 13 10:52:29 2016 -0700 ---------------------------------------------------------------------- CHANGES.txt | 2 ++ .../events/TaskAttemptFinishedEvent.java | 12 +++++------ .../TestHistoryEventsProtoConversion.java | 22 ++++++++++++++++++++ 3 files changed, 30 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/e6be1969/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 9aab833..ff57f62 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -7,6 +7,7 @@ INCOMPATIBLE CHANGES ALL CHANGES: + TEZ-3337. Do not log empty fields of TaskAttemptFinishedEvent to avoid confusion. TEZ-3303. Have ShuffleVertexManager consume more precise partition stats. TEZ-1248. Reduce slow-start should special case 1 reducer runs. TEZ-3327. ATS Parser: Populate config details available in dag. @@ -80,6 +81,7 @@ INCOMPATIBLE CHANGES ALL CHANGES: + TEZ-3337. Do not log empty fields of TaskAttemptFinishedEvent to avoid confusion. TEZ-1248. Reduce slow-start should special case 1 reducer runs. Release 0.8.4: 2016-07-08 http://git-wip-us.apache.org/repos/asf/tez/blob/e6be1969/tez-dag/src/main/java/org/apache/tez/dag/history/events/TaskAttemptFinishedEvent.java ---------------------------------------------------------------------- diff --git a/tez-dag/src/main/java/org/apache/tez/dag/history/events/TaskAttemptFinishedEvent.java b/tez-dag/src/main/java/org/apache/tez/dag/history/events/TaskAttemptFinishedEvent.java index 5a9d8c9..e9100e8 100644 --- a/tez-dag/src/main/java/org/apache/tez/dag/history/events/TaskAttemptFinishedEvent.java +++ b/tez-dag/src/main/java/org/apache/tez/dag/history/events/TaskAttemptFinishedEvent.java @@ -256,12 +256,12 @@ public class TaskAttemptFinishedEvent implements HistoryEvent { + ", finishTime=" + finishTime + ", timeTaken=" + (finishTime - startTime) + ", status=" + state.name() - + ", taskFailureType=" + taskFailureType - + ", errorEnum=" + (error != null ? error.name() : "") - + ", diagnostics=" + diagnostics - + ", containerId=" + (containerId != null ? containerId.toString() : "") - + ", nodeId=" + (nodeId != null ? nodeId.toString() : "") - + ", nodeHttpAddress=" + (nodeHttpAddress != null ? nodeHttpAddress : "") + + (taskFailureType != null ? ", taskFailureType=" + taskFailureType : "") + + (error != null ? ", errorEnum=" + error.name() : "") + + (diagnostics != null ? ", diagnostics=" + diagnostics : "") + + (containerId != null ? ", containerId=" + containerId.toString() : "") + + (nodeId != null ? ", nodeId=" + nodeId.toString() : "") + + (nodeHttpAddress != null ? ", nodeHttpAddress=" + nodeHttpAddress : "") + counterStr; } http://git-wip-us.apache.org/repos/asf/tez/blob/e6be1969/tez-dag/src/test/java/org/apache/tez/dag/history/events/TestHistoryEventsProtoConversion.java ---------------------------------------------------------------------- diff --git a/tez-dag/src/test/java/org/apache/tez/dag/history/events/TestHistoryEventsProtoConversion.java b/tez-dag/src/test/java/org/apache/tez/dag/history/events/TestHistoryEventsProtoConversion.java index 7d3faf9..67a927e 100644 --- a/tez-dag/src/test/java/org/apache/tez/dag/history/events/TestHistoryEventsProtoConversion.java +++ b/tez-dag/src/test/java/org/apache/tez/dag/history/events/TestHistoryEventsProtoConversion.java @@ -18,6 +18,7 @@ package org.apache.tez.dag.history.events; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.fail; import java.nio.ByteBuffer; @@ -622,6 +623,27 @@ public class TestHistoryEventsProtoConversion { Assert.assertEquals(event.getTaskFailureType(), deserializedEvent.getTaskFailureType()); logEvents(event, deserializedEvent); } + { + // toString shouldn't include null fields + TezTaskAttemptID taId = + TezTaskAttemptID.getInstance(TezTaskID.getInstance(TezVertexID.getInstance( + TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 111), 0), 0); + long timestamp = 1024L; + List<DataEventDependencyInfo> events = Lists.newArrayList(); + events.add(new DataEventDependencyInfo(timestamp, taId)); + events.add(new DataEventDependencyInfo(timestamp, taId)); + TaskAttemptFinishedEvent event = new TaskAttemptFinishedEvent( + TezTaskAttemptID.getInstance(TezTaskID.getInstance(TezVertexID.getInstance( + TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 111), 1), 1), + "vertex1", 10001l, 1000434444l, TaskAttemptState.SUCCEEDED, null, null, + null, new TezCounters(), events, null, 0, null, 0, null, null, null, null, null); + String eventStr = event.toString(); + String[] items = new String[] {"taskFailureType", "errorEnum", "diagnostics", "containerId", + "nodeId", "nodeHttpAddress"}; + for (String item : items) { + assertFalse(eventStr.contains(item)); + } + } } @SuppressWarnings("deprecation")
