Example #1
0
 @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);
 }
Example #2
0
  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();
  }