@Override public void toSummaryProtoStream(OutputStream outputStream) throws IOException { SummaryEventProto.Builder builder = RecoveryProtos.SummaryEventProto.newBuilder() .setDagId(dagID.toString()) .setTimestamp(finishTime) .setEventType(getEventType().ordinal()) .setEventPayload(ByteString.copyFrom(Ints.toByteArray(state.ordinal()))); builder.build().writeDelimitedTo(outputStream); }
public DAGFinishedProto toProto() { DAGFinishedProto.Builder builder = DAGFinishedProto.newBuilder(); builder.setDagId(dagID.toString()).setState(state.ordinal()).setFinishTime(finishTime); if (diagnostics != null) { builder.setDiagnostics(diagnostics); } if (tezCounters != null) { builder.setCounters(DagTypeConverters.convertTezCountersToProto(tezCounters)); } return builder.build(); }