Package org.apache.flink.compiler

Examples of org.apache.flink.compiler.CompilerException


     
      // sanity check the common serializer
      if (typeSerFact == null) {
        typeSerFact = inConn.getSerializer();
      } else if (!typeSerFact.equals(inConn.getSerializer())) {
        throw new CompilerException("Conflicting types in union operator.");
      }
     
      final PlanNode sourceNode = inConn.getSource();
      AbstractJobVertex sourceVertex = this.vertices.get(sourceNode);
      TaskConfig sourceVertexConfig;

      if (sourceVertex == null) {
        // this predecessor is chained to another task or an iteration
        final TaskInChain chainedTask;
        final IterationDescriptor iteration;
        if ((chainedTask = this.chainedTasks.get(sourceNode)) != null) {
          // push chained task
          if (chainedTask.getContainingVertex() == null) {
            throw new IllegalStateException("Bug: Chained task has not been assigned its containing vertex when connecting.");
          }
          sourceVertex = chainedTask.getContainingVertex();
          sourceVertexConfig = chainedTask.getTaskConfig();
        } else if ((iteration = this.iterations.get(sourceNode)) != null) {
          // predecessor is an iteration
          sourceVertex = iteration.getHeadTask();
          sourceVertexConfig = iteration.getHeadFinalResultConfig();
        } else {
          throw new CompilerException("Bug: Could not resolve source node for a channel.");
        }
      } else {
        // predecessor is its own vertex
        sourceVertexConfig = new TaskConfig(sourceVertex.getConfiguration());
      }
      DistributionPattern pattern = connectJobVertices(
        inConn, inputIndex, sourceVertex, sourceVertexConfig, targetVertex, targetVertexConfig, isBroadcast);
     
      // accounting on channels and senders
      numChannelsTotal++;
      if (inConn.isOnDynamicPath()) {
        numChannelsDynamicPath++;
        numDynamicSenderTasksTotal += getNumberOfSendersPerReceiver(pattern,
          sourceVertex.getParallelism(), targetVertex.getParallelism());
      }
    }
   
    // for the iterations, check that the number of dynamic channels is the same as the number
    // of channels for this logical input. this condition is violated at the moment, if there
    // is a union between nodes on the static and nodes on the dynamic path
    if (numChannelsDynamicPath > 0 && numChannelsTotal != numChannelsDynamicPath) {
      throw new CompilerException("Error: It is currently not supported to union between dynamic and static path in an iteration.");
    }
    if (numDynamicSenderTasksTotal > 0) {
      if (isBroadcast) {
        targetVertexConfig.setBroadcastGateIterativeWithNumberOfEventsUntilInterrupt(inputIndex, numDynamicSenderTasksTotal);
      } else {
View Full Code Here


        }
        else if (numSenders == 1) {
          return 1;
        }
        else {
          throw new CompilerException("Error: A changing degree of parallelism is currently " +
              "not supported between tasks within an iteration.");
        }
      } else {
        return 1;
      }
    } else {
      throw new CompilerException("Unknown distribution pattern for channels: " + pattern);
    }
  }
View Full Code Here

    if (merge) {
      final PlanNode successor = pspn.getOutgoingChannels().get(0).getTarget();
      headVertex = (AbstractJobVertex) this.vertices.get(successor);
     
      if (headVertex == null) {
        throw new CompilerException(
          "Bug: Trying to merge solution set with its sucessor, but successor has not been created.");
      }
     
      // reset the vertex type to iteration head
      headVertex.setInvokableClass(IterationHeadPactTask.class);
      headConfig = new TaskConfig(headVertex.getConfiguration());
      toReturn = null;
    } else {
      // instantiate the head vertex and give it a no-op driver as the driver strategy.
      // everything else happens in the post visit, after the input (the initial partial solution)
      // is connected.
      headVertex = new AbstractJobVertex("PartialSolution ("+iteration.getNodeName()+")");
      headVertex.setInvokableClass(IterationHeadPactTask.class);
      headConfig = new TaskConfig(headVertex.getConfiguration());
      headConfig.setDriver(NoOpDriver.class);
      toReturn = headVertex;
    }
   
    // create the iteration descriptor and the iteration to it
    IterationDescriptor descr = this.iterations.get(iteration);
    if (descr == null) {
      throw new CompilerException("Bug: Iteration descriptor was not created at when translating the iteration node.");
    }
    descr.setHeadTask(headVertex, headConfig);
   
    return toReturn;
  }
