Examples of ExecutionGraph


Examples of org.apache.flink.runtime.executiongraph.ExecutionGraph

        if (result.getReturnCode() != AbstractJobResult.ReturnCode.SUCCESS) {
          System.out.println(result.getDescription());
        }
        assertEquals(AbstractJobResult.ReturnCode.SUCCESS, result.getReturnCode());
       
        ExecutionGraph eg = jm.getCurrentJobs().get(jobGraph.getJobID());
       
        // wait until everyone has settled in
        long deadline = System.currentTimeMillis() + 2000;
        while (System.currentTimeMillis() < deadline) {
         
          boolean allrunning = true;
          for (ExecutionVertex v : eg.getJobVertex(receiver.getID()).getTaskVertices()) {
            if (v.getCurrentExecutionAttempt().getState() != ExecutionState.RUNNING) {
              allrunning = false;
              break;
            }
          }
         
          if (allrunning) {
            break;
          }
          Thread.sleep(200);
        }
       
        // kill one task manager
        TaskManager tm = ((LocalInstanceManager) jm.getInstanceManager()).getTaskManagers()[0];
        tm.shutdown();
       
        eg.waitForJobEnd();
       
        // make sure that in any case, the network buffers are all returned
        waitForTaskThreadsToBeTerminated();
        assertTrue(bp1.isDestroyed() || bp1.numBuffers() == bp1.numAvailableBuffers());
        assertTrue(bp2.isDestroyed() || bp2.numBuffers() == bp2.numAvailableBuffers());
View Full Code Here

Examples of org.apache.flink.runtime.executiongraph.ExecutionGraph

        System.out.println(result.getDescription());
      }
      assertEquals(AbstractJobResult.ReturnCode.SUCCESS, result.getReturnCode());
     
      // monitor the execution
      ExecutionGraph eg = jm.getCurrentJobs().get(jobGraph.getJobID());
     
      if (eg != null) {
        eg.waitForJobEnd();
        assertEquals(JobStatus.FINISHED, eg.getState());
      }
      else {
        // already done, that was fast;
      }
     
View Full Code Here

