MAPREDUCE-6610. JobHistoryEventHandler should not swallow timeline response. Contributed by Li Lu
This commit is contained in:
parent
45c763ad61
commit
d0d7c22168
@ -698,6 +698,9 @@ Release 2.8.0 - UNRELEASED
|
|||||||
MAPREDUCE-6614. Remove unnecessary code in TestMapreduceConfigFields.
|
MAPREDUCE-6614. Remove unnecessary code in TestMapreduceConfigFields.
|
||||||
(Kai Sasaki via aajisaka)
|
(Kai Sasaki via aajisaka)
|
||||||
|
|
||||||
|
MAPREDUCE-6610. JobHistoryEventHandler should not swallow timeline response
|
||||||
|
(Li Lu via jianhe)
|
||||||
|
|
||||||
Release 2.7.3 - UNRELEASED
|
Release 2.7.3 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
@ -63,6 +64,7 @@
|
|||||||
import org.apache.hadoop.util.StringUtils;
|
import org.apache.hadoop.util.StringUtils;
|
||||||
import org.apache.hadoop.yarn.api.records.timeline.TimelineEntity;
|
import org.apache.hadoop.yarn.api.records.timeline.TimelineEntity;
|
||||||
import org.apache.hadoop.yarn.api.records.timeline.TimelineEvent;
|
import org.apache.hadoop.yarn.api.records.timeline.TimelineEvent;
|
||||||
|
import org.apache.hadoop.yarn.api.records.timeline.TimelinePutResponse;
|
||||||
import org.apache.hadoop.yarn.client.api.TimelineClient;
|
import org.apache.hadoop.yarn.client.api.TimelineClient;
|
||||||
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
||||||
import org.apache.hadoop.yarn.event.EventHandler;
|
import org.apache.hadoop.yarn.event.EventHandler;
|
||||||
@ -1012,7 +1014,21 @@ private void processEventForTimelineServer(HistoryEvent event, JobId jobId,
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
timelineClient.putEntities(tEntity);
|
TimelinePutResponse response = timelineClient.putEntities(tEntity);
|
||||||
|
List<TimelinePutResponse.TimelinePutError> errors = response.getErrors();
|
||||||
|
if (errors.size() == 0) {
|
||||||
|
if (LOG.isDebugEnabled()) {
|
||||||
|
LOG.debug("Timeline entities are successfully put in event " + event
|
||||||
|
.getEventType());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (TimelinePutResponse.TimelinePutError error : errors) {
|
||||||
|
LOG.error(
|
||||||
|
"Error when publishing entity [" + error.getEntityType() + ","
|
||||||
|
+ error.getEntityId() + "], server side error code: "
|
||||||
|
+ error.getErrorCode());
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
LOG.error("Error putting entity " + tEntity.getEntityId() + " to Timeline"
|
LOG.error("Error putting entity " + tEntity.getEntityId() + " to Timeline"
|
||||||
+ "Server", ex);
|
+ "Server", ex);
|
||||||
|
Loading…
Reference in New Issue
Block a user