Package org.apache.drill.exec.work.fragment

Examples of org.apache.drill.exec.work.fragment.FragmentExecutor


    }
    return Acks.OK;
  }

  public Ack cancelFragment(FragmentHandle handle){
    FragmentExecutor runner = bee.getFragmentRunner(handle);
    if(runner != null) runner.cancel();
    return Acks.OK;
  }
View Full Code Here


      incomingFragments.add(handler);
    }

    public void startFragmentPendingRemote(FragmentManager handler) {
      incomingFragments.remove(handler);
      FragmentExecutor runner = handler.getRunnable();
      RunnableWrapper wrapper = new RunnableWrapper(runner, getId(runner.getContext().getHandle()));
      pendingTasks.add(wrapper);
    }
View Full Code Here

          // logger.debug("Polling for pending work tasks.");
          RunnableWrapper r = pendingTasks.take();
          if (r != null) {
            logger.debug("Starting pending task {}", r);
            if (r.inner instanceof FragmentExecutor) {
              FragmentExecutor fragmentExecutor = (FragmentExecutor) r.inner;
              runningFragments.put(fragmentExecutor.getContext().getHandle(), fragmentExecutor);
            }
            executor.execute(r);
          }

        }
View Full Code Here

      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());
View Full Code Here

    ControlTunnel tunnel = bee.getContext().getController().getTunnel(fragment.getForeman());

    NonRootStatusReporter listener = new NonRootStatusReporter(context, tunnel);
    try{
      FragmentRoot rootOperator = bee.getContext().getPlanReader().readFragmentOperator(fragment.getFragmentJson());
      FragmentExecutor fr = new FragmentExecutor(context, bee, rootOperator, listener);
      bee.addFragmentRunner(fr);
    } catch (Exception e) {
      listener.fail(fragment.getHandle(), "Failure due to uncaught exception", e);
    } catch (OutOfMemoryError t) {
      if(t.getMessage().startsWith("Direct buffer")){
View Full Code Here

    if(manager != null){
      // try remote fragment cancel.
      manager.cancel();
    }else{
      // then try local cancel.
      FragmentExecutor runner = bee.getFragmentRunner(handle);
      if(runner != null) runner.cancel();
    }

    return Acks.OK;
  }
View Full Code Here

  }

  public Ack receivingFragmentFinished(FinishedReceiver finishedReceiver) {
    FragmentManager manager = bee.getContext().getWorkBus().getFragmentManager(finishedReceiver.getSender());

    FragmentExecutor executor;
    if(manager != null) {
      executor = manager.getRunnable();
    } else {
      // then try local cancel.
      executor = bee.getFragmentRunner(finishedReceiver.getSender());
    }

    if (executor != null) {
      executor.receivingFragmentFinished(finishedReceiver.getReceiver());
    }

    return Acks.OK;
  }
View Full Code Here

    }
    return Acks.OK;
  }

  public Ack cancelFragment(FragmentHandle handle) {
    FragmentExecutor runner = bee.getFragmentRunner(handle);
    if (runner != null) {
      runner.cancel();
    }
    return Acks.OK;
  }
View Full Code Here

      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());
View Full Code Here

      if(fragment.getLeafFragment()){
        FragmentContext context = new FragmentContext(bee.getContext(), fragment, null, bee.getContext().getFunctionImplementationRegistry());
        ControlTunnel tunnel = bee.getContext().getController().getTunnel(fragment.getForeman());
        NonRootStatusReporter listener = new NonRootStatusReporter(context, tunnel);
        FragmentRoot rootOperator = bee.getContext().getPlanReader().readFragmentOperator(fragment.getFragmentJson());
        FragmentExecutor fr = new FragmentExecutor(context, bee, rootOperator, listener);
        bee.addFragmentRunner(fr);
      }else{ // isIntermediate, store for incoming data.
        NonRootFragmentManager manager = new NonRootFragmentManager(fragment, bee);
        bee.getContext().getWorkBus().setFragmentManager(manager);
      }
View Full Code Here

TOP

Related Classes of org.apache.drill.exec.work.fragment.FragmentExecutor

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.