Package org.apache.drill.exec.work.batch

Examples of org.apache.drill.exec.work.batch.IncomingBuffers


 
  public RemoteFragmentHandler(PlanFragment fragment, DrillbitContext context, BitTunnel foremanTunnel) throws FragmentSetupException{
    try{
      this.fragment = fragment;
      this.root = context.getPlanReader().readFragmentOperator(fragment.getFragmentJson());
      this.buffers = new IncomingBuffers(root);
      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){
View Full Code Here


    remainingFragmentCount.set(leafFragments.size()+1);
    queryId = rootFragment.getHandle().getQueryId();

    // set up the root fragment first so we'll have incoming buffers available.
    {
      IncomingBuffers buffers = new IncomingBuffers(rootOperator);
     
      FragmentContext rootContext = new FragmentContext(bee.getContext(), rootFragment.getHandle(), rootClient, buffers, new FunctionImplementationRegistry(bee.getContext().getConfig()));
      RootExec rootExec = ImplCreator.getExec(rootContext, rootOperator);
      // add fragment to local node.
      map.put(rootFragment.getHandle(), new FragmentData(rootFragment.getHandle(), null, true));
      rootRunner = new FragmentRunner(rootContext, rootExec, new RootFragmentManager(rootContext, rootFragment));
      LocalFragmentHandler handler = new LocalFragmentHandler(rootFragment.getHandle(), buffers, rootRunner);
      if(buffers.isDone()){
        bee.addFragmentRunner(handler.getRunnable());
      }else{
        bee.getContext().getBitCom().registerIncomingBatchHandler(handler);
      }
     
View Full Code Here

  @Override
  public RecordBatch getBatch(FragmentContext context, RandomReceiver receiver, List<RecordBatch> children)
      throws ExecutionSetupException {
    assert children == null || children.isEmpty();
    IncomingBuffers bufHolder = context.getBuffers();
    assert bufHolder != null : "IncomingBuffers must be defined for any place a receiver is declared.";
   
    RawBatchBuffer[] buffers = bufHolder.getBuffers(receiver.getOppositeMajorFragmentId());
    assert buffers.length == 1;
    RawBatchBuffer buffer = buffers[0];
    return new WireRecordBatch(context, buffer);
  }
View Full Code Here

  @Override
  public RecordBatch getBatch(FragmentContext context, UnorderedReceiver receiver, List<RecordBatch> children)
      throws ExecutionSetupException {
    assert children == null || children.isEmpty();
    IncomingBuffers bufHolder = context.getBuffers();
    assert bufHolder != null : "IncomingBuffers must be defined for any place a receiver is declared.";
   
    RawBatchBuffer[] buffers = bufHolder.getBuffers(receiver.getOppositeMajorFragmentId());
    assert buffers.length == 1;
    RawBatchBuffer buffer = buffers[0];
    return new UnorderedReceiverBatch(context, buffer, receiver);
  }
View Full Code Here

    // set up the root fragment first so we'll have incoming buffers available.
    {
      logger.debug("Setting up root context.");
      FragmentContext rootContext = new FragmentContext(bee.getContext(), rootFragment, rootClient, bee.getContext().getFunctionImplementationRegistry());
      logger.debug("Setting up incoming buffers");
      IncomingBuffers buffers = new IncomingBuffers(rootOperator, rootContext);
      logger.debug("Setting buffers on root context.");
      rootContext.setBuffers(buffers);
      // add fragment to local node.
      status.add(new FragmentData(rootFragment.getHandle(), null, true));
      logger.debug("Fragment added to local node.");
      rootRunner = new FragmentExecutor(rootContext, bee, rootOperator, new RootStatusHandler(rootContext, rootFragment));
      RootFragmentManager fragmentManager = new RootFragmentManager(rootFragment.getHandle(), buffers, rootRunner);

      if(buffers.isDone()){
        // if we don't have to wait for any incoming data, start the fragment runner.
        bee.addFragmentRunner(fragmentManager.getRunnable());
      }else{
        // if we do, record the fragment manager in the workBus.
        workBus.setRootFragmentManager(fragmentManager);
View Full Code Here

      this.fragment = fragment;
      DrillbitContext context = bee.getContext();
      this.bee = bee;
      this.root = context.getPlanReader().readFragmentOperator(fragment.getFragmentJson());
      this.context = new FragmentContext(context, fragment, null, context.getFunctionImplementationRegistry());
      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

                              MergingReceiverPOP receiver,
                              List<RecordBatch> children)
      throws ExecutionSetupException {

    assert children == null || children.isEmpty();
    IncomingBuffers bufHolder = context.getBuffers();

    assert bufHolder != null : "IncomingBuffers must be defined for any place a receiver is declared.";
    RawBatchBuffer[] buffers = bufHolder.getBuffers(receiver.getOppositeMajorFragmentId());

    return new MergingRecordBatch(context, receiver, buffers);
  }
View Full Code Here

    // set up the root fragment first so we'll have incoming buffers available.
    {
      logger.debug("Setting up root context.");
      FragmentContext rootContext = new FragmentContext(bee.getContext(), rootFragment, rootClient, bee.getContext().getFunctionImplementationRegistry());
      logger.debug("Setting up incoming buffers");
      IncomingBuffers buffers = new IncomingBuffers(rootOperator, rootContext);
      logger.debug("Setting buffers on root context.");
      rootContext.setBuffers(buffers);
      // add fragment to local node.
      status.add(new FragmentData(rootFragment.getHandle(), rootFragment.getAssignment(), true));
      logger.debug("Fragment added to local node.");
      rootRunner = new FragmentExecutor(rootContext, bee, rootOperator, new RootStatusHandler(rootContext, rootFragment));
      RootFragmentManager fragmentManager = new RootFragmentManager(rootFragment.getHandle(), buffers, rootRunner);

      if(buffers.isDone()){
        // if we don't have to wait for any incoming data, start the fragment runner.
        bee.addFragmentRunner(fragmentManager.getRunnable());
      }else{
        // if we do, record the fragment manager in the workBus.
        workBus.setFragmentManager(fragmentManager);
View Full Code Here

      this.fragment = fragment;
      DrillbitContext context = bee.getContext();
      this.bee = bee;
      this.root = context.getPlanReader().readFragmentOperator(fragment.getFragmentJson());
      this.context = new FragmentContext(context, fragment, null, context.getFunctionImplementationRegistry());
      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

                              MergingReceiverPOP receiver,
                              List<RecordBatch> children)
      throws ExecutionSetupException {

    assert children == null || children.isEmpty();
    IncomingBuffers bufHolder = context.getBuffers();

    assert bufHolder != null : "IncomingBuffers must be defined for any place a receiver is declared.";
    RawBatchBuffer[] buffers = bufHolder.getBuffers(receiver.getOppositeMajorFragmentId());

    return new MergingRecordBatch(context, receiver, buffers);
  }
View Full Code Here

TOP

Related Classes of org.apache.drill.exec.work.batch.IncomingBuffers

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.