Package eu.stratosphere.nephele.managementgraph

Examples of eu.stratosphere.nephele.managementgraph.ManagementVertex


      final ExecutionVertex ev = iterator.next();
      final ManagementGroupVertex parent = groupMap.get(ev.getGroupVertex());

      final AbstractInstance instance = ev.getAllocatedResource().getInstance();
      final ManagementVertex managementVertex = new ManagementVertex(
            parent,
            ev.getID().toManagementVertexID(),
            (instance.getInstanceConnectionInfo() != null) ? instance.getInstanceConnectionInfo().toString() : instance.toString(),
            instance.getType().toString(),
            ev.getIndexInVertexGroup()
          );
      managementVertex.setExecutionState(ev.getExecutionState());
      vertexMap.put(ev, managementVertex);

      for (int i = 0; i < ev.getNumberOfOutputGates(); i++) {
        final ExecutionGate outputGate = ev.getOutputGate(i);
        final ManagementGate managementGate = new ManagementGate(managementVertex, new ManagementGateID(), i,
View Full Code Here


      final ManagementGraph managementGraph = this.recentManagementGraphs.get(jobID);
      if (managementGraph == null) {
        return;
      }
      final ManagementVertex vertex = managementGraph.getVertexByID(vertexAssignmentEvent.getVertexID());
      if (vertex == null) {
        return;
      }

      vertex.setInstanceName(vertexAssignmentEvent.getInstanceName());
      vertex.setInstanceType(vertexAssignmentEvent.getInstanceType());
    }
  }
View Full Code Here

      final ManagementGraph managementGraph = this.recentManagementGraphs.get(jobID);
      if (managementGraph == null) {
        return;
      }
      final ManagementVertex vertex = managementGraph.getVertexByID(executionStateChangeEvent.getVertexID());
      if (vertex == null) {
        return;
      }

      vertex.setExecutionState(executionStateChangeEvent.getNewExecutionState());
      if (executionStateChangeEvent.getNewExecutionState() == ExecutionState.FAILED) {
        vertex.setOptMessage(optionalMessage);
      }
    }
  }
