MAPREDUCE-6388. Remove deprecation warnings from JobHistoryServer classes. Contributed by Ray Chiang.

This commit is contained in:
Tsuyoshi Ozawa 2015-06-08 15:06:10 -07:00
parent 960b8f19ca
commit 6afe20a7a4
24 changed files with 390 additions and 371 deletions

View File

@ -459,6 +459,9 @@ Release 2.8.0 - UNRELEASED
MAPREDUCE-6377. JHS sorting on state column not working in webUi. MAPREDUCE-6377. JHS sorting on state column not working in webUi.
(zhihai xu via devaraj) (zhihai xu via devaraj)
MAPREDUCE-6388. Remove deprecation warnings from JobHistoryServer classes
(Ray Chiang via ozawa).
Release 2.7.1 - UNRELEASED Release 2.7.1 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -120,65 +120,65 @@ public class TestEvents {
new ByteArrayInputStream(getEvents()))); new ByteArrayInputStream(getEvents())));
HistoryEvent e = reader.getNextEvent(); HistoryEvent e = reader.getNextEvent();
assertTrue(e.getEventType().equals(EventType.JOB_PRIORITY_CHANGED)); assertTrue(e.getEventType().equals(EventType.JOB_PRIORITY_CHANGED));
assertEquals("ID", ((JobPriorityChange) e.getDatum()).jobid.toString()); assertEquals("ID", ((JobPriorityChange) e.getDatum()).getJobid().toString());
e = reader.getNextEvent(); e = reader.getNextEvent();
assertTrue(e.getEventType().equals(EventType.JOB_STATUS_CHANGED)); assertTrue(e.getEventType().equals(EventType.JOB_STATUS_CHANGED));
assertEquals("ID", ((JobStatusChanged) e.getDatum()).jobid.toString()); assertEquals("ID", ((JobStatusChanged) e.getDatum()).getJobid().toString());
e = reader.getNextEvent(); e = reader.getNextEvent();
assertTrue(e.getEventType().equals(EventType.TASK_UPDATED)); assertTrue(e.getEventType().equals(EventType.TASK_UPDATED));
assertEquals("ID", ((TaskUpdated) e.getDatum()).taskid.toString()); assertEquals("ID", ((TaskUpdated) e.getDatum()).getTaskid().toString());
e = reader.getNextEvent(); e = reader.getNextEvent();
assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_KILLED)); assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_KILLED));
assertEquals(taskId, assertEquals(taskId,
((TaskAttemptUnsuccessfulCompletion) e.getDatum()).taskid.toString()); ((TaskAttemptUnsuccessfulCompletion) e.getDatum()).getTaskid().toString());
e = reader.getNextEvent(); e = reader.getNextEvent();
assertTrue(e.getEventType().equals(EventType.JOB_KILLED)); assertTrue(e.getEventType().equals(EventType.JOB_KILLED));
assertEquals("ID", assertEquals("ID",
((JobUnsuccessfulCompletion) e.getDatum()).jobid.toString()); ((JobUnsuccessfulCompletion) e.getDatum()).getJobid().toString());
e = reader.getNextEvent(); e = reader.getNextEvent();
assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_STARTED)); assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_STARTED));
assertEquals(taskId, assertEquals(taskId,
((TaskAttemptStarted) e.getDatum()).taskid.toString()); ((TaskAttemptStarted) e.getDatum()).getTaskid().toString());
e = reader.getNextEvent(); e = reader.getNextEvent();
assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_FINISHED)); assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_FINISHED));
assertEquals(taskId, assertEquals(taskId,
((TaskAttemptFinished) e.getDatum()).taskid.toString()); ((TaskAttemptFinished) e.getDatum()).getTaskid().toString());
e = reader.getNextEvent(); e = reader.getNextEvent();
assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_KILLED)); assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_KILLED));
assertEquals(taskId, assertEquals(taskId,
((TaskAttemptUnsuccessfulCompletion) e.getDatum()).taskid.toString()); ((TaskAttemptUnsuccessfulCompletion) e.getDatum()).getTaskid().toString());
e = reader.getNextEvent(); e = reader.getNextEvent();
assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_KILLED)); assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_KILLED));
assertEquals(taskId, assertEquals(taskId,
((TaskAttemptUnsuccessfulCompletion) e.getDatum()).taskid.toString()); ((TaskAttemptUnsuccessfulCompletion) e.getDatum()).getTaskid().toString());
e = reader.getNextEvent(); e = reader.getNextEvent();
assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_STARTED)); assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_STARTED));
assertEquals(taskId, assertEquals(taskId,
((TaskAttemptStarted) e.getDatum()).taskid.toString()); ((TaskAttemptStarted) e.getDatum()).getTaskid().toString());
e = reader.getNextEvent(); e = reader.getNextEvent();
assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_FINISHED)); assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_FINISHED));
assertEquals(taskId, assertEquals(taskId,
((TaskAttemptFinished) e.getDatum()).taskid.toString()); ((TaskAttemptFinished) e.getDatum()).getTaskid().toString());
e = reader.getNextEvent(); e = reader.getNextEvent();
assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_KILLED)); assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_KILLED));
assertEquals(taskId, assertEquals(taskId,
((TaskAttemptUnsuccessfulCompletion) e.getDatum()).taskid.toString()); ((TaskAttemptUnsuccessfulCompletion) e.getDatum()).getTaskid().toString());
e = reader.getNextEvent(); e = reader.getNextEvent();
assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_KILLED)); assertTrue(e.getEventType().equals(EventType.REDUCE_ATTEMPT_KILLED));
assertEquals(taskId, assertEquals(taskId,
((TaskAttemptUnsuccessfulCompletion) e.getDatum()).taskid.toString()); ((TaskAttemptUnsuccessfulCompletion) e.getDatum()).getTaskid().toString());
reader.close(); reader.close();
} }
@ -227,43 +227,43 @@ public class TestEvents {
private TaskAttemptUnsuccessfulCompletion getTaskAttemptUnsuccessfulCompletion() { private TaskAttemptUnsuccessfulCompletion getTaskAttemptUnsuccessfulCompletion() {
TaskAttemptUnsuccessfulCompletion datum = new TaskAttemptUnsuccessfulCompletion(); TaskAttemptUnsuccessfulCompletion datum = new TaskAttemptUnsuccessfulCompletion();
datum.attemptId = "attempt_1_2_r3_4_5"; datum.setAttemptId("attempt_1_2_r3_4_5");
datum.clockSplits = Arrays.asList(1, 2, 3); datum.setClockSplits(Arrays.asList(1, 2, 3));
datum.cpuUsages = Arrays.asList(100, 200, 300); datum.setCpuUsages(Arrays.asList(100, 200, 300));
datum.error = "Error"; datum.setError("Error");
datum.finishTime = 2; datum.setFinishTime(2L);
datum.hostname = "hostname"; datum.setHostname("hostname");
datum.rackname = "rackname"; datum.setRackname("rackname");
datum.physMemKbytes = Arrays.asList(1000, 2000, 3000); datum.setPhysMemKbytes(Arrays.asList(1000, 2000, 3000));
datum.taskid = taskId; datum.setTaskid(taskId);
datum.port = 1000; datum.setPort(1000);
datum.taskType = "REDUCE"; datum.setTaskType("REDUCE");
datum.status = "STATUS"; datum.setStatus("STATUS");
datum.counters = getCounters(); datum.setCounters(getCounters());
datum.vMemKbytes = Arrays.asList(1000, 2000, 3000); datum.setVMemKbytes(Arrays.asList(1000, 2000, 3000));
return datum; return datum;
} }
private JhCounters getCounters() { private JhCounters getCounters() {
JhCounters counters = new JhCounters(); JhCounters counters = new JhCounters();
counters.groups = new ArrayList<JhCounterGroup>(0); counters.setGroups(new ArrayList<JhCounterGroup>(0));
counters.name = "name"; counters.setName("name");
return counters; return counters;
} }
private FakeEvent getCleanupAttemptFinishedEvent() { private FakeEvent getCleanupAttemptFinishedEvent() {
FakeEvent result = new FakeEvent(EventType.CLEANUP_ATTEMPT_FINISHED); FakeEvent result = new FakeEvent(EventType.CLEANUP_ATTEMPT_FINISHED);
TaskAttemptFinished datum = new TaskAttemptFinished(); TaskAttemptFinished datum = new TaskAttemptFinished();
datum.attemptId = "attempt_1_2_r3_4_5"; datum.setAttemptId("attempt_1_2_r3_4_5");
datum.counters = getCounters(); datum.setCounters(getCounters());
datum.finishTime = 2; datum.setFinishTime(2L);
datum.hostname = "hostname"; datum.setHostname("hostname");
datum.rackname = "rackName"; datum.setRackname("rackName");
datum.state = "state"; datum.setState("state");
datum.taskid = taskId; datum.setTaskid(taskId);
datum.taskStatus = "taskStatus"; datum.setTaskStatus("taskStatus");
datum.taskType = "REDUCE"; datum.setTaskType("REDUCE");
result.setDatum(datum); result.setDatum(datum);
return result; return result;
} }
@ -272,16 +272,16 @@ public class TestEvents {
FakeEvent result = new FakeEvent(EventType.CLEANUP_ATTEMPT_STARTED); FakeEvent result = new FakeEvent(EventType.CLEANUP_ATTEMPT_STARTED);
TaskAttemptStarted datum = new TaskAttemptStarted(); TaskAttemptStarted datum = new TaskAttemptStarted();
datum.attemptId = "attempt_1_2_r3_4_5"; datum.setAttemptId("attempt_1_2_r3_4_5");
datum.avataar = "avatar"; datum.setAvataar("avatar");
datum.containerId = "containerId"; datum.setContainerId("containerId");
datum.httpPort = 10000; datum.setHttpPort(10000);
datum.locality = "locality"; datum.setLocality("locality");
datum.shufflePort = 10001; datum.setShufflePort(10001);
datum.startTime = 1; datum.setStartTime(1L);
datum.taskid = taskId; datum.setTaskid(taskId);
datum.taskType = "taskType"; datum.setTaskType("taskType");
datum.trackerName = "trackerName"; datum.setTrackerName("trackerName");
result.setDatum(datum); result.setDatum(datum);
return result; return result;
} }
@ -303,15 +303,15 @@ public class TestEvents {
FakeEvent result = new FakeEvent(EventType.SETUP_ATTEMPT_FINISHED); FakeEvent result = new FakeEvent(EventType.SETUP_ATTEMPT_FINISHED);
TaskAttemptFinished datum = new TaskAttemptFinished(); TaskAttemptFinished datum = new TaskAttemptFinished();
datum.attemptId = "attempt_1_2_r3_4_5"; datum.setAttemptId("attempt_1_2_r3_4_5");
datum.counters = getCounters(); datum.setCounters(getCounters());
datum.finishTime = 2; datum.setFinishTime(2L);
datum.hostname = "hostname"; datum.setHostname("hostname");
datum.rackname = "rackname"; datum.setRackname("rackname");
datum.state = "state"; datum.setState("state");
datum.taskid = taskId; datum.setTaskid(taskId);
datum.taskStatus = "taskStatus"; datum.setTaskStatus("taskStatus");
datum.taskType = "REDUCE"; datum.setTaskType("REDUCE");
result.setDatum(datum); result.setDatum(datum);
return result; return result;
} }
@ -319,16 +319,16 @@ public class TestEvents {
private FakeEvent getSetupAttemptStartedEvent() { private FakeEvent getSetupAttemptStartedEvent() {
FakeEvent result = new FakeEvent(EventType.SETUP_ATTEMPT_STARTED); FakeEvent result = new FakeEvent(EventType.SETUP_ATTEMPT_STARTED);
TaskAttemptStarted datum = new TaskAttemptStarted(); TaskAttemptStarted datum = new TaskAttemptStarted();
datum.attemptId = "ID"; datum.setAttemptId("ID");
datum.avataar = "avataar"; datum.setAvataar("avataar");
datum.containerId = "containerId"; datum.setContainerId("containerId");
datum.httpPort = 10000; datum.setHttpPort(10000);
datum.locality = "locality"; datum.setLocality("locality");
datum.shufflePort = 10001; datum.setShufflePort(10001);
datum.startTime = 1; datum.setStartTime(1L);
datum.taskid = taskId; datum.setTaskid(taskId);
datum.taskType = "taskType"; datum.setTaskType("taskType");
datum.trackerName = "trackerName"; datum.setTrackerName("trackerName");
result.setDatum(datum); result.setDatum(datum);
return result; return result;
} }
@ -356,8 +356,8 @@ public class TestEvents {
private FakeEvent getJobPriorityChangedEvent() { private FakeEvent getJobPriorityChangedEvent() {
FakeEvent result = new FakeEvent(EventType.JOB_PRIORITY_CHANGED); FakeEvent result = new FakeEvent(EventType.JOB_PRIORITY_CHANGED);
JobPriorityChange datum = new JobPriorityChange(); JobPriorityChange datum = new JobPriorityChange();
datum.jobid = "ID"; datum.setJobid("ID");
datum.priority = "priority"; datum.setPriority("priority");
result.setDatum(datum); result.setDatum(datum);
return result; return result;
} }
@ -365,8 +365,8 @@ public class TestEvents {
private FakeEvent getJobStatusChangedEvent() { private FakeEvent getJobStatusChangedEvent() {
FakeEvent result = new FakeEvent(EventType.JOB_STATUS_CHANGED); FakeEvent result = new FakeEvent(EventType.JOB_STATUS_CHANGED);
JobStatusChanged datum = new JobStatusChanged(); JobStatusChanged datum = new JobStatusChanged();
datum.jobid = "ID"; datum.setJobid("ID");
datum.jobStatus = "newStatus"; datum.setJobStatus("newStatus");
result.setDatum(datum); result.setDatum(datum);
return result; return result;
} }
@ -374,8 +374,8 @@ public class TestEvents {
private FakeEvent getTaskUpdatedEvent() { private FakeEvent getTaskUpdatedEvent() {
FakeEvent result = new FakeEvent(EventType.TASK_UPDATED); FakeEvent result = new FakeEvent(EventType.TASK_UPDATED);
TaskUpdated datum = new TaskUpdated(); TaskUpdated datum = new TaskUpdated();
datum.finishTime = 2; datum.setFinishTime(2L);
datum.taskid = "ID"; datum.setTaskid("ID");
result.setDatum(datum); result.setDatum(datum);
return result; return result;
} }

View File

@ -38,11 +38,11 @@ public class TestJobSummary {
JobId mockJobId = mock(JobId.class); JobId mockJobId = mock(JobId.class);
when(mockJobId.toString()).thenReturn("testJobId"); when(mockJobId.toString()).thenReturn("testJobId");
summary.setJobId(mockJobId); summary.setJobId(mockJobId);
summary.setJobSubmitTime(2); summary.setJobSubmitTime(2L);
summary.setJobLaunchTime(3); summary.setJobLaunchTime(3L);
summary.setFirstMapTaskLaunchTime(4); summary.setFirstMapTaskLaunchTime(4L);
summary.setFirstReduceTaskLaunchTime(5); summary.setFirstReduceTaskLaunchTime(5L);
summary.setJobFinishTime(6); summary.setJobFinishTime(6L);
summary.setNumFinishedMaps(1); summary.setNumFinishedMaps(1);
summary.setNumFailedMaps(0); summary.setNumFailedMaps(0);
summary.setNumFinishedReduces(1); summary.setNumFinishedReduces(1);

View File

@ -82,12 +82,12 @@ public class AMStartedEvent implements HistoryEvent {
ContainerId containerId, String nodeManagerHost, int nodeManagerPort, ContainerId containerId, String nodeManagerHost, int nodeManagerPort,
int nodeManagerHttpPort, String forcedJobStateOnShutDown, int nodeManagerHttpPort, String forcedJobStateOnShutDown,
long submitTime) { long submitTime) {
datum.applicationAttemptId = new Utf8(appAttemptId.toString()); datum.setApplicationAttemptId(new Utf8(appAttemptId.toString()));
datum.startTime = startTime; datum.setStartTime(startTime);
datum.containerId = new Utf8(containerId.toString()); datum.setContainerId(new Utf8(containerId.toString()));
datum.nodeManagerHost = new Utf8(nodeManagerHost); datum.setNodeManagerHost(new Utf8(nodeManagerHost));
datum.nodeManagerPort = nodeManagerPort; datum.setNodeManagerPort(nodeManagerPort);
datum.nodeManagerHttpPort = nodeManagerHttpPort; datum.setNodeManagerHttpPort(nodeManagerHttpPort);
this.forcedJobStateOnShutDown = forcedJobStateOnShutDown; this.forcedJobStateOnShutDown = forcedJobStateOnShutDown;
this.submitTime = submitTime; this.submitTime = submitTime;
} }
@ -107,7 +107,7 @@ public class AMStartedEvent implements HistoryEvent {
* @return the ApplicationAttemptId * @return the ApplicationAttemptId
*/ */
public ApplicationAttemptId getAppAttemptId() { public ApplicationAttemptId getAppAttemptId() {
return ConverterUtils.toApplicationAttemptId(datum.applicationAttemptId return ConverterUtils.toApplicationAttemptId(datum.getApplicationAttemptId()
.toString()); .toString());
} }
@ -115,35 +115,35 @@ public class AMStartedEvent implements HistoryEvent {
* @return the start time for the MRAppMaster * @return the start time for the MRAppMaster
*/ */
public long getStartTime() { public long getStartTime() {
return datum.startTime; return datum.getStartTime();
} }
/** /**
* @return the ContainerId for the MRAppMaster. * @return the ContainerId for the MRAppMaster.
*/ */
public ContainerId getContainerId() { public ContainerId getContainerId() {
return ConverterUtils.toContainerId(datum.containerId.toString()); return ConverterUtils.toContainerId(datum.getContainerId().toString());
} }
/** /**
* @return the node manager host. * @return the node manager host.
*/ */
public String getNodeManagerHost() { public String getNodeManagerHost() {
return datum.nodeManagerHost.toString(); return datum.getNodeManagerHost().toString();
} }
/** /**
* @return the node manager port. * @return the node manager port.
*/ */
public int getNodeManagerPort() { public int getNodeManagerPort() {
return datum.nodeManagerPort; return datum.getNodeManagerPort();
} }
/** /**
* @return the http port for the tracker. * @return the http port for the tracker.
*/ */
public int getNodeManagerHttpPort() { public int getNodeManagerHttpPort() {
return datum.nodeManagerHttpPort; return datum.getNodeManagerHttpPort();
} }
/** /**

View File

@ -45,7 +45,7 @@ public class AvroArrayUtils {
} }
public static int[] fromAvro(List<Integer> avro) { public static int[] fromAvro(List<Integer> avro) {
int[] result = new int[(int)avro.size()]; int[] result = new int[avro.size()];
int i = 0; int i = 0;

View File

@ -72,7 +72,8 @@ public class EventReader implements Closeable {
} }
Schema myschema = new SpecificData(Event.class.getClassLoader()).getSchema(Event.class); Schema myschema = new SpecificData(Event.class.getClassLoader()).getSchema(Event.class);
this.schema = Schema.parse(in.readLine()); Schema.Parser parser = new Schema.Parser();
this.schema = parser.parse(in.readLine());
this.reader = new SpecificDatumReader(schema, myschema); this.reader = new SpecificDatumReader(schema, myschema);
this.decoder = DecoderFactory.get().jsonDecoder(schema, in); this.decoder = DecoderFactory.get().jsonDecoder(schema, in);
} }
@ -91,7 +92,7 @@ public class EventReader implements Closeable {
return null; return null;
} }
HistoryEvent result; HistoryEvent result;
switch (wrapper.type) { switch (wrapper.getType()) {
case JOB_SUBMITTED: case JOB_SUBMITTED:
result = new JobSubmittedEvent(); break; result = new JobSubmittedEvent(); break;
case JOB_INITED: case JOB_INITED:
@ -155,9 +156,9 @@ public class EventReader implements Closeable {
case AM_STARTED: case AM_STARTED:
result = new AMStartedEvent(); break; result = new AMStartedEvent(); break;
default: default:
throw new RuntimeException("unexpected event type: " + wrapper.type); throw new RuntimeException("unexpected event type: " + wrapper.getType());
} }
result.setDatum(wrapper.event); result.setDatum(wrapper.getEvent());
return result; return result;
} }
@ -176,13 +177,14 @@ public class EventReader implements Closeable {
static Counters fromAvro(JhCounters counters) { static Counters fromAvro(JhCounters counters) {
Counters result = new Counters(); Counters result = new Counters();
if(counters != null) { if(counters != null) {
for (JhCounterGroup g : counters.groups) { for (JhCounterGroup g : counters.getGroups()) {
CounterGroup group = CounterGroup group =
result.addGroup(StringInterner.weakIntern(g.name.toString()), result.addGroup(StringInterner.weakIntern(g.getName().toString()),
StringInterner.weakIntern(g.displayName.toString())); StringInterner.weakIntern(g.getDisplayName().toString()));
for (JhCounter c : g.counts) { for (JhCounter c : g.getCounts()) {
group.addCounter(StringInterner.weakIntern(c.name.toString()), group.addCounter(StringInterner.weakIntern(c.getName().toString()),
StringInterner.weakIntern(c.displayName.toString()), c.value); StringInterner.weakIntern(c.getDisplayName().toString()),
c.getValue());
} }
} }
} }

View File

@ -61,8 +61,8 @@ class EventWriter {
synchronized void write(HistoryEvent event) throws IOException { synchronized void write(HistoryEvent event) throws IOException {
Event wrapper = new Event(); Event wrapper = new Event();
wrapper.type = event.getEventType(); wrapper.setType(event.getEventType());
wrapper.event = event.getDatum(); wrapper.setEvent(event.getDatum());
writer.write(wrapper, encoder); writer.write(wrapper, encoder);
encoder.flush(); encoder.flush();
out.writeBytes("\n"); out.writeBytes("\n");
@ -95,22 +95,22 @@ class EventWriter {
} }
static JhCounters toAvro(Counters counters, String name) { static JhCounters toAvro(Counters counters, String name) {
JhCounters result = new JhCounters(); JhCounters result = new JhCounters();
result.name = new Utf8(name); result.setName(new Utf8(name));
result.groups = new ArrayList<JhCounterGroup>(0); result.setGroups(new ArrayList<JhCounterGroup>(0));
if (counters == null) return result; if (counters == null) return result;
for (CounterGroup group : counters) { for (CounterGroup group : counters) {
JhCounterGroup g = new JhCounterGroup(); JhCounterGroup g = new JhCounterGroup();
g.name = new Utf8(group.getName()); g.setName(new Utf8(group.getName()));
g.displayName = new Utf8(group.getDisplayName()); g.setDisplayName(new Utf8(group.getDisplayName()));
g.counts = new ArrayList<JhCounter>(group.size()); g.setCounts(new ArrayList<JhCounter>(group.size()));
for (Counter counter : group) { for (Counter counter : group) {
JhCounter c = new JhCounter(); JhCounter c = new JhCounter();
c.name = new Utf8(counter.getName()); c.setName(new Utf8(counter.getName()));
c.displayName = new Utf8(counter.getDisplayName()); c.setDisplayName(new Utf8(counter.getDisplayName()));
c.value = counter.getValue(); c.setValue(counter.getValue());
g.counts.add(c); g.getCounts().add(c);
} }
result.groups.add(g); result.getGroups().add(g);
} }
return result; return result;
} }

View File

@ -77,31 +77,32 @@ public class JobFinishedEvent implements HistoryEvent {
public Object getDatum() { public Object getDatum() {
if (datum == null) { if (datum == null) {
datum = new JobFinished(); datum = new JobFinished();
datum.jobid = new Utf8(jobId.toString()); datum.setJobid(new Utf8(jobId.toString()));
datum.finishTime = finishTime; datum.setFinishTime(finishTime);
datum.finishedMaps = finishedMaps; datum.setFinishedMaps(finishedMaps);
datum.finishedReduces = finishedReduces; datum.setFinishedReduces(finishedReduces);
datum.failedMaps = failedMaps; datum.setFailedMaps(failedMaps);
datum.failedReduces = failedReduces; datum.setFailedReduces(failedReduces);
datum.mapCounters = EventWriter.toAvro(mapCounters, "MAP_COUNTERS"); datum.setMapCounters(EventWriter.toAvro(mapCounters, "MAP_COUNTERS"));
datum.reduceCounters = EventWriter.toAvro(reduceCounters, datum.setReduceCounters(EventWriter.toAvro(reduceCounters,
"REDUCE_COUNTERS"); "REDUCE_COUNTERS"));
datum.totalCounters = EventWriter.toAvro(totalCounters, "TOTAL_COUNTERS"); datum.setTotalCounters(EventWriter.toAvro(totalCounters,
"TOTAL_COUNTERS"));
} }
return datum; return datum;
} }
public void setDatum(Object oDatum) { public void setDatum(Object oDatum) {
this.datum = (JobFinished) oDatum; this.datum = (JobFinished) oDatum;
this.jobId = JobID.forName(datum.jobid.toString()); this.jobId = JobID.forName(datum.getJobid().toString());
this.finishTime = datum.finishTime; this.finishTime = datum.getFinishTime();
this.finishedMaps = datum.finishedMaps; this.finishedMaps = datum.getFinishedMaps();
this.finishedReduces = datum.finishedReduces; this.finishedReduces = datum.getFinishedReduces();
this.failedMaps = datum.failedMaps; this.failedMaps = datum.getFailedMaps();
this.failedReduces = datum.failedReduces; this.failedReduces = datum.getFailedReduces();
this.mapCounters = EventReader.fromAvro(datum.mapCounters); this.mapCounters = EventReader.fromAvro(datum.getMapCounters());
this.reduceCounters = EventReader.fromAvro(datum.reduceCounters); this.reduceCounters = EventReader.fromAvro(datum.getReduceCounters());
this.totalCounters = EventReader.fromAvro(datum.totalCounters); this.totalCounters = EventReader.fromAvro(datum.getTotalCounters());
} }
public EventType getEventType() { public EventType getEventType() {

View File

@ -565,7 +565,7 @@ public class JobHistoryParser implements HistoryEventHandler {
/** @return the AMInfo for the job's AppMaster */ /** @return the AMInfo for the job's AppMaster */
public List<AMInfo> getAMInfos() { return amInfos; } public List<AMInfo> getAMInfos() { return amInfos; }
/** @return the AMInfo for the newest AppMaster */ /** @return the AMInfo for the newest AppMaster */
public AMInfo getLatestAMInfo() { return latestAmInfo; }; public AMInfo getLatestAMInfo() { return latestAmInfo; }
} }
/** /**

View File

@ -42,9 +42,9 @@ public class JobInfoChangeEvent implements HistoryEvent {
* @param launchTime Launch time of the job * @param launchTime Launch time of the job
*/ */
public JobInfoChangeEvent(JobID id, long submitTime, long launchTime) { public JobInfoChangeEvent(JobID id, long submitTime, long launchTime) {
datum.jobid = new Utf8(id.toString()); datum.setJobid(new Utf8(id.toString()));
datum.submitTime = submitTime; datum.setSubmitTime(submitTime);
datum.launchTime = launchTime; datum.setLaunchTime(launchTime);
} }
JobInfoChangeEvent() { } JobInfoChangeEvent() { }
@ -55,11 +55,11 @@ public class JobInfoChangeEvent implements HistoryEvent {
} }
/** Get the Job ID */ /** Get the Job ID */
public JobID getJobId() { return JobID.forName(datum.jobid.toString()); } public JobID getJobId() { return JobID.forName(datum.getJobid().toString()); }
/** Get the Job submit time */ /** Get the Job submit time */
public long getSubmitTime() { return datum.submitTime; } public long getSubmitTime() { return datum.getSubmitTime(); }
/** Get the Job launch time */ /** Get the Job launch time */
public long getLaunchTime() { return datum.launchTime; } public long getLaunchTime() { return datum.getLaunchTime(); }
public EventType getEventType() { public EventType getEventType() {
return EventType.JOB_INFO_CHANGED; return EventType.JOB_INFO_CHANGED;

View File

@ -44,12 +44,12 @@ public class JobInitedEvent implements HistoryEvent {
*/ */
public JobInitedEvent(JobID id, long launchTime, int totalMaps, public JobInitedEvent(JobID id, long launchTime, int totalMaps,
int totalReduces, String jobStatus, boolean uberized) { int totalReduces, String jobStatus, boolean uberized) {
datum.jobid = new Utf8(id.toString()); datum.setJobid(new Utf8(id.toString()));
datum.launchTime = launchTime; datum.setLaunchTime(launchTime);
datum.totalMaps = totalMaps; datum.setTotalMaps(totalMaps);
datum.totalReduces = totalReduces; datum.setTotalReduces(totalReduces);
datum.jobStatus = new Utf8(jobStatus); datum.setJobStatus(new Utf8(jobStatus));
datum.uberized = uberized; datum.setUberized(uberized);
} }
JobInitedEvent() { } JobInitedEvent() { }
@ -58,19 +58,19 @@ public class JobInitedEvent implements HistoryEvent {
public void setDatum(Object datum) { this.datum = (JobInited)datum; } public void setDatum(Object datum) { this.datum = (JobInited)datum; }
/** Get the job ID */ /** Get the job ID */
public JobID getJobId() { return JobID.forName(datum.jobid.toString()); } public JobID getJobId() { return JobID.forName(datum.getJobid().toString()); }
/** Get the launch time */ /** Get the launch time */
public long getLaunchTime() { return datum.launchTime; } public long getLaunchTime() { return datum.getLaunchTime(); }
/** Get the total number of maps */ /** Get the total number of maps */
public int getTotalMaps() { return datum.totalMaps; } public int getTotalMaps() { return datum.getTotalMaps(); }
/** Get the total number of reduces */ /** Get the total number of reduces */
public int getTotalReduces() { return datum.totalReduces; } public int getTotalReduces() { return datum.getTotalReduces(); }
/** Get the status */ /** Get the status */
public String getStatus() { return datum.jobStatus.toString(); } public String getStatus() { return datum.getJobStatus().toString(); }
/** Get the event type */ /** Get the event type */
public EventType getEventType() { public EventType getEventType() {
return EventType.JOB_INITED; return EventType.JOB_INITED;
} }
/** Get whether the job's map and reduce stages were combined */ /** Get whether the job's map and reduce stages were combined */
public boolean getUberized() { return datum.uberized; } public boolean getUberized() { return datum.getUberized(); }
} }

View File

@ -41,8 +41,8 @@ public class JobPriorityChangeEvent implements HistoryEvent {
* @param priority The new priority of the job * @param priority The new priority of the job
*/ */
public JobPriorityChangeEvent(JobID id, JobPriority priority) { public JobPriorityChangeEvent(JobID id, JobPriority priority) {
datum.jobid = new Utf8(id.toString()); datum.setJobid(new Utf8(id.toString()));
datum.priority = new Utf8(priority.name()); datum.setPriority(new Utf8(priority.name()));
} }
JobPriorityChangeEvent() { } JobPriorityChangeEvent() { }
@ -53,10 +53,12 @@ public class JobPriorityChangeEvent implements HistoryEvent {
} }
/** Get the Job ID */ /** Get the Job ID */
public JobID getJobId() { return JobID.forName(datum.jobid.toString()); } public JobID getJobId() {
return JobID.forName(datum.getJobid().toString());
}
/** Get the job priority */ /** Get the job priority */
public JobPriority getPriority() { public JobPriority getPriority() {
return JobPriority.valueOf(datum.priority.toString()); return JobPriority.valueOf(datum.getPriority().toString());
} }
/** Get the event type */ /** Get the event type */
public EventType getEventType() { public EventType getEventType() {

View File

@ -41,8 +41,8 @@ public class JobStatusChangedEvent implements HistoryEvent {
* @param jobStatus The new job status * @param jobStatus The new job status
*/ */
public JobStatusChangedEvent(JobID id, String jobStatus) { public JobStatusChangedEvent(JobID id, String jobStatus) {
datum.jobid = new Utf8(id.toString()); datum.setJobid(new Utf8(id.toString()));
datum.jobStatus = new Utf8(jobStatus); datum.setJobStatus(new Utf8(jobStatus));
} }
JobStatusChangedEvent() {} JobStatusChangedEvent() {}
@ -53,9 +53,9 @@ public class JobStatusChangedEvent implements HistoryEvent {
} }
/** Get the Job Id */ /** Get the Job Id */
public JobID getJobId() { return JobID.forName(datum.jobid.toString()); } public JobID getJobId() { return JobID.forName(datum.getJobid().toString()); }
/** Get the event status */ /** Get the event status */
public String getStatus() { return datum.jobStatus.toString(); } public String getStatus() { return datum.getJobStatus().toString(); }
/** Get the event type */ /** Get the event type */
public EventType getEventType() { public EventType getEventType() {
return EventType.JOB_STATUS_CHANGED; return EventType.JOB_STATUS_CHANGED;

View File

@ -100,34 +100,34 @@ public class JobSubmittedEvent implements HistoryEvent {
Map<JobACL, AccessControlList> jobACLs, String jobQueueName, Map<JobACL, AccessControlList> jobACLs, String jobQueueName,
String workflowId, String workflowName, String workflowNodeName, String workflowId, String workflowName, String workflowNodeName,
String workflowAdjacencies, String workflowTags) { String workflowAdjacencies, String workflowTags) {
datum.jobid = new Utf8(id.toString()); datum.setJobid(new Utf8(id.toString()));
datum.jobName = new Utf8(jobName); datum.setJobName(new Utf8(jobName));
datum.userName = new Utf8(userName); datum.setUserName(new Utf8(userName));
datum.submitTime = submitTime; datum.setSubmitTime(submitTime);
datum.jobConfPath = new Utf8(jobConfPath); datum.setJobConfPath(new Utf8(jobConfPath));
Map<CharSequence, CharSequence> jobAcls = new HashMap<CharSequence, CharSequence>(); Map<CharSequence, CharSequence> jobAcls = new HashMap<CharSequence, CharSequence>();
for (Entry<JobACL, AccessControlList> entry : jobACLs.entrySet()) { for (Entry<JobACL, AccessControlList> entry : jobACLs.entrySet()) {
jobAcls.put(new Utf8(entry.getKey().getAclName()), new Utf8( jobAcls.put(new Utf8(entry.getKey().getAclName()), new Utf8(
entry.getValue().getAclString())); entry.getValue().getAclString()));
} }
datum.acls = jobAcls; datum.setAcls(jobAcls);
if (jobQueueName != null) { if (jobQueueName != null) {
datum.jobQueueName = new Utf8(jobQueueName); datum.setJobQueueName(new Utf8(jobQueueName));
} }
if (workflowId != null) { if (workflowId != null) {
datum.workflowId = new Utf8(workflowId); datum.setWorkflowId(new Utf8(workflowId));
} }
if (workflowName != null) { if (workflowName != null) {
datum.workflowName = new Utf8(workflowName); datum.setWorkflowName(new Utf8(workflowName));
} }
if (workflowNodeName != null) { if (workflowNodeName != null) {
datum.workflowNodeName = new Utf8(workflowNodeName); datum.setWorkflowNodeName(new Utf8(workflowNodeName));
} }
if (workflowAdjacencies != null) { if (workflowAdjacencies != null) {
datum.workflowAdjacencies = new Utf8(workflowAdjacencies); datum.setWorkflowAdjacencies(new Utf8(workflowAdjacencies));
} }
if (workflowTags != null) { if (workflowTags != null) {
datum.workflowTags = new Utf8(workflowTags); datum.setWorkflowTags(new Utf8(workflowTags));
} }
} }
@ -139,30 +139,30 @@ public class JobSubmittedEvent implements HistoryEvent {
} }
/** Get the Job Id */ /** Get the Job Id */
public JobID getJobId() { return JobID.forName(datum.jobid.toString()); } public JobID getJobId() { return JobID.forName(datum.getJobid().toString()); }
/** Get the Job name */ /** Get the Job name */
public String getJobName() { return datum.jobName.toString(); } public String getJobName() { return datum.getJobName().toString(); }
/** Get the Job queue name */ /** Get the Job queue name */
public String getJobQueueName() { public String getJobQueueName() {
if (datum.jobQueueName != null) { if (datum.getJobQueueName() != null) {
return datum.jobQueueName.toString(); return datum.getJobQueueName().toString();
} }
return null; return null;
} }
/** Get the user name */ /** Get the user name */
public String getUserName() { return datum.userName.toString(); } public String getUserName() { return datum.getUserName().toString(); }
/** Get the submit time */ /** Get the submit time */
public long getSubmitTime() { return datum.submitTime; } public long getSubmitTime() { return datum.getSubmitTime(); }
/** Get the Path for the Job Configuration file */ /** Get the Path for the Job Configuration file */
public String getJobConfPath() { return datum.jobConfPath.toString(); } public String getJobConfPath() { return datum.getJobConfPath().toString(); }
/** Get the acls configured for the job **/ /** Get the acls configured for the job **/
public Map<JobACL, AccessControlList> getJobAcls() { public Map<JobACL, AccessControlList> getJobAcls() {
Map<JobACL, AccessControlList> jobAcls = Map<JobACL, AccessControlList> jobAcls =
new HashMap<JobACL, AccessControlList>(); new HashMap<JobACL, AccessControlList>();
for (JobACL jobACL : JobACL.values()) { for (JobACL jobACL : JobACL.values()) {
Utf8 jobACLsUtf8 = new Utf8(jobACL.getAclName()); Utf8 jobACLsUtf8 = new Utf8(jobACL.getAclName());
if (datum.acls.containsKey(jobACLsUtf8)) { if (datum.getAcls().containsKey(jobACLsUtf8)) {
jobAcls.put(jobACL, new AccessControlList(datum.acls.get( jobAcls.put(jobACL, new AccessControlList(datum.getAcls().get(
jobACLsUtf8).toString())); jobACLsUtf8).toString()));
} }
} }
@ -170,36 +170,36 @@ public class JobSubmittedEvent implements HistoryEvent {
} }
/** Get the id of the workflow */ /** Get the id of the workflow */
public String getWorkflowId() { public String getWorkflowId() {
if (datum.workflowId != null) { if (datum.getWorkflowId() != null) {
return datum.workflowId.toString(); return datum.getWorkflowId().toString();
} }
return null; return null;
} }
/** Get the name of the workflow */ /** Get the name of the workflow */
public String getWorkflowName() { public String getWorkflowName() {
if (datum.workflowName != null) { if (datum.getWorkflowName() != null) {
return datum.workflowName.toString(); return datum.getWorkflowName().toString();
} }
return null; return null;
} }
/** Get the node name of the workflow */ /** Get the node name of the workflow */
public String getWorkflowNodeName() { public String getWorkflowNodeName() {
if (datum.workflowNodeName != null) { if (datum.getWorkflowNodeName() != null) {
return datum.workflowNodeName.toString(); return datum.getWorkflowNodeName().toString();
} }
return null; return null;
} }
/** Get the adjacencies of the workflow */ /** Get the adjacencies of the workflow */
public String getWorkflowAdjacencies() { public String getWorkflowAdjacencies() {
if (datum.workflowAdjacencies != null) { if (datum.getWorkflowAdjacencies() != null) {
return datum.workflowAdjacencies.toString(); return datum.getWorkflowAdjacencies().toString();
} }
return null; return null;
} }
/** Get the workflow tags */ /** Get the workflow tags */
public String getWorkflowTags() { public String getWorkflowTags() {
if (datum.workflowTags != null) { if (datum.getWorkflowTags() != null) {
return datum.workflowTags.toString(); return datum.getWorkflowTags().toString();
} }
return null; return null;
} }

View File

@ -89,7 +89,9 @@ public class JobUnsuccessfulCompletionEvent implements HistoryEvent {
} }
/** Get the Job ID */ /** Get the Job ID */
public JobID getJobId() { return JobID.forName(datum.jobid.toString()); } public JobID getJobId() {
return JobID.forName(datum.getJobid().toString());
}
/** Get the job finish time */ /** Get the job finish time */
public long getFinishTime() { return datum.getFinishTime(); } public long getFinishTime() { return datum.getFinishTime(); }
/** Get the number of finished maps */ /** Get the number of finished maps */

View File

@ -125,48 +125,48 @@ public class MapAttemptFinishedEvent implements HistoryEvent {
public Object getDatum() { public Object getDatum() {
if (datum == null) { if (datum == null) {
datum = new MapAttemptFinished(); datum = new MapAttemptFinished();
datum.taskid = new Utf8(attemptId.getTaskID().toString()); datum.setTaskid(new Utf8(attemptId.getTaskID().toString()));
datum.attemptId = new Utf8(attemptId.toString()); datum.setAttemptId(new Utf8(attemptId.toString()));
datum.taskType = new Utf8(taskType.name()); datum.setTaskType(new Utf8(taskType.name()));
datum.taskStatus = new Utf8(taskStatus); datum.setTaskStatus(new Utf8(taskStatus));
datum.mapFinishTime = mapFinishTime; datum.setMapFinishTime(mapFinishTime);
datum.finishTime = finishTime; datum.setFinishTime(finishTime);
datum.hostname = new Utf8(hostname); datum.setHostname(new Utf8(hostname));
datum.port = port; datum.setPort(port);
if (rackName != null) { if (rackName != null) {
datum.rackname = new Utf8(rackName); datum.setRackname(new Utf8(rackName));
} }
datum.state = new Utf8(state); datum.setState(new Utf8(state));
datum.counters = EventWriter.toAvro(counters); datum.setCounters(EventWriter.toAvro(counters));
datum.clockSplits = AvroArrayUtils.toAvro(ProgressSplitsBlock datum.setClockSplits(AvroArrayUtils.toAvro(ProgressSplitsBlock
.arrayGetWallclockTime(allSplits)); .arrayGetWallclockTime(allSplits)));
datum.cpuUsages = AvroArrayUtils.toAvro(ProgressSplitsBlock datum.setCpuUsages(AvroArrayUtils.toAvro(ProgressSplitsBlock
.arrayGetCPUTime(allSplits)); .arrayGetCPUTime(allSplits)));
datum.vMemKbytes = AvroArrayUtils.toAvro(ProgressSplitsBlock datum.setVMemKbytes(AvroArrayUtils.toAvro(ProgressSplitsBlock
.arrayGetVMemKbytes(allSplits)); .arrayGetVMemKbytes(allSplits)));
datum.physMemKbytes = AvroArrayUtils.toAvro(ProgressSplitsBlock datum.setPhysMemKbytes(AvroArrayUtils.toAvro(ProgressSplitsBlock
.arrayGetPhysMemKbytes(allSplits)); .arrayGetPhysMemKbytes(allSplits)));
} }
return datum; return datum;
} }
public void setDatum(Object oDatum) { public void setDatum(Object oDatum) {
this.datum = (MapAttemptFinished)oDatum; this.datum = (MapAttemptFinished)oDatum;
this.attemptId = TaskAttemptID.forName(datum.attemptId.toString()); this.attemptId = TaskAttemptID.forName(datum.getAttemptId().toString());
this.taskType = TaskType.valueOf(datum.taskType.toString()); this.taskType = TaskType.valueOf(datum.getTaskType().toString());
this.taskStatus = datum.taskStatus.toString(); this.taskStatus = datum.getTaskStatus().toString();
this.mapFinishTime = datum.mapFinishTime; this.mapFinishTime = datum.getMapFinishTime();
this.finishTime = datum.finishTime; this.finishTime = datum.getFinishTime();
this.hostname = datum.hostname.toString(); this.hostname = datum.getHostname().toString();
this.rackName = datum.rackname.toString(); this.rackName = datum.getRackname().toString();
this.port = datum.port; this.port = datum.getPort();
this.state = datum.state.toString(); this.state = datum.getState().toString();
this.counters = EventReader.fromAvro(datum.counters); this.counters = EventReader.fromAvro(datum.getCounters());
this.clockSplits = AvroArrayUtils.fromAvro(datum.clockSplits); this.clockSplits = AvroArrayUtils.fromAvro(datum.getClockSplits());
this.cpuUsages = AvroArrayUtils.fromAvro(datum.cpuUsages); this.cpuUsages = AvroArrayUtils.fromAvro(datum.getCpuUsages());
this.vMemKbytes = AvroArrayUtils.fromAvro(datum.vMemKbytes); this.vMemKbytes = AvroArrayUtils.fromAvro(datum.getVMemKbytes());
this.physMemKbytes = AvroArrayUtils.fromAvro(datum.physMemKbytes); this.physMemKbytes = AvroArrayUtils.fromAvro(datum.getPhysMemKbytes());
} }
/** Get the task ID */ /** Get the task ID */

View File

@ -126,50 +126,50 @@ public class ReduceAttemptFinishedEvent implements HistoryEvent {
public Object getDatum() { public Object getDatum() {
if (datum == null) { if (datum == null) {
datum = new ReduceAttemptFinished(); datum = new ReduceAttemptFinished();
datum.taskid = new Utf8(attemptId.getTaskID().toString()); datum.setTaskid(new Utf8(attemptId.getTaskID().toString()));
datum.attemptId = new Utf8(attemptId.toString()); datum.setAttemptId(new Utf8(attemptId.toString()));
datum.taskType = new Utf8(taskType.name()); datum.setTaskType(new Utf8(taskType.name()));
datum.taskStatus = new Utf8(taskStatus); datum.setTaskStatus(new Utf8(taskStatus));
datum.shuffleFinishTime = shuffleFinishTime; datum.setShuffleFinishTime(shuffleFinishTime);
datum.sortFinishTime = sortFinishTime; datum.setSortFinishTime(sortFinishTime);
datum.finishTime = finishTime; datum.setFinishTime(finishTime);
datum.hostname = new Utf8(hostname); datum.setHostname(new Utf8(hostname));
datum.port = port; datum.setPort(port);
if (rackName != null) { if (rackName != null) {
datum.rackname = new Utf8(rackName); datum.setRackname(new Utf8(rackName));
} }
datum.state = new Utf8(state); datum.setState(new Utf8(state));
datum.counters = EventWriter.toAvro(counters); datum.setCounters(EventWriter.toAvro(counters));
datum.clockSplits = AvroArrayUtils.toAvro(ProgressSplitsBlock datum.setClockSplits(AvroArrayUtils.toAvro(ProgressSplitsBlock
.arrayGetWallclockTime(allSplits)); .arrayGetWallclockTime(allSplits)));
datum.cpuUsages = AvroArrayUtils.toAvro(ProgressSplitsBlock datum.setCpuUsages(AvroArrayUtils.toAvro(ProgressSplitsBlock
.arrayGetCPUTime(allSplits)); .arrayGetCPUTime(allSplits)));
datum.vMemKbytes = AvroArrayUtils.toAvro(ProgressSplitsBlock datum.setVMemKbytes(AvroArrayUtils.toAvro(ProgressSplitsBlock
.arrayGetVMemKbytes(allSplits)); .arrayGetVMemKbytes(allSplits)));
datum.physMemKbytes = AvroArrayUtils.toAvro(ProgressSplitsBlock datum.setPhysMemKbytes(AvroArrayUtils.toAvro(ProgressSplitsBlock
.arrayGetPhysMemKbytes(allSplits)); .arrayGetPhysMemKbytes(allSplits)));
} }
return datum; return datum;
} }
public void setDatum(Object oDatum) { public void setDatum(Object oDatum) {
this.datum = (ReduceAttemptFinished)oDatum; this.datum = (ReduceAttemptFinished)oDatum;
this.attemptId = TaskAttemptID.forName(datum.attemptId.toString()); this.attemptId = TaskAttemptID.forName(datum.getAttemptId().toString());
this.taskType = TaskType.valueOf(datum.taskType.toString()); this.taskType = TaskType.valueOf(datum.getTaskType().toString());
this.taskStatus = datum.taskStatus.toString(); this.taskStatus = datum.getTaskStatus().toString();
this.shuffleFinishTime = datum.shuffleFinishTime; this.shuffleFinishTime = datum.getShuffleFinishTime();
this.sortFinishTime = datum.sortFinishTime; this.sortFinishTime = datum.getSortFinishTime();
this.finishTime = datum.finishTime; this.finishTime = datum.getFinishTime();
this.hostname = datum.hostname.toString(); this.hostname = datum.getHostname().toString();
this.rackName = datum.rackname.toString(); this.rackName = datum.getRackname().toString();
this.port = datum.port; this.port = datum.getPort();
this.state = datum.state.toString(); this.state = datum.getState().toString();
this.counters = EventReader.fromAvro(datum.counters); this.counters = EventReader.fromAvro(datum.getCounters());
this.clockSplits = AvroArrayUtils.fromAvro(datum.clockSplits); this.clockSplits = AvroArrayUtils.fromAvro(datum.getClockSplits());
this.cpuUsages = AvroArrayUtils.fromAvro(datum.cpuUsages); this.cpuUsages = AvroArrayUtils.fromAvro(datum.getCpuUsages());
this.vMemKbytes = AvroArrayUtils.fromAvro(datum.vMemKbytes); this.vMemKbytes = AvroArrayUtils.fromAvro(datum.getVMemKbytes());
this.physMemKbytes = AvroArrayUtils.fromAvro(datum.physMemKbytes); this.physMemKbytes = AvroArrayUtils.fromAvro(datum.getPhysMemKbytes());
} }
/** Get the Task ID */ /** Get the Task ID */

View File

@ -75,30 +75,30 @@ public class TaskAttemptFinishedEvent implements HistoryEvent {
public Object getDatum() { public Object getDatum() {
if (datum == null) { if (datum == null) {
datum = new TaskAttemptFinished(); datum = new TaskAttemptFinished();
datum.taskid = new Utf8(attemptId.getTaskID().toString()); datum.setTaskid(new Utf8(attemptId.getTaskID().toString()));
datum.attemptId = new Utf8(attemptId.toString()); datum.setAttemptId(new Utf8(attemptId.toString()));
datum.taskType = new Utf8(taskType.name()); datum.setTaskType(new Utf8(taskType.name()));
datum.taskStatus = new Utf8(taskStatus); datum.setTaskStatus(new Utf8(taskStatus));
datum.finishTime = finishTime; datum.setFinishTime(finishTime);
if (rackName != null) { if (rackName != null) {
datum.rackname = new Utf8(rackName); datum.setRackname(new Utf8(rackName));
} }
datum.hostname = new Utf8(hostname); datum.setHostname(new Utf8(hostname));
datum.state = new Utf8(state); datum.setState(new Utf8(state));
datum.counters = EventWriter.toAvro(counters); datum.setCounters(EventWriter.toAvro(counters));
} }
return datum; return datum;
} }
public void setDatum(Object oDatum) { public void setDatum(Object oDatum) {
this.datum = (TaskAttemptFinished)oDatum; this.datum = (TaskAttemptFinished)oDatum;
this.attemptId = TaskAttemptID.forName(datum.attemptId.toString()); this.attemptId = TaskAttemptID.forName(datum.getAttemptId().toString());
this.taskType = TaskType.valueOf(datum.taskType.toString()); this.taskType = TaskType.valueOf(datum.getTaskType().toString());
this.taskStatus = datum.taskStatus.toString(); this.taskStatus = datum.getTaskStatus().toString();
this.finishTime = datum.finishTime; this.finishTime = datum.getFinishTime();
this.rackName = datum.rackname.toString(); this.rackName = datum.getRackname().toString();
this.hostname = datum.hostname.toString(); this.hostname = datum.getHostname().toString();
this.state = datum.state.toString(); this.state = datum.getState().toString();
this.counters = EventReader.fromAvro(datum.counters); this.counters = EventReader.fromAvro(datum.getCounters());
} }
/** Get the task ID */ /** Get the task ID */

View File

@ -53,19 +53,19 @@ public class TaskAttemptStartedEvent implements HistoryEvent {
TaskType taskType, long startTime, String trackerName, TaskType taskType, long startTime, String trackerName,
int httpPort, int shufflePort, ContainerId containerId, int httpPort, int shufflePort, ContainerId containerId,
String locality, String avataar) { String locality, String avataar) {
datum.attemptId = new Utf8(attemptId.toString()); datum.setAttemptId(new Utf8(attemptId.toString()));
datum.taskid = new Utf8(attemptId.getTaskID().toString()); datum.setTaskid(new Utf8(attemptId.getTaskID().toString()));
datum.startTime = startTime; datum.setStartTime(startTime);
datum.taskType = new Utf8(taskType.name()); datum.setTaskType(new Utf8(taskType.name()));
datum.trackerName = new Utf8(trackerName); datum.setTrackerName(new Utf8(trackerName));
datum.httpPort = httpPort; datum.setHttpPort(httpPort);
datum.shufflePort = shufflePort; datum.setShufflePort(shufflePort);
datum.containerId = new Utf8(containerId.toString()); datum.setContainerId(new Utf8(containerId.toString()));
if (locality != null) { if (locality != null) {
datum.locality = new Utf8(locality); datum.setLocality(new Utf8(locality));
} }
if (avataar != null) { if (avataar != null) {
datum.avataar = new Utf8(avataar); datum.setAvataar(new Utf8(avataar));
} }
} }
@ -75,7 +75,8 @@ public class TaskAttemptStartedEvent implements HistoryEvent {
long startTime, String trackerName, int httpPort, int shufflePort, long startTime, String trackerName, int httpPort, int shufflePort,
String locality, String avataar) { String locality, String avataar) {
this(attemptId, taskType, startTime, trackerName, httpPort, shufflePort, this(attemptId, taskType, startTime, trackerName, httpPort, shufflePort,
ConverterUtils.toContainerId("container_-1_-1_-1_-1"), locality, avataar); ConverterUtils.toContainerId("container_-1_-1_-1_-1"), locality,
avataar);
} }
TaskAttemptStartedEvent() {} TaskAttemptStartedEvent() {}
@ -86,22 +87,24 @@ public class TaskAttemptStartedEvent implements HistoryEvent {
} }
/** Get the task id */ /** Get the task id */
public TaskID getTaskId() { return TaskID.forName(datum.taskid.toString()); } public TaskID getTaskId() {
return TaskID.forName(datum.getTaskid().toString());
}
/** Get the tracker name */ /** Get the tracker name */
public String getTrackerName() { return datum.trackerName.toString(); } public String getTrackerName() { return datum.getTrackerName().toString(); }
/** Get the start time */ /** Get the start time */
public long getStartTime() { return datum.startTime; } public long getStartTime() { return datum.getStartTime(); }
/** Get the task type */ /** Get the task type */
public TaskType getTaskType() { public TaskType getTaskType() {
return TaskType.valueOf(datum.taskType.toString()); return TaskType.valueOf(datum.getTaskType().toString());
} }
/** Get the HTTP port */ /** Get the HTTP port */
public int getHttpPort() { return datum.httpPort; } public int getHttpPort() { return datum.getHttpPort(); }
/** Get the shuffle port */ /** Get the shuffle port */
public int getShufflePort() { return datum.shufflePort; } public int getShufflePort() { return datum.getShufflePort(); }
/** Get the attempt id */ /** Get the attempt id */
public TaskAttemptID getTaskAttemptId() { public TaskAttemptID getTaskAttemptId() {
return TaskAttemptID.forName(datum.attemptId.toString()); return TaskAttemptID.forName(datum.getAttemptId().toString());
} }
/** Get the event type */ /** Get the event type */
public EventType getEventType() { public EventType getEventType() {
@ -113,19 +116,19 @@ public class TaskAttemptStartedEvent implements HistoryEvent {
} }
/** Get the ContainerId */ /** Get the ContainerId */
public ContainerId getContainerId() { public ContainerId getContainerId() {
return ConverterUtils.toContainerId(datum.containerId.toString()); return ConverterUtils.toContainerId(datum.getContainerId().toString());
} }
/** Get the locality */ /** Get the locality */
public String getLocality() { public String getLocality() {
if (datum.locality != null) { if (datum.getLocality() != null) {
return datum.locality.toString(); return datum.getLocality().toString();
} }
return null; return null;
} }
/** Get the avataar */ /** Get the avataar */
public String getAvataar() { public String getAvataar() {
if (datum.avataar != null) { if (datum.getAvataar() != null) {
return datum.avataar.toString(); return datum.getAvataar().toString();
} }
return null; return null;
} }

View File

@ -133,28 +133,28 @@ public class TaskAttemptUnsuccessfulCompletionEvent implements HistoryEvent {
public Object getDatum() { public Object getDatum() {
if(datum == null) { if(datum == null) {
datum = new TaskAttemptUnsuccessfulCompletion(); datum = new TaskAttemptUnsuccessfulCompletion();
datum.taskid = new Utf8(attemptId.getTaskID().toString()); datum.setTaskid(new Utf8(attemptId.getTaskID().toString()));
datum.taskType = new Utf8(taskType.name()); datum.setTaskType(new Utf8(taskType.name()));
datum.attemptId = new Utf8(attemptId.toString()); datum.setAttemptId(new Utf8(attemptId.toString()));
datum.finishTime = finishTime; datum.setFinishTime(finishTime);
datum.hostname = new Utf8(hostname); datum.setHostname(new Utf8(hostname));
if (rackName != null) { if (rackName != null) {
datum.rackname = new Utf8(rackName); datum.setRackname(new Utf8(rackName));
} }
datum.port = port; datum.setPort(port);
datum.error = new Utf8(error); datum.setError(new Utf8(error));
datum.status = new Utf8(status); datum.setStatus(new Utf8(status));
datum.counters = EventWriter.toAvro(counters); datum.setCounters(EventWriter.toAvro(counters));
datum.clockSplits = AvroArrayUtils.toAvro(ProgressSplitsBlock datum.setClockSplits(AvroArrayUtils.toAvro(ProgressSplitsBlock
.arrayGetWallclockTime(allSplits)); .arrayGetWallclockTime(allSplits)));
datum.cpuUsages = AvroArrayUtils.toAvro(ProgressSplitsBlock datum.setCpuUsages(AvroArrayUtils.toAvro(ProgressSplitsBlock
.arrayGetCPUTime(allSplits)); .arrayGetCPUTime(allSplits)));
datum.vMemKbytes = AvroArrayUtils.toAvro(ProgressSplitsBlock datum.setVMemKbytes(AvroArrayUtils.toAvro(ProgressSplitsBlock
.arrayGetVMemKbytes(allSplits)); .arrayGetVMemKbytes(allSplits)));
datum.physMemKbytes = AvroArrayUtils.toAvro(ProgressSplitsBlock datum.setPhysMemKbytes(AvroArrayUtils.toAvro(ProgressSplitsBlock
.arrayGetPhysMemKbytes(allSplits)); .arrayGetPhysMemKbytes(allSplits)));
} }
return datum; return datum;
} }
@ -165,25 +165,25 @@ public class TaskAttemptUnsuccessfulCompletionEvent implements HistoryEvent {
this.datum = this.datum =
(TaskAttemptUnsuccessfulCompletion)odatum; (TaskAttemptUnsuccessfulCompletion)odatum;
this.attemptId = this.attemptId =
TaskAttemptID.forName(datum.attemptId.toString()); TaskAttemptID.forName(datum.getAttemptId().toString());
this.taskType = this.taskType =
TaskType.valueOf(datum.taskType.toString()); TaskType.valueOf(datum.getTaskType().toString());
this.finishTime = datum.finishTime; this.finishTime = datum.getFinishTime();
this.hostname = datum.hostname.toString(); this.hostname = datum.getHostname().toString();
this.rackName = datum.rackname.toString(); this.rackName = datum.getRackname().toString();
this.port = datum.port; this.port = datum.getPort();
this.status = datum.status.toString(); this.status = datum.getStatus().toString();
this.error = datum.error.toString(); this.error = datum.getError().toString();
this.counters = this.counters =
EventReader.fromAvro(datum.counters); EventReader.fromAvro(datum.getCounters());
this.clockSplits = this.clockSplits =
AvroArrayUtils.fromAvro(datum.clockSplits); AvroArrayUtils.fromAvro(datum.getClockSplits());
this.cpuUsages = this.cpuUsages =
AvroArrayUtils.fromAvro(datum.cpuUsages); AvroArrayUtils.fromAvro(datum.getCpuUsages());
this.vMemKbytes = this.vMemKbytes =
AvroArrayUtils.fromAvro(datum.vMemKbytes); AvroArrayUtils.fromAvro(datum.getVMemKbytes());
this.physMemKbytes = this.physMemKbytes =
AvroArrayUtils.fromAvro(datum.physMemKbytes); AvroArrayUtils.fromAvro(datum.getPhysMemKbytes());
} }
/** Get the task id */ /** Get the task id */

View File

@ -80,16 +80,16 @@ public class TaskFailedEvent implements HistoryEvent {
public Object getDatum() { public Object getDatum() {
if(datum == null) { if(datum == null) {
datum = new TaskFailed(); datum = new TaskFailed();
datum.taskid = new Utf8(id.toString()); datum.setTaskid(new Utf8(id.toString()));
datum.error = new Utf8(error); datum.setError(new Utf8(error));
datum.finishTime = finishTime; datum.setFinishTime(finishTime);
datum.taskType = new Utf8(taskType.name()); datum.setTaskType(new Utf8(taskType.name()));
datum.failedDueToAttempt = datum.setFailedDueToAttempt(
failedDueToAttempt == null failedDueToAttempt == null
? null ? null
: new Utf8(failedDueToAttempt.toString()); : new Utf8(failedDueToAttempt.toString()));
datum.status = new Utf8(status); datum.setStatus(new Utf8(status));
datum.counters = EventWriter.toAvro(counters); datum.setCounters(EventWriter.toAvro(counters));
} }
return datum; return datum;
} }
@ -97,19 +97,19 @@ public class TaskFailedEvent implements HistoryEvent {
public void setDatum(Object odatum) { public void setDatum(Object odatum) {
this.datum = (TaskFailed)odatum; this.datum = (TaskFailed)odatum;
this.id = this.id =
TaskID.forName(datum.taskid.toString()); TaskID.forName(datum.getTaskid().toString());
this.taskType = this.taskType =
TaskType.valueOf(datum.taskType.toString()); TaskType.valueOf(datum.getTaskType().toString());
this.finishTime = datum.finishTime; this.finishTime = datum.getFinishTime();
this.error = datum.error.toString(); this.error = datum.getError().toString();
this.failedDueToAttempt = this.failedDueToAttempt =
datum.failedDueToAttempt == null datum.getFailedDueToAttempt() == null
? null ? null
: TaskAttemptID.forName( : TaskAttemptID.forName(
datum.failedDueToAttempt.toString()); datum.getFailedDueToAttempt().toString());
this.status = datum.status.toString(); this.status = datum.getStatus().toString();
this.counters = this.counters =
EventReader.fromAvro(datum.counters); EventReader.fromAvro(datum.getCounters());
} }
/** Get the task id */ /** Get the task id */

View File

@ -68,30 +68,30 @@ public class TaskFinishedEvent implements HistoryEvent {
public Object getDatum() { public Object getDatum() {
if (datum == null) { if (datum == null) {
datum = new TaskFinished(); datum = new TaskFinished();
datum.taskid = new Utf8(taskid.toString()); datum.setTaskid(new Utf8(taskid.toString()));
if(successfulAttemptId != null) if(successfulAttemptId != null)
{ {
datum.successfulAttemptId = new Utf8(successfulAttemptId.toString()); datum.setSuccessfulAttemptId(new Utf8(successfulAttemptId.toString()));
} }
datum.finishTime = finishTime; datum.setFinishTime(finishTime);
datum.counters = EventWriter.toAvro(counters); datum.setCounters(EventWriter.toAvro(counters));
datum.taskType = new Utf8(taskType.name()); datum.setTaskType(new Utf8(taskType.name()));
datum.status = new Utf8(status); datum.setStatus(new Utf8(status));
} }
return datum; return datum;
} }
public void setDatum(Object oDatum) { public void setDatum(Object oDatum) {
this.datum = (TaskFinished)oDatum; this.datum = (TaskFinished)oDatum;
this.taskid = TaskID.forName(datum.taskid.toString()); this.taskid = TaskID.forName(datum.getTaskid().toString());
if (datum.successfulAttemptId != null) { if (datum.getSuccessfulAttemptId() != null) {
this.successfulAttemptId = TaskAttemptID this.successfulAttemptId = TaskAttemptID
.forName(datum.successfulAttemptId.toString()); .forName(datum.getSuccessfulAttemptId().toString());
} }
this.finishTime = datum.finishTime; this.finishTime = datum.getFinishTime();
this.taskType = TaskType.valueOf(datum.taskType.toString()); this.taskType = TaskType.valueOf(datum.getTaskType().toString());
this.status = datum.status.toString(); this.status = datum.getStatus().toString();
this.counters = EventReader.fromAvro(datum.counters); this.counters = EventReader.fromAvro(datum.getCounters());
} }
/** Get task id */ /** Get task id */

View File

@ -42,10 +42,10 @@ public class TaskStartedEvent implements HistoryEvent {
*/ */
public TaskStartedEvent(TaskID id, long startTime, public TaskStartedEvent(TaskID id, long startTime,
TaskType taskType, String splitLocations) { TaskType taskType, String splitLocations) {
datum.taskid = new Utf8(id.toString()); datum.setTaskid(new Utf8(id.toString()));
datum.splitLocations = new Utf8(splitLocations); datum.setSplitLocations(new Utf8(splitLocations));
datum.startTime = startTime; datum.setStartTime(startTime);
datum.taskType = new Utf8(taskType.name()); datum.setTaskType(new Utf8(taskType.name()));
} }
TaskStartedEvent() {} TaskStartedEvent() {}
@ -54,14 +54,18 @@ public class TaskStartedEvent implements HistoryEvent {
public void setDatum(Object datum) { this.datum = (TaskStarted)datum; } public void setDatum(Object datum) { this.datum = (TaskStarted)datum; }
/** Get the task id */ /** Get the task id */
public TaskID getTaskId() { return TaskID.forName(datum.taskid.toString()); } public TaskID getTaskId() {
return TaskID.forName(datum.getTaskid().toString());
}
/** Get the split locations, applicable for map tasks */ /** Get the split locations, applicable for map tasks */
public String getSplitLocations() { return datum.splitLocations.toString(); } public String getSplitLocations() {
return datum.getSplitLocations().toString();
}
/** Get the start time of the task */ /** Get the start time of the task */
public long getStartTime() { return datum.startTime; } public long getStartTime() { return datum.getStartTime(); }
/** Get the task type */ /** Get the task type */
public TaskType getTaskType() { public TaskType getTaskType() {
return TaskType.valueOf(datum.taskType.toString()); return TaskType.valueOf(datum.getTaskType().toString());
} }
/** Get the event type */ /** Get the event type */
public EventType getEventType() { public EventType getEventType() {

View File

@ -41,8 +41,8 @@ public class TaskUpdatedEvent implements HistoryEvent {
* @param finishTime Finish time of the task * @param finishTime Finish time of the task
*/ */
public TaskUpdatedEvent(TaskID id, long finishTime) { public TaskUpdatedEvent(TaskID id, long finishTime) {
datum.taskid = new Utf8(id.toString()); datum.setTaskid(new Utf8(id.toString()));
datum.finishTime = finishTime; datum.setFinishTime(finishTime);
} }
TaskUpdatedEvent() {} TaskUpdatedEvent() {}
@ -51,9 +51,11 @@ public class TaskUpdatedEvent implements HistoryEvent {
public void setDatum(Object datum) { this.datum = (TaskUpdated)datum; } public void setDatum(Object datum) { this.datum = (TaskUpdated)datum; }
/** Get the task ID */ /** Get the task ID */
public TaskID getTaskId() { return TaskID.forName(datum.taskid.toString()); } public TaskID getTaskId() {
return TaskID.forName(datum.getTaskid().toString());
}
/** Get the task finish time */ /** Get the task finish time */
public long getFinishTime() { return datum.finishTime; } public long getFinishTime() { return datum.getFinishTime(); }
/** Get the event type */ /** Get the event type */
public EventType getEventType() { public EventType getEventType() {
return EventType.TASK_UPDATED; return EventType.TASK_UPDATED;