Package org.apache.drill.exec.exception

Examples of org.apache.drill.exec.exception.FragmentSetupException


      this.context = new FragmentContext(context, fragment.getHandle(), null, buffers, new FunctionImplementationRegistry(context.getConfig()));
      this.runnerListener = new RemoteFragmentRunnerListener(this.context, foremanTunnel);
      this.reader = context.getPlanReader();
     
    }catch(IOException e){
      throw new FragmentSetupException("Failure while decoding fragment.", e);
    }
  }
View Full Code Here


    if(batch.getHeader().getIsLastBatch()){
      streamsRemaining.decrementAndGet();
    }
    int sendMajorFragmentId = batch.getHeader().getSendingMajorFragmentId();
    BatchCollector fSet = fragCounts.get(sendMajorFragmentId);
    if (fSet == null) throw new FragmentSetupException(String.format("We received a major fragment id that we were not expecting.  The id was %d.", sendMajorFragmentId));
    boolean decremented = fSet.batchArrived(throttle, batch.getHeader().getSendingMinorFragmentId(), batch);
   
    // we should only return true if remaining required has been decremented and is currently equal to zero.
    return decremented && remainingRequired.get() == 0;
  }
View Full Code Here

    try {
      PhysicalOperator o = store.getSpecificStore(child, iNode.getMinorFragmentId());
//      logger.debug("New materialized store node {} with child {}", o, child);
      return o;
    } catch (PhysicalOperatorSetupException e) {
      throw new FragmentSetupException("Failure while generating a specific Store materialization.");
    }
  }
View Full Code Here

      Stats stats = node.getStats();
      final PhysicalOperator physicalOperatorRoot = node.getRoot();
      boolean isRootNode = rootNode == node;

      if (isRootNode && wrapper.getWidth() != 1)
        throw new FragmentSetupException(
            String.format(
                "Failure while trying to setup fragment.  The root fragment must always have parallelization one.  In the current case, the width was set to %d.",
                wrapper.getWidth()));
      // a fragment is self driven if it doesn't rely on any other exchanges.
      boolean isLeafFragment = node.getReceivingExchangePairs().size() == 0;

      // Create a minorFragment for each major fragment.
      for (int minorFragmentId = 0; minorFragmentId < wrapper.getWidth(); minorFragmentId++) {
        IndexedFragmentNode iNode = new IndexedFragmentNode(minorFragmentId, wrapper);
        PhysicalOperator op = physicalOperatorRoot.accept(materializer, iNode);
        Preconditions.checkArgument(op instanceof FragmentRoot);
        FragmentRoot root = (FragmentRoot) op;

        // get plan as JSON
        String plan;
        try {
          plan = reader.writeJson(root);
        } catch (JsonProcessingException e) {
          throw new FragmentSetupException("Failure while trying to convert fragment into json.", e);
        }

        FragmentHandle handle = FragmentHandle //
            .newBuilder() //
            .setMajorFragmentId(wrapper.getMajorFragmentId()) //
View Full Code Here

//      logger.debug("Value: {}", e.getValue());
    }
    PlanFragment fragment = bee.getContext().getCache().getMap(Foreman.FRAGMENT_CACHE).get(handle);

    if (fragment == null) {
      throw new FragmentSetupException("Received batch where fragment was not in cache.");
    }

    FragmentManager newManager = new NonRootFragmentManager(fragment, bee);

    // since their could be a race condition on the check, we'll use putIfAbsent so we don't have two competing
View Full Code Here

  }
 
  @Override
  public Fragment visitExchange(Exchange exchange, Fragment value) throws FragmentSetupException {
//    logger.debug("Visiting Exchange {}", exchange);
    if(value == null) throw new FragmentSetupException("The simple fragmenter was called without a FragmentBuilder value.  This will only happen if the initial call to SimpleFragmenter is by a Exchange node.  This should never happen since an Exchange node should never be the root node of a plan.");
    Fragment next = getNextBuilder();
    value.addReceiveExchange(exchange, next);
    next.addSendExchange(exchange);
    exchange.getChild().accept(this, next);
    return value;
View Full Code Here

      root = o;
    }
  }
 
  public void addSendExchange(Exchange e) throws FragmentSetupException{
    if(sendingExchange != null) throw new FragmentSetupException("Fragment was trying to add a second SendExchange.  ");
    addOperator(e);
    sendingExchange = e;
  }
View Full Code Here

      this.buffers = new IncomingBuffers(root, this.context);
      this.context.setBuffers(buffers);
      this.runnerListener = new NonRootStatusReporter(this.context, context.getController().getTunnel(fragment.getForeman()));

    }catch(ExecutionSetupException | IOException e){
      throw new FragmentSetupException("Failure while decoding fragment.", e);
    }
  }
View Full Code Here

    if(batch.getHeader().getIsLastBatch()){
      streamsRemaining.decrementAndGet();
    }
    int sendMajorFragmentId = batch.getHeader().getSendingMajorFragmentId();
    DataCollector fSet = fragCounts.get(sendMajorFragmentId);
    if (fSet == null) throw new FragmentSetupException(String.format("We received a major fragment id that we were not expecting.  The id was %d. %s", sendMajorFragmentId, Arrays.toString(fragCounts.values().toArray())));
    try {
      synchronized(this){
        boolean decremented = fSet.batchArrived(batch.getHeader().getSendingMinorFragmentId(), batch);

        // we should only return true if remaining required has been decremented and is currently equal to zero.
        return decremented && remainingRequired.get() == 0;
      }
    } catch (IOException e) {
      throw new FragmentSetupException(e);
    }
  }
View Full Code Here

      PhysicalOperator o = store.getSpecificStore(child, iNode.getMinorFragmentId());
      o.setOperatorId(Short.MAX_VALUE & store.getOperatorId());
//      logger.debug("New materialized store node {} with child {}", o, child);
      return o;
    } catch (PhysicalOperatorSetupException e) {
      throw new FragmentSetupException("Failure while generating a specific Store materialization.");
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.drill.exec.exception.FragmentSetupException

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.