Examples of FragmentHandle


Examples of org.apache.drill.exec.proto.ExecProtos.FragmentHandle

    this.incoming = incoming;
    doSetup(context, incoming, null);

    int fieldId = 0;
    for (DrillbitEndpoint endpoint : popConfig.getDestinations()) {
      FragmentHandle opposite = context.getHandle().toBuilder().setMajorFragmentId(popConfig.getOppositeMajorFragmentId()).setMinorFragmentId(fieldId).build();
      outgoingBatches.add(new OutgoingRecordBatch(stats, sendingAccountor, popConfig,
          context.getDataTunnel(endpoint, opposite), context, oContext.getAllocator(), fieldId, statusHandler));
      fieldId++;
    }
View Full Code Here

Examples of org.apache.drill.exec.proto.ExecProtos.FragmentHandle

    public void flush() throws IOException {
      if (dropAll) {
        vectorContainer.zeroVectors();
        return;
      }
      final FragmentHandle handle = context.getHandle();

      if (recordCount != 0 && !terminated) {

        for(VectorWrapper<?> w : vectorContainer){
          w.getValueVector().getMutator().setValueCount(recordCount);
        }

        FragmentWritableBatch writableBatch = new FragmentWritableBatch(isLast,
                handle.getQueryId(),
                handle.getMajorFragmentId(),
                handle.getMinorFragmentId(),
                operator.getOppositeMajorFragmentId(),
                oppositeMinorFragmentId,
                getWritableBatch());

        updateStats(writableBatch);
        stats.startWait();
        try {
          tunnel.sendRecordBatch(statusHandler, writableBatch);
        } finally {
          stats.stopWait();
        }
        this.sendCount.increment();
      } else {
        logger.debug("Flush requested on an empty outgoing record batch" + (isLast ? " (last batch)" : ""));
        if (isLast || terminated) {
          // send final (empty) batch
          FragmentWritableBatch writableBatch = new FragmentWritableBatch(true,
                  handle.getQueryId(),
                  handle.getMajorFragmentId(),
                  handle.getMinorFragmentId(),
                  operator.getOppositeMajorFragmentId(),
                  oppositeMinorFragmentId,
                  getWritableBatch());
          stats.startWait();
          try {
View Full Code Here

Examples of org.apache.drill.exec.proto.ExecProtos.FragmentHandle

      }
      assertTrue(!context.isFailed());

      exec.stop();

      FragmentHandle handle = context.getHandle();

      /* Form the file name to which the trace output will dump the record batches */
      String qid = QueryIdHelper.getQueryId(handle.getQueryId());

      int majorFragmentId = handle.getMajorFragmentId();
      int minorFragmentId = handle.getMinorFragmentId();

      String logLocation = c.getString(ExecConstants.TRACE_DUMP_DIRECTORY);

      System.out.println("Found log location: " + logLocation);

View Full Code Here

Examples of org.apache.drill.exec.proto.ExecProtos.FragmentHandle

      public int compare(FragmentData o1, FragmentData o2) {
        return o2.getHandle().getMajorFragmentId() - o1.getHandle().getMajorFragmentId();
      }
    });
    for(FragmentData data: fragments){
      FragmentHandle handle = data.getStatus().getHandle();
      switch(data.getStatus().getProfile().getState()){
      case SENDING:
      case AWAITING_ALLOCATION:
      case RUNNING:
        if(data.isLocal()){
View Full Code Here

Examples of org.apache.drill.exec.proto.ExecProtos.FragmentHandle

        if(context.getFailureCause() != null){
            throw context.getFailureCause();
        }
        assertTrue(!context.isFailed());

        FragmentHandle handle = context.getHandle();

        /* Form the file name to which the trace output will dump the record batches */
        String qid = QueryIdHelper.getQueryId(handle.getQueryId());

        int majorFragmentId = handle.getMajorFragmentId();
        int minorFragmentId = handle.getMinorFragmentId();

        String logLocation = c.getString(ExecConstants.TRACE_DUMP_DIRECTORY);

        System.out.println("Found log location: " + logLocation);

View Full Code Here

Examples of org.apache.drill.exec.proto.ExecProtos.FragmentHandle

  private void addFragmentContext(FragmentContext c) {
    if (parent != null){
      parent.addFragmentContext(c);
    }else {
      if(logger.isDebugEnabled()) {
        FragmentHandle hndle;
        String fragStr;
        if(c!=null) {
          hndle = c.getHandle();
          fragStr = (hndle != null) ? (hndle.getMajorFragmentId() + ":" + hndle.getMinorFragmentId()) : "[Null Fragment Handle]";
        }else{
          fragStr = "[Null Context]";
        }
        fragStr+=" (Object Id: "+System.identityHashCode(c)+")";
        StackTraceElement[] ste = (new Throwable()).getStackTrace();
View Full Code Here

Examples of org.apache.drill.exec.proto.ExecProtos.FragmentHandle

        // only fragment level allocators will have the fragment context saved
        parent.removeFragmentContext(c);
      }
    }else{
      if(logger.isDebugEnabled()) {
        FragmentHandle hndle;
        String fragStr;
        if (c != null) {
          hndle = c.getHandle();
          fragStr = (hndle != null) ? (hndle.getMajorFragmentId() + ":" + hndle.getMinorFragmentId()) : "[Null Fragment Handle]";
        } else {
          fragStr = "[Null Context]";
        }
        fragStr += " (Object Id: " + System.identityHashCode(c) + ")";
        logger.debug("Fragment " + fragStr + " removed from root accountor");
View Full Code Here

Examples of org.apache.drill.exec.proto.ExecProtos.FragmentHandle

   * @return
   */
  @Deprecated
  public BufferAllocator getAllocator() {
    if(allocator == null){
      FragmentHandle handle=getHandle();
      String frag=handle!=null?handle.getMajorFragmentId()+":"+handle.getMinorFragmentId():"0:0";
      logger.debug("Fragment:"+frag+" Allocator is NULL");
    }
    return allocator;
  }
View Full Code Here

Examples of org.apache.drill.exec.proto.ExecProtos.FragmentHandle

    if (buffers != null) {
      buffers.close();
    }

    FragmentHandle handle=getHandle();
    String frag=handle!=null?handle.getMajorFragmentId()+":"+handle.getMinorFragmentId():"0:0";
    allocator.close();
    logger.debug("Fragment:"+frag+" After close allocator is: "+allocator!=null?"OK":"NULL");
  }
View Full Code Here

Examples of org.apache.drill.exec.proto.ExecProtos.FragmentHandle

  public VectorContainer getOutgoingContainer() {
    throw new UnsupportedOperationException(String.format(" You should not call getOutgoingContainer() for class %s", this.getClass().getCanonicalName()));
  }

  private void informSenders() {
    FragmentHandle handlePrototype = FragmentHandle.newBuilder()
            .setMajorFragmentId(config.getOppositeMajorFragmentId())
            .setQueryId(context.getHandle().getQueryId())
            .build();
    for (int i = 0; i < config.getNumSenders(); i++) {
      FragmentHandle sender = FragmentHandle.newBuilder(handlePrototype)
              .setMinorFragmentId(i)
              .build();
      FinishedReceiver finishedReceiver = FinishedReceiver.newBuilder()
              .setReceiver(context.getHandle())
              .setSender(sender)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.