int eventBytesLen = in.readInt();
byte[] eventBytes = new byte[eventBytesLen];
in.readFully(eventBytes);
switch (eventType) {
case DATA_MOVEMENT_EVENT:
DataMovementEventProto dmProto =
DataMovementEventProto.parseFrom(eventBytes);
event = new DataMovementEvent(dmProto.getSourceIndex(),
dmProto.getTargetIndex(),
dmProto.getUserPayload().toByteArray());
break;
case VERTEX_MANAGER_EVENT:
VertexManagerEventProto vmProto =
VertexManagerEventProto.parseFrom(eventBytes);
event = new VertexManagerEvent(vmProto.getTargetVertexName(),