コード例 #1
0
 @Override
 public void fromProtoStream(InputStream inputStream) throws IOException {
   TaskAttemptStartedProto proto = TaskAttemptStartedProto.parseDelimitedFrom(inputStream);
   if (proto == null) {
     throw new IOException("No data found in stream");
   }
   fromProto(proto);
 }
コード例 #2
0
 public void fromProto(TaskAttemptStartedProto proto) {
   this.taskAttemptId = TezTaskAttemptID.fromString(proto.getTaskAttemptId());
   this.launchTime = proto.getStartTime();
   this.containerId = ConverterUtils.toContainerId(proto.getContainerId());
   this.nodeId = ConverterUtils.toNodeId(proto.getNodeId());
   this.creationTime = proto.getCreationTime();
   this.allocationTime = proto.getAllocationTime();
   if (proto.hasCreationCausalTA()) {
     this.creationCausalTA = TezTaskAttemptID.fromString(proto.getCreationCausalTA());
   }
 }
コード例 #3
0
 public TaskAttemptStartedProto toProto() {
   TaskAttemptStartedProto.Builder builder = TaskAttemptStartedProto.newBuilder();
   builder
       .setTaskAttemptId(taskAttemptId.toString())
       .setStartTime(launchTime)
       .setContainerId(containerId.toString())
       .setNodeId(nodeId.toString())
       .setCreationTime(creationTime)
       .setAllocationTime(allocationTime);
   if (creationCausalTA != null) {
     builder.setCreationCausalTA(creationCausalTA.toString());
   }
   return builder.build();
 }