@Override public void write(DataOutput out) throws IOException { WritableUtils.writeWritableObject(reduce1, out); WritableUtils.writeWritableObject(reduce2, out); }
@Override public void write(DataOutput out) throws IOException { out.writeInt(fixedSize); WritableUtils.writeWritableObject(elementReduceOp, out); }
@Override public void write(DataOutput output) throws IOException { WritableUtils.writeClass(computationClass, output); WritableUtils.writeWritableObject(incomingMessageClasses, output); WritableUtils.writeWritableObject(outgoingMessageClasses, output); }
/** * Serialize the fields of this object to <code>out</code>. * * @param out <code>DataOuput</code> to serialize this object into. * @throws IOException */ public void write(DataOutput out) throws IOException { WritableUtils.writeWritableObject(reduceOp, out); currentValue.write(out); }
@Override public void write(DataOutput out) throws IOException { out.writeInt(fixedSize); TypeOpsUtils.writeTypeOps(typeOps, out); WritableUtils.writeWritableObject(elementReduceOp, out); }
@Override public void write(DataOutput out) throws IOException { WritableUtils.writeWritableObject(reduceOp, out); value.write(out); }
@Override public void write(DataOutput out) throws IOException { // At the end of superstep, only reduceOpMap can be non-empty Preconditions.checkState(reducedMap.isEmpty(), "reducedMap must be empty at the end of the superstep"); out.writeInt(reducerMap.size()); for (Entry<String, Reducer<Object, Writable>> entry : reducerMap.entrySet()) { out.writeUTF(entry.getKey()); entry.getValue().write(out); progressable.progress(); } out.writeInt(broadcastMap.size()); for (Entry<String, Writable> entry : broadcastMap.entrySet()) { out.writeUTF(entry.getKey()); WritableUtils.writeWritableObject(entry.getValue(), out); } }
@Override public void write(DataOutput out) throws IOException { TypeOpsUtils.writeTypeOps(keyTypeOps, out); TypeOpsUtils.writeTypeOps(typeOps, out); WritableUtils.writeWritableObject(elementReduceOp, out); }
/** * Write global communication object to the stream * and increment internal counter * * @param name Name * @param type Global communication type * @param value Object value * @return Number of bytes occupied by the stream * @throws IOException */ public int addValue(String name, GlobalCommType type, Writable value) throws IOException { incrementCounter(); dataOutput.writeUTF(name); dataOutput.writeByte(type.ordinal()); if (writeClass) { WritableUtils.writeWritableObject(value, dataOutput); } else { value.write(dataOutput); } return getSize(); } }