예제 #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);
 }
예제 #2
0
 public void fromProto(DAGFinishedProto proto) {
   this.dagID = TezDAGID.fromString(proto.getDagId());
   this.finishTime = proto.getFinishTime();
   this.state = DAGState.values()[proto.getState()];
   if (proto.hasDiagnostics()) {
     this.diagnostics = proto.getDiagnostics();
   }
   if (proto.hasCounters()) {
     this.tezCounters = DagTypeConverters.convertTezCountersFromProto(proto.getCounters());
   }
 }
예제 #3
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();
  }
예제 #4
0
 @Override
 public String toString() {
   return "dagId="
       + dagID
       + ", startTime="
       + startTime
       + ", finishTime="
       + finishTime
       + ", timeTaken="
       + (finishTime - startTime)
       + ", status="
       + state.name()
       + ", diagnostics="
       + diagnostics
       + ", counters="
       + ((tezCounters == null)
           ? "null"
           : (tezCounters.toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ")));
 }
예제 #5
0
 @Override
 public void fromSummaryProtoStream(SummaryEventProto proto) throws IOException {
   this.dagID = TezDAGID.fromString(proto.getDagId());
   this.finishTime = proto.getTimestamp();
   this.state = DAGState.values()[Ints.fromByteArray(proto.getEventPayload().toByteArray())];
 }