View Full Code Here

    if (merge) {
      final PlanNode successor = wspn.getOutgoingChannels().get(0).getTarget();
      headVertex = (AbstractJobVertex) this.vertices.get(successor);
     
      if (headVertex == null) {
        throw new CompilerException(
          "Bug: Trying to merge solution set with its sucessor, but successor has not been created.");
      }
     
      // reset the vertex type to iteration head
      headVertex.setInvokableClass(IterationHeadPactTask.class);
      headConfig = new TaskConfig(headVertex.getConfiguration());
      toReturn = null;
    } else {
      // instantiate the head vertex and give it a no-op driver as the driver strategy.
      // everything else happens in the post visit, after the input (the initial partial solution)
      // is connected.
      headVertex = new AbstractJobVertex("IterationHead("+iteration.getNodeName()+")");
      headVertex.setInvokableClass(IterationHeadPactTask.class);
      headConfig = new TaskConfig(headVertex.getConfiguration());
      headConfig.setDriver(NoOpDriver.class);
      toReturn = headVertex;
    }
   
    headConfig.setSolutionSetUnmanaged(iteration.getIterationNode().getIterationContract().isSolutionSetUnManaged());
   
    // create the iteration descriptor and the iteration to it
    IterationDescriptor descr = this.iterations.get(iteration);
    if (descr == null) {
      throw new CompilerException("Bug: Iteration descriptor was not created at when translating the iteration node.");
    }
    descr.setHeadTask(headVertex, headConfig);
   
    return toReturn;
  }
View Full Code Here

          PactCompiler.LOG.warn("Strategy hint for Reduce Pact '" + getPactContract().getName() +
            "' desires combinable reduce, but user function is not marked combinable.");
        }
        useCombiner = true;
      } else {
        throw new CompilerException("Invalid local strategy hint for match contract: " + localStrategy);
      }
    } else {
      useCombiner = isCombineable();
    }
   
View Full Code Here

  public void addOutgoingConnection(PactConnection pactConnection) {
    if (this.outgoingConnections == null) {
      this.outgoingConnections = new ArrayList<PactConnection>();
    } else {
      if (this.outgoingConnections.size() == 64) {
        throw new CompilerException("Cannot currently handle nodes with more than 64 outputs.");
      }
    }

    this.outgoingConnections.add(pactConnection);
  }
View Full Code Here

   */
  public void computeOutputEstimates(DataStatistics statistics) {
    // sanity checking
    for (PactConnection c : getIncomingConnections()) {
      if (c.getSource() == null) {
        throw new CompilerException("Bug: Estimate computation called before inputs have been set.");
      }
    }
   
    // let every operator do its computation
    computeOperatorSpecificDefaultEstimates(statistics);
View Full Code Here

  //                                    Pruning
  // --------------------------------------------------------------------------------------------
 
  protected void prunePlanAlternatives(List<PlanNode> plans) {
    if (plans.isEmpty()) {
      throw new CompilerException("No plan meeting the requirements could be created @ " + this + ". Most likely reason: Too restrictive plan hints.");
    }
    // shortcut for the simple case
    if (plans.size() == 1) {
      return;
    }
View Full Code Here

        if (this.outgoingConnections.get(num) == toParent) {
          break;
        }
      }
      if (num >= this.outgoingConnections.size()) {
        throw new CompilerException("Error in compiler: "
          + "Parent to get branch info for is not contained in the outgoing connections.");
      }

      // create the description and add it
      long bitvector = 0x1L << num;
      branches.add(new UnclosedBranchDescriptor(this, bitvector));
      return branches;
    }
    else {
      throw new CompilerException(
        "Error in compiler: Cannot get branch info for successor in a node with no successors.");
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.flink.compiler.CompilerException

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.