View Full Code Here

      ManagementGraphIterator managementGraphIterator =  new ManagementGraphIterator(jobManagementGraph,true);
      wrt.write("\"failednodes\": [");
      HashSet<String> map = new HashSet<String>();
      boolean first = true;
      while (managementGraphIterator.hasNext()) {
        ManagementVertex managementVertex = managementGraphIterator.next();
        String instanceName = managementVertex.getInstanceName();
        if (managementVertex.getExecutionState() == ExecutionState.FAILED && !map.contains(instanceName)) {
          if (first) {
            first = false;
          } else {
            wrt.write(",");
          }
          wrt.write("{");
          wrt.write("\"node\": \"" + instanceName + "\",");
          wrt.write("\"message\": \"" + StringUtils.escapeHtml(managementVertex.getOptMessage()) + "\"");
          wrt.write("}");
          map.add(instanceName);
        }
      }
      wrt.write("],");
      }

      // Serialize ManagementGraph to json
      wrt.write("\"groupvertices\": [");
      boolean first = true;
      for(ManagementGroupVertex groupVertex : jobManagementGraph.getGroupVerticesInTopologicalOrder()) {
        //Write seperator between json objects
        if(first) {
          first = false;
        } else {
          wrt.write(","); }
       
        wrt.write(groupVertex.toJson());
       
      }
      wrt.write("],");
     
      // write accumulators
      AccumulatorEvent accumulators = jobmanager.getAccumulatorResults(jobEvent.getJobID());
      Map<String, Object> accMap = AccumulatorHelper.toResultMap(accumulators.getAccumulators());
     
      wrt.write("\n\"accumulators\": [");
      int i = 0;
      for( Entry<String, Object> accumulator : accMap.entrySet()) {
        wrt.write("{ \"name\": \""+accumulator.getKey()+" (" + accumulator.getValue().getClass().getName()+")\","
            + " \"value\": \""+accumulator.getValue().toString()+"\"}\n");
        if(++i < accMap.size()) {
          wrt.write(",");
        }
      }
      wrt.write("],\n");
     
      wrt.write("\"groupverticetimes\": {");
      first = true;
      for(ManagementGroupVertex groupVertex : jobManagementGraph.getGroupVerticesInTopologicalOrder()) {
       
        if(first) {
          first = false;
        } else {
          wrt.write(","); }
       
        // Calculate start and end time for groupvertex
        long started = Long.MAX_VALUE;
        long ended = 0;
       
        // Take earliest running state and latest endstate of groupmembers
        for(int j = 0; j < groupVertex.getNumberOfGroupMembers(); j++) {
          ManagementVertex vertex = groupVertex.getGroupMember(j);
         
          long running = jobmanager.getArchive().getVertexTime(jobEvent.getJobID(), vertex.getID(), ExecutionState.RUNNING);
          if(running != 0 && running < started) {
            started = running;
          }
         
          long finished = jobmanager.getArchive().getVertexTime(jobEvent.getJobID(), vertex.getID(), ExecutionState.FINISHED);
          long canceled = jobmanager.getArchive().getVertexTime(jobEvent.getJobID(), vertex.getID(), ExecutionState.CANCELED);
          long failed = jobmanager.getArchive().getVertexTime(jobEvent.getJobID(), vertex.getID(), ExecutionState.FAILED);
         
          if(finished != 0 && finished > ended) {
            ended = finished;
          }
         
View Full Code Here

    wrt.write("\"verticetimes\": {");
    boolean first = true;
    for(ManagementGroupVertex groupVertex : jobManagementGraph.getGroupVerticesInTopologicalOrder()) {
     
      for(int j = 0; j < groupVertex.getNumberOfGroupMembers(); j++) {
        ManagementVertex vertex = groupVertex.getGroupMember(j);
       
        if(first) {
          first = false;
        } else {
          wrt.write(","); }
       
        wrt.write("\""+vertex.getID()+"\": {");
        wrt.write("\"vertexid\": \"" + vertex.getID() + "\",");
        wrt.write("\"vertexname\": \"" + vertex + "\",");
        wrt.write("\"CREATED\": "+ jobmanager.getArchive().getVertexTime(jobEvent.getJobID(), vertex.getID(), ExecutionState.CREATED) + ",");
        wrt.write("\"SCHEDULED\": "+ jobmanager.getArchive().getVertexTime(jobEvent.getJobID(), vertex.getID(), ExecutionState.SCHEDULED) + ",");
        wrt.write("\"ASSIGNED\": "+ jobmanager.getArchive().getVertexTime(jobEvent.getJobID(), vertex.getID(), ExecutionState.ASSIGNED) + ",");
        wrt.write("\"READY\": "+ jobmanager.getArchive().getVertexTime(jobEvent.getJobID(), vertex.getID(), ExecutionState.READY) + ",");
        wrt.write("\"STARTING\": "+ jobmanager.getArchive().getVertexTime(jobEvent.getJobID(), vertex.getID(), ExecutionState.STARTING) + ",");
        wrt.write("\"RUNNING\": "+ jobmanager.getArchive().getVertexTime(jobEvent.getJobID(), vertex.getID(), ExecutionState.RUNNING) + ",");
        wrt.write("\"FINISHING\": "+ jobmanager.getArchive().getVertexTime(jobEvent.getJobID(), vertex.getID(), ExecutionState.FINISHING) + ",");
        wrt.write("\"FINISHED\": "+ jobmanager.getArchive().getVertexTime(jobEvent.getJobID(), vertex.getID(), ExecutionState.FINISHED) + ",");
        wrt.write("\"CANCELING\": "+ jobmanager.getArchive().getVertexTime(jobEvent.getJobID(), vertex.getID(), ExecutionState.CANCELING) + ",");
        wrt.write("\"CANCELED\": "+ jobmanager.getArchive().getVertexTime(jobEvent.getJobID(), vertex.getID(), ExecutionState.CANCELED) + ",");
        wrt.write("\"FAILED\": "+ jobmanager.getArchive().getVertexTime(jobEvent.getJobID(), vertex.getID(), ExecutionState.FAILED) + "");
        wrt.write("}");
      }
     
    }
    wrt.write("}}");
View Full Code Here

TOP

Related Classes of eu.stratosphere.nephele.managementgraph.ManagementVertex

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.