Package org.apache.flink.runtime

Examples of org.apache.flink.runtime.JobException


      ExecutionJobVertex ejv = new ExecutionJobVertex(this, jobVertex, 1, createTimestamp);
      ejv.connectToPredecessors(this.intermediateResults);
     
      ExecutionJobVertex previousTask = this.tasks.putIfAbsent(jobVertex.getID(), ejv);
      if (previousTask != null) {
        throw new JobException(String.format("Encountered two job vertices with ID %s : previous=[%s] / new=[%s]",
            jobVertex.getID(), ejv, previousTask));
      }
     
      for (IntermediateResult res : ejv.getProducedDataSets()) {
        IntermediateResult previousDataSet = this.intermediateResults.putIfAbsent(res.getId(), res);
        if (previousDataSet != null) {
          throw new JobException(String.format("Encountered two intermediate data set with ID %s : previous=[%s] / new=[%s]",
              res.getId(), res, previousDataSet));
        }
      }
     
      this.verticesInCreationOrder.add(ejv);
View Full Code Here


    // sanity checks
    if (slot == null) {
      throw new NullPointerException();
    }
    if (!slot.isAlive()) {
      throw new JobException("Traget slot for deployment is not alive.");
    }
   
    // make sure exactly one deployment call happens from the correct state
    // note: the transition from CREATED to DEPLOYING is for testing purposes only
    ExecutionState previous = this.state;
    if (previous == SCHEDULED || previous == CREATED) {
      if (!transitionState(previous, DEPLOYING)) {
        // race condition, someone else beat us to the deploying call.
        // this should actually not happen and indicates a race somewhere else
        throw new IllegalStateException("Cannot deploy task: Concurrent deployment call race.");
      }
    }
    else {
      // vertex may have been cancelled, or it was already scheduled
      throw new IllegalStateException("The vertex must be in CREATED or SCHEDULED state to be deployed. Found state " + previous);
    }
   
    try {
      // good, we are allowed to deploy
      if (!slot.setExecutedVertex(this)) {
        throw new JobException("Could not assign the ExecutionVertex to the slot " + slot);
      }
      this.assignedResource = slot;
     
      // race double check, did we fail/cancel and do we need to release the slot?
      if (this.state != DEPLOYING) {
View Full Code Here

    this.slotSharingGroup = jobVertex.getSlotSharingGroup();
    this.coLocationGroup = jobVertex.getCoLocationGroup();
   
    // setup the coLocation group
    if (coLocationGroup != null && slotSharingGroup == null) {
      throw new JobException("Vertex uses a co-location constraint without using slot sharing");
    }
   
    // create the intermediate results
    this.producedDataSets = new IntermediateResult[jobVertex.getNumberOfProducedIntermediateDataSets()];
    for (int i = 0; i < jobVertex.getProducedDataSets().size(); i++) {
      IntermediateDataSet set = jobVertex.getProducedDataSets().get(i);
      this.producedDataSets[i] = new IntermediateResult(set.getId(), this, numTaskVertices);
    }
   
    // create all task vertices
    for (int i = 0; i < numTaskVertices; i++) {
      ExecutionVertex vertex = new ExecutionVertex(this, i, this.producedDataSets, createTimestamp);
      this.taskVertices[i] = vertex;
    }
   
    // sanity check for the double referencing between intermediate result partitions and execution vertices
    for (IntermediateResult ir : this.producedDataSets) {
      if (ir.getNumberOfAssignedPartitions() != parallelism) {
        throw new RuntimeException("The intermediate result's partitions were not correctly assiged.");
      }
    }
   
    // set up the input splits, if the vertex has any
    try {
      @SuppressWarnings("unchecked")
      InputSplitSource<InputSplit> splitSource = (InputSplitSource<InputSplit>) jobVertex.getInputSplitSource();
      if (splitSource != null) {
        this.inputSplits = splitSource.createInputSplits(numTaskVertices);
        this.splitAssigner = splitSource.getInputSplitAssigner(this.inputSplits);
      } else {
        this.inputSplits = null;
        this.splitAssigner = null;
      }
    }
    catch (Throwable t) {
      throw new JobException("Creating the input splits caused an error: " + t.getMessage(), t);
    }
   
    this.finishedSubtasks = new boolean[parallelism];
  }
View Full Code Here

     
      // fetch the intermediate result via ID. if it does not exist, then it either has not been created, or the order
      // in which this method is called for the job vertices is not a topological order
      IntermediateResult ires = intermediateDataSets.get(edge.getSourceId());
      if (ires == null) {
        throw new JobException("Cannot connect this job graph to the previous graph. No previous intermediate result found for ID "
            + edge.getSourceId());
      }
     
      this.inputs.add(ires);
     
View Full Code Here

            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 {
        if (LOG.isInfoEnabled()) {
          LOG.info(String.format("Found existing execution graph for id %s, attaching this job.", job.getJobID()));
        }
      }

      // Register for updates on the job status
      executionGraph.registerJobStatusListener(this);
     
      // grab the class loader for user-defined code
      final ClassLoader userCodeLoader = libraryCacheManager.getClassLoader(job.getJobID());
      if (userCodeLoader == null) {
        throw new JobException("The user code class loader could not be initialized.");
      }

      // first, perform the master initialization of the nodes
      if (LOG.isDebugEnabled()) {
        LOG.debug(String.format("Running master initialization of job %s (%s)", job.getJobID(), job.getName()));
      }

      for (AbstractJobVertex vertex : job.getVertices()) {
        // check that the vertex has an executable class
        String executableClass = vertex.getInvokableClassName();
        if (executableClass == null || executableClass.length() == 0) {
          throw new JobException(String.format("The vertex %s (%s) has no invokable class.", vertex.getID(), vertex.getName()));
        }

        // master side initialization
        vertex.initializeOnMaster(userCodeLoader);
      }
View Full Code Here

TOP

Related Classes of org.apache.flink.runtime.JobException

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.