Examples of org.apache.flink.runtime.executiongraph.ExecutionGraph

   
  }
 
  private void writeJsonForJob(PrintWriter wrt, RecentJobEvent jobEvent) throws IOException {
   
    ExecutionGraph graph = jobmanager.getRecentExecutionGraph(jobEvent.getJobID());
   
    //Serialize job to json
    wrt.write("{");
    wrt.write("\"jobid\": \"" + jobEvent.getJobID() + "\",");
    wrt.write("\"jobname\": \"" + jobEvent.getJobName()+"\",");
    wrt.write("\"status\": \""+ jobEvent.getJobStatus() + "\",");
    wrt.write("\"time\": " + jobEvent.getTimestamp()+",");
   
    // Serialize ManagementGraph to json
    wrt.write("\"groupvertices\": [");
    boolean first = true;
   
    for (ExecutionJobVertex groupVertex : graph.getVerticesTopologically()) {
      //Write seperator between json objects
      if(first) {
        first = false;
      } else {
        wrt.write(","); }
View Full Code Here

Examples of org.apache.flink.runtime.executiongraph.ExecutionGraph

   
    try {
   
      wrt.write("[");
   
      ExecutionGraph graph = jobmanager.getRecentExecutionGraph(jobEvent.getJobID());
     
      //Serialize job to json
      wrt.write("{");
      wrt.write("\"jobid\": \"" + jobEvent.getJobID() + "\",");
      wrt.write("\"jobname\": \"" + jobEvent.getJobName()+"\",");
      wrt.write("\"status\": \""+ jobEvent.getJobStatus() + "\",");
      wrt.write("\"SCHEDULED\": "+ graph.getStatusTimestamp(JobStatus.CREATED) + ",");
      wrt.write("\"RUNNING\": "+ graph.getStatusTimestamp(JobStatus.RUNNING) + ",");
      wrt.write("\"FINISHED\": "+ graph.getStatusTimestamp(JobStatus.FINISHED) + ",");
      wrt.write("\"FAILED\": "+ graph.getStatusTimestamp(JobStatus.FAILED) + ",");
      wrt.write("\"CANCELED\": "+ graph.getStatusTimestamp(JobStatus.CANCELED) + ",");

      if (jobEvent.getJobStatus() == JobStatus.FAILED) {
        wrt.write("\"failednodes\": [");
        boolean first = true;
        for (ExecutionVertex vertex : graph.getAllExecutionVertices()) {
          if (vertex.getExecutionState() == ExecutionState.FAILED) {
            AllocatedSlot slot = vertex.getCurrentAssignedResource();
            Throwable failureCause = vertex.getFailureCause();
            if (slot != null || failureCause != null) {
              if (first) {
                first = false;
              } else {
                wrt.write(",");
              }
              wrt.write("{");
              wrt.write("\"node\": \"" + (slot == null ? "(none)" : slot.getInstance().getInstanceConnectionInfo().getFQDNHostname()) + "\",");
              wrt.write("\"message\": \"" + (failureCause == null ? "" : StringUtils.escapeHtml(ExceptionUtils.stringifyException(failureCause))) + "\"");
              wrt.write("}");
            }
          }
        }
        wrt.write("],");
      }

      // Serialize ManagementGraph to json
      wrt.write("\"groupvertices\": [");
      boolean first = true;
      for (ExecutionJobVertex groupVertex : graph.getVerticesTopologically()) {
        //Write seperator between json objects
        if(first) {
          first = false;
        } else {
          wrt.write(","); }
       
        wrt.write(JsonFactory.toJson(groupVertex));
       
      }
      wrt.write("],");
     
      // write accumulators
      Map<String, Object> accMap = AccumulatorHelper.toResultMap(jobmanager.getAccumulators(jobEvent.getJobID()));
     
      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 (ExecutionJobVertex groupVertex : graph.getVerticesTopologically()) {
       
        if(first) {
          first = false;
        } else {
          wrt.write(","); }
View Full Code Here

Examples of org.apache.flink.runtime.executiongraph.ExecutionGraph

        System.out.println(result.getDescription());
      }
      assertEquals(AbstractJobResult.ReturnCode.SUCCESS, result.getReturnCode());
     
      // monitor the execution
      ExecutionGraph eg = jm.getCurrentJobs().get(jobGraph.getJobID());
     
      if (eg != null) {
        eg.waitForJobEnd();
        assertEquals(JobStatus.FINISHED, eg.getState());
      }
      else {
        // already done, that was fast;
      }
     
View Full Code Here

Examples of org.apache.flink.runtime.executiongraph.ExecutionGraph

        System.out.println(result.getDescription());
      }
      assertEquals(AbstractJobResult.ReturnCode.SUCCESS, result.getReturnCode());
     
      // monitor the execution
      ExecutionGraph eg = jm.getCurrentJobs().get(jobGraph.getJobID());
     
      // wait for a bit until all is running, make sure the second attempt does not block
      Thread.sleep(300);
      ReceiverBlockingOnce.setShouldNotBlock();
     
      // shutdown one of the taskmanagers
      ((LocalInstanceManager) jm.getInstanceManager()).getTaskManagers()[0].shutdown();
     
      // wait for the recovery to do its work
      if (eg != null) {
        eg.waitForJobEnd();
        assertEquals(JobStatus.FINISHED, eg.getState());
      }
      else {
        // already done, that was fast;
      }
     
View Full Code Here

Examples of org.apache.flink.runtime.executiongraph.ExecutionGraph

  /**
   * Writes info about one particular archived JobVertex in a job, including all member execution vertices, their times and statuses.
   */
  private void writeJsonForArchivedJobGroupvertex(PrintWriter wrt, RecentJobEvent jobEvent, JobVertexID vertexId) {
    try {
      ExecutionGraph graph = jobmanager.getRecentExecutionGraph(jobEvent.getJobID());
     
      ExecutionJobVertex jobVertex = graph.getJobVertex(vertexId);
     
      // Serialize ManagementGraph to json
      wrt.write("{\"groupvertex\": " + JsonFactory.toJson(jobVertex) + ",");
     
      wrt.write("\"verticetimes\": {");
      boolean first = true;
      for (ExecutionJobVertex groupVertex : graph.getAllVertices().values()) {
       
        for (ExecutionVertex vertex : groupVertex.getTaskVertices()) {
         
          Execution exec = vertex.getCurrentExecutionAttempt();
         
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.