예제 #1
0
  private Multimap<String, String> createStartedInputMap(FragmentSpecProto fragmentSpec) {
    Multimap<String, String> startedInputMap = HashMultimap.create();
    // Let the Processor control start for Broadcast inputs.

    // TODO For now, this affects non broadcast unsorted cases as well. Make use of the edge
    // property when it's available.
    for (IOSpecProto inputSpec : fragmentSpec.getInputSpecsList()) {
      if (inputSpec.getIoDescriptor().getClassName().equals(UnorderedKVInput.class.getName())) {
        startedInputMap.put(fragmentSpec.getVertexName(), inputSpec.getConnectedVertexName());
      }
    }
    return startedInputMap;
  }
예제 #2
0
 @Override
 public Set<String> getExecutorsStatus() {
   Set<String> result = new HashSet<>();
   StringBuilder value = new StringBuilder();
   for (Map.Entry<String, TaskWrapper> e : knownTasks.entrySet()) {
     value.setLength(0);
     value.append(e.getKey());
     TaskWrapper task = e.getValue();
     boolean isFirst = true;
     TaskRunnerCallable c = task.getTaskRunnerCallable();
     if (c != null && c.getRequest() != null && c.getRequest().getFragmentSpec() != null) {
       FragmentSpecProto fs = c.getRequest().getFragmentSpec();
       value
           .append(isFirst ? " (" : ", ")
           .append(fs.getDagName())
           .append("/")
           .append(fs.getVertexName());
       isFirst = false;
     }
     value.append(isFirst ? " (" : ", ");
     if (task.isInWaitQueue()) {
       value.append("in queue");
     } else if (c != null) {
       long startTime = c.getStartTime();
       if (startTime != 0) {
         value.append("started at ").append(sdf.get().format(new Date(startTime)));
       } else {
         value.append("not started");
       }
     } else {
       value.append("has no callable");
     }
     if (task.isInPreemptionQueue()) {
       value.append(", ").append("preemptable");
     }
     value.append(")");
     result.add(value.toString());
   }
   return result;
 }