Package org.apache.flink.runtime.executiongraph

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.FAILED, eg.getState());
        }
        else {
          // already done, that was fast;
        }
       
View Full Code Here


          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.FAILED, eg.getState());
         
//          assertEquals(0, eg.getRegisteredExecutions().size());
        }
        else {
          // already done, that was fast;
View Full Code Here

          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.FAILED, eg.getState());
         
//          assertEquals(0, eg.getRegisteredExecutions().size());
        }
        else {
          // already done, that was fast;
View Full Code Here

          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.FAILED, eg.getState());
         
//          assertEquals(0, eg.getRegisteredExecutions().size());
        }
        else {
          // already done, that was fast;
View Full Code Here

          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

          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

    }
    if (job.getNumberOfVertices() == 0) {
      return new JobSubmissionResult(ReturnCode.ERROR, "Job is empty.");
    }
   
    ExecutionGraph executionGraph = null;

    try {
      if (LOG.isInfoEnabled()) {
        LOG.info(String.format("Received job %s (%s)", job.getJobID(), job.getName()));
      }

      // Register this job with the library cache manager
      libraryCacheManager.registerJob(job.getJobID(), job.getUserJarBlobKeys());
     
      // get the existing execution graph (if we attach), or construct a new empty one to attach
      executionGraph = this.currentJobs.get(job.getJobID());
      if (executionGraph == null) {
        if (LOG.isInfoEnabled()) {
          LOG.info("Creating new execution graph for job " + job.getJobID() + " (" + job.getName() + ')');
        }
       
        executionGraph = new ExecutionGraph(job.getJobID(), job.getName(),
            job.getJobConfiguration(), job.getUserJarBlobKeys(), this.executorService);

        executionGraph.setNumberOfRetriesLeft(job.getNumberOfExecutionRetries() >= 0 ?
            job.getNumberOfExecutionRetries() : this.defaultExecutionRetries);
        executionGraph.setDelayBeforeRetrying(this.delayBetweenRetries);

        ExecutionGraph previous = this.currentJobs.putIfAbsent(job.getJobID(), executionGraph);
        if (previous != null) {
          throw new JobException("Concurrent submission of a job with the same jobId: " + job.getJobID());
        }
      }
      else {
View Full Code Here

  @Override
  public JobCancelResult cancelJob(JobID jobID) throws IOException {

    LOG.info("Trying to cancel job with ID " + jobID);

    final ExecutionGraph eg = this.currentJobs.get(jobID);
    if (eg == null) {
      LOG.info("No job found with ID " + jobID);
      return new JobCancelResult(ReturnCode.ERROR, "Cannot find job with ID " + jobID);
    }

    final Runnable cancelJobRunnable = new Runnable() {
      @Override
      public void run() {
        eg.cancel();
      }
    };

    eg.execute(cancelJobRunnable);

    return new JobCancelResult(AbstractJobResult.ReturnCode.SUCCESS, null);
  }
View Full Code Here

  @Override
  public boolean updateTaskExecutionState(TaskExecutionState executionState) throws IOException {
    Preconditions.checkNotNull(executionState);


    final ExecutionGraph eg = this.currentJobs.get(executionState.getJobID());
    if (eg == null) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("Orphaned execution task: UpdateTaskExecutionState call cannot find execution graph for ID " + executionState.getJobID() +
            " to change state to " + executionState.getExecutionState());
      }
      return false;
    }

    return eg.updateState(executionState);
  }
View Full Code Here

  }
 
  @Override
  public InputSplit requestNextInputSplit(JobID jobID, JobVertexID vertexId, ExecutionAttemptID executionAttempt) throws IOException {

    final ExecutionGraph graph = this.currentJobs.get(jobID);
    if (graph == null) {
      LOG.error("Cannot find execution graph to job ID " + jobID);
      return null;
    }

    final ExecutionJobVertex vertex = graph.getJobVertex(vertexId);
    if (vertex == null) {
      LOG.error("Cannot find execution vertex for vertex ID " + vertexId);
      return null;
    }

    InputSplitAssigner splitAssigner = vertex.getSplitAssigner();
    if (splitAssigner == null) {
      LOG.error("No InputSplitAssigner for vertex ID " + vertexId);
      return null;
    }
   
    // get hostname for input split assignment
    String host = null;
    Execution execution = graph.getRegisteredExecutions().get(executionAttempt);
    if(execution == null) {
      LOG.error("Can not find Execution for attempt " + executionAttempt);
    } else {
      AllocatedSlot slot = execution.getAssignedResource();
      if(slot != null) {
View Full Code Here

TOP

Related Classes of org.apache.flink.runtime.executiongraph.ExecutionGraph

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.