private void serializeComputationStates(Queue<ComputationState> states, DataOutputView target) throws IOException { target.writeInt(states.size()); for (ComputationState computationState : states) { STATE_NAME_SERIALIZER.serialize(computationState.getCurrentStateName(), target); NODE_ID_SERIALIZER.serialize(computationState.getPreviousBufferEntry(), target); VERSION_SERIALIZER.serialize(computationState.getVersion(), target); TIMESTAMP_SERIALIZER.serialize(computationState.getStartTimestamp(), target); if (computationState.getStartEventID() != null) { target.writeByte(1); EVENT_ID_SERIALIZER.serialize(computationState.getStartEventID(), target); } else { target.writeByte(0); } } }
private void serializeComputationStates(Queue<ComputationState> states, DataOutputView target) throws IOException { target.writeInt(states.size()); for (ComputationState computationState : states) { STATE_NAME_SERIALIZER.serialize(computationState.getCurrentStateName(), target); NODE_ID_SERIALIZER.serialize(computationState.getPreviousBufferEntry(), target); VERSION_SERIALIZER.serialize(computationState.getVersion(), target); TIMESTAMP_SERIALIZER.serialize(computationState.getStartTimestamp(), target); if (computationState.getStartEventID() != null) { target.writeByte(1); EVENT_ID_SERIALIZER.serialize(computationState.getStartEventID(), target); } else { target.writeByte(0); } } }
private void copyStates(DataInputView source, DataOutputView target) throws IOException { int computationStateNo = source.readInt(); target.writeInt(computationStateNo); for (int i = 0; i < computationStateNo; i++) { String state = STATE_NAME_SERIALIZER.deserialize(source); STATE_NAME_SERIALIZER.serialize(state, target); NodeId prevState = NODE_ID_SERIALIZER.deserialize(source); NODE_ID_SERIALIZER.serialize(prevState, target); DeweyNumber version = VERSION_SERIALIZER.deserialize(source); VERSION_SERIALIZER.serialize(version, target); long startTimestamp = TIMESTAMP_SERIALIZER.deserialize(source); TIMESTAMP_SERIALIZER.serialize(startTimestamp, target); byte isNull = source.readByte(); target.writeByte(isNull); if (isNull == 1) { EventId startEventId = EVENT_ID_SERIALIZER.deserialize(source); EVENT_ID_SERIALIZER.serialize(startEventId, target); } } }
private void copyStates(DataInputView source, DataOutputView target) throws IOException { int computationStateNo = source.readInt(); target.writeInt(computationStateNo); for (int i = 0; i < computationStateNo; i++) { String state = STATE_NAME_SERIALIZER.deserialize(source); STATE_NAME_SERIALIZER.serialize(state, target); NodeId prevState = NODE_ID_SERIALIZER.deserialize(source); NODE_ID_SERIALIZER.serialize(prevState, target); DeweyNumber version = VERSION_SERIALIZER.deserialize(source); VERSION_SERIALIZER.serialize(version, target); long startTimestamp = TIMESTAMP_SERIALIZER.deserialize(source); TIMESTAMP_SERIALIZER.serialize(startTimestamp, target); byte isNull = source.readByte(); target.writeByte(isNull); if (isNull == 1) { EventId startEventId = EVENT_ID_SERIALIZER.deserialize(source); EVENT_ID_SERIALIZER.serialize(startEventId, target); } } }
@Override public void serialize(SharedBufferEdge record, DataOutputView target) throws IOException { NodeId.NodeIdSerializer.INSTANCE.serialize(record.target, target); DeweyNumber.DeweyNumberSerializer.INSTANCE.serialize(record.deweyNumber, target); }
@Override public void serialize(SharedBufferEdge record, DataOutputView target) throws IOException { NodeId.NodeIdSerializer.INSTANCE.serialize(record.target, target); DeweyNumber.DeweyNumberSerializer.INSTANCE.serialize(record.deweyNumber, target); }