private FakeEvent getJobPriorityChangedEvent() { FakeEvent result = new FakeEvent(EventType.JOB_PRIORITY_CHANGED); JobPriorityChange datum = new JobPriorityChange(); datum.setJobid("ID"); datum.setPriority("priority"); result.setDatum(datum); return result; }
/** Get the Job ID */ public JobID getJobId() { return JobID.forName(datum.getJobid().toString()); } /** Get the job priority */
/** Get the job priority */ public JobPriority getPriority() { return JobPriority.valueOf(datum.getPriority().toString()); } /** Get the event type */
/** Generate an event to record changes in Job priority * @param id Job Id * @param priority The new priority of the job */ public JobPriorityChangeEvent(JobID id, JobPriority priority) { datum.setJobid(new Utf8(id.toString())); datum.setPriority(new Utf8(priority.name())); }
@Override public JobPriorityChange build() { try { JobPriorityChange record = new JobPriorityChange(); record.jobid = fieldSetFlags()[0] ? this.jobid : (java.lang.CharSequence) defaultValue(fields()[0]); record.priority = fieldSetFlags()[1] ? this.priority : (java.lang.CharSequence) defaultValue(fields()[1]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
@Override public JobPriorityChange build() { try { JobPriorityChange record = new JobPriorityChange(); record.jobid = fieldSetFlags()[0] ? this.jobid : (java.lang.CharSequence) defaultValue(fields()[0]); record.priority = fieldSetFlags()[1] ? this.priority : (java.lang.CharSequence) defaultValue(fields()[1]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
@Override public JobPriorityChange build() { try { JobPriorityChange record = new JobPriorityChange(); record.jobid = fieldSetFlags()[0] ? this.jobid : (java.lang.CharSequence) defaultValue(fields()[0]); record.priority = fieldSetFlags()[1] ? this.priority : (java.lang.CharSequence) defaultValue(fields()[1]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
HistoryEvent e = reader.getNextEvent(); assertTrue(e.getEventType().equals(EventType.JOB_PRIORITY_CHANGED)); assertEquals("ID", ((JobPriorityChange) e.getDatum()).getJobid().toString());
@Override public JobPriorityChange build() { try { JobPriorityChange record = new JobPriorityChange(); record.jobid = fieldSetFlags()[0] ? this.jobid : (java.lang.CharSequence) defaultValue(fields()[0]); record.priority = fieldSetFlags()[1] ? this.priority : (java.lang.CharSequence) defaultValue(fields()[1]); return record; } catch (Exception e) { throw new io.prestosql.hadoop.$internal.org.apache.avro.AvroRuntimeException(e); } } }