Examples of IterOutcome


Examples of org.apache.drill.exec.record.RecordBatch.IterOutcome

      stop();

      return false;
    }

    IterOutcome out;
    if (!done) {
      out = next(incoming);
    } else {
      incoming.kill(true);
      out = IterOutcome.NONE;
View Full Code Here

Examples of org.apache.drill.exec.record.RecordBatch.IterOutcome

        stop();
        context.fail(this.listener.ex);
        return false;
      }

      IterOutcome outcome = next(incoming);
//      logger.debug("Screen Outcome {}", outcome);
      switch(outcome){
      case STOP: {
        this.internalStop();
        boolean verbose = context.getOptions().getOption(ExecConstants.ENABLE_VERBOSE_ERRORS_KEY).bool_val;
View Full Code Here

Examples of org.apache.drill.exec.record.RecordBatch.IterOutcome

    }
  }

  public final IterOutcome next(RecordBatch b){
    stats.stopProcessing();
    IterOutcome next;
    try {
      next = b.next();
    } finally {
      stats.startProcessing();
    }
View Full Code Here

Examples of org.apache.drill.exec.record.RecordBatch.IterOutcome

          while (true) {
            // Cleanup the previous batch since we are done processing it.
            for (VectorWrapper<?> v : incoming) {
              v.getValueVector().clear();
            }
            IterOutcome out = outgoing.next(0, incoming);
            if (EXTRA_DEBUG_1) {
              logger.debug("Received IterOutcome of {}", out);
            }
            switch (out) {
            case NOT_YET:
View Full Code Here

Examples of org.apache.drill.exec.record.RecordBatch.IterOutcome

        // Done processing all records in the previous batch, clean up!
        for (VectorWrapper<?> wrapper : probeBatch) {
          wrapper.getValueVector().clear();
        }

        IterOutcome leftUpstream = outgoingJoinBatch.next(HashJoinHelper.LEFT_INPUT, probeBatch);

        switch (leftUpstream) {
          case NONE:
          case NOT_YET:
          case STOP:
View Full Code Here

Examples of org.apache.drill.exec.record.RecordBatch.IterOutcome

        allocateOutgoing();
      }

      if (incoming.getRecordCount() == 0) {
        outer: while (true) {
          IterOutcome out = outgoing.next(0, incoming);
          switch (out) {
            case OK_NEW_SCHEMA:
            case OK:
              if (incoming.getRecordCount() == 0) {
                continue;
              } else {
                break outer;
              }
            case NONE:
              out = IterOutcome.OK_NEW_SCHEMA;
            case STOP:
            default:
              lastOutcome = out;
              outcome = out;
              done = true;
              return AggOutcome.CLEANUP_AND_RETURN;
          }
        }
      }

      // pick up a remainder batch if we have one.
      if (remainderBatch != null) {
        if (!outputToBatch( previousIndex )) {
          return tooBigFailure();
        }
        remainderBatch.clear();
        remainderBatch = null;
        return setOkAndReturn();
      }


      // setup for new output and pick any remainder.
      if (pendingOutput) {
        allocateOutgoing();
        pendingOutput = false;
        if (EXTRA_DEBUG) {
          logger.debug("Attempting to output remainder.");
        }
        if (!outputToBatch( previousIndex)) {
          return tooBigFailure();
        }
      }

      if (newSchema) {
        return AggOutcome.UPDATE_AGGREGATOR;
      }

      if (lastOutcome != null) {
        outcome = lastOutcome;
        return AggOutcome.CLEANUP_AND_RETURN;
      }

      outside: while(true) {
      // loop through existing records, adding as necessary.
        for (; underlyingIndex < incoming.getRecordCount(); incIndex()) {
          if (EXTRA_DEBUG) {
            logger.debug("Doing loop with values underlying {}, current {}", underlyingIndex, currentIndex);
          }
          if (previousIndex == -1) {
            if (EXTRA_DEBUG) {
              logger.debug("Adding the initial row's keys and values.");
            }
            addRecordInc(currentIndex);
          }
          else if (isSame( previousIndex, currentIndex )) {
            if (EXTRA_DEBUG) {
              logger.debug("Values were found the same, adding.");
            }
            addRecordInc(currentIndex);
          } else {
            if (EXTRA_DEBUG) {
              logger.debug("Values were different, outputting previous batch.");
            }
            if (outputToBatch(previousIndex)) {
              if (EXTRA_DEBUG) {
                logger.debug("Output successful.");
              }
              addRecordInc(currentIndex);
            } else {
              if (EXTRA_DEBUG) {
                logger.debug("Output failed.");
              }
              if (outputCount == 0) {
                return tooBigFailure();
              }

              // mark the pending output but move forward for the next cycle.
              pendingOutput = true;
              previousIndex = currentIndex;
              incIndex();
              return setOkAndReturn();

            }
          }
          previousIndex = currentIndex;
        }


        InternalBatch previous = null;

        try {
          while (true) {
            if (previous != null) {
              previous.clear();
            }
            previous = new InternalBatch(incoming);
            IterOutcome out = outgoing.next(0, incoming);
            if (EXTRA_DEBUG) {
              logger.debug("Received IterOutcome of {}", out);
            }
            switch (out) {
            case NONE:
View Full Code Here

Examples of org.apache.drill.exec.record.RecordBatch.IterOutcome

      stop();

      return false;
    }

    IterOutcome out;
    if (!done) {
      out = next(incoming);
    } else {
      incoming.kill(true);
      out = IterOutcome.NONE;
View Full Code Here

Examples of org.apache.drill.exec.record.RecordBatch.IterOutcome

        incoming.kill(false);

        return false;
      }

      IterOutcome out;
      if (!done) {
        out = next(incoming);
      } else {
        incoming.kill(true);
        out = IterOutcome.NONE;
View Full Code Here

Examples of org.apache.drill.exec.record.RecordBatch.IterOutcome

        stop();
        context.fail(this.listener.ex);
        return false;
      }

      IterOutcome outcome = next(incoming);
//      logger.debug("Screen Outcome {}", outcome);
      switch(outcome){
      case STOP: {
        this.internalStop();
        boolean verbose = context.getOptions().getOption(ExecConstants.ENABLE_VERBOSE_ERRORS_KEY).bool_val;
View Full Code Here

Examples of org.apache.drill.exec.record.RecordBatch.IterOutcome

          while(true){
            // Cleanup the previous batch since we are done processing it.
            for (VectorWrapper<?> v : incoming) {
              v.getValueVector().clear();
            }
            IterOutcome out = outgoing.next(0, incoming);
            if(EXTRA_DEBUG_1) logger.debug("Received IterOutcome of {}", out);
            switch(out){
            case NOT_YET:
              this.outcome = out;
              return AggOutcome.RETURN_OUTCOME;
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.