/** {@inheritDoc} */ @Override public int hashCode() { int res = type.hashCode(); res = 31 * res + jobId.hashCode(); res = 31 * res + taskNum; res = 31 * res + attempt; return res; }
/** {@inheritDoc} */ @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { type = HadoopTaskType.fromOrdinal(in.readByte()); jobId = (HadoopJobId) in.readObject(); taskNum = in.readInt(); attempt = in.readInt(); inputSplit = (HadoopInputSplit) in.readObject(); if (in.readBoolean()) { mapperIdxSet = true; mapperIdx = in.readInt(); } else mapperIdxSet = false; }
/** {@inheritDoc} */ @Override public void writeExternal(ObjectOutput out) throws IOException { out.writeByte(type.ordinal()); out.writeObject(jobId); out.writeInt(taskNum); out.writeInt(attempt); out.writeObject(inputSplit); if (mapperIdxSet) { out.writeBoolean(true); out.writeInt(mapperIdx); } else out.writeBoolean(false); }