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

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


  /* (non-Javadoc)
   * @see org.apache.drill.exec.work.batch.BitComHandler#cancelFragment(org.apache.drill.exec.proto.ExecProtos.FragmentHandle)
   */
  @Override
  public Ack cancelFragment(FragmentHandle handle){
    IncomingFragmentHandler handler = handlers.get(handle);
    if(handler != null){
      // try remote fragment cancel.
      handler.cancel();
    }else{
      // then try local cancel.
      FragmentRunner runner = bee.getFragmentRunner(handle);
      if(runner != null) runner.cancel();
    }
View Full Code Here


  /**
   * Returns a positive Ack if this fragment is accepted. 
   */
  private Ack incomingRecordBatch(RemoteConnection connection, FragmentRecordBatch fragmentBatch, ByteBuf body) throws FragmentSetupException{
    FragmentHandle handle = fragmentBatch.getHandle();
    IncomingFragmentHandler handler = handlers.get(handle);

    // Create a handler if there isn't already one.
    if(handler == null){
     
      PlanFragment fragment = bee.getContext().getCache().getFragment(handle);
      if(fragment == null){
        logger.error("Received batch where fragment was not in cache.");
        return Acks.FAIL;
      }

      IncomingFragmentHandler newHandler = new RemoteFragmentHandler(fragment, bee.getContext(), bee.getContext().getBitCom().getTunnel(fragment.getForeman()));
     
      // since their could be a race condition on the check, we'll use putIfAbsent so we don't have two competing handlers.
      handler = handlers.putIfAbsent(fragment.getHandle(), newHandler);
         
      if(handler == null){
View Full Code Here

  /* (non-Javadoc)
   * @see org.apache.drill.exec.work.batch.BitComHandler#registerIncomingFragmentHandler(org.apache.drill.exec.work.fragment.IncomingFragmentHandler)
   */
  @Override
  public void registerIncomingFragmentHandler(IncomingFragmentHandler handler){
    IncomingFragmentHandler old = handlers.putIfAbsent(handler.getHandle(), handler);
    assert old == null : "You can only register a fragment handler if one hasn't been registered already.";
  }
View Full Code Here

TOP

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

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.