Exemplo n.º 1
0
  @Override
  public Page getOutput() {
    if (state == State.NEEDS_INPUT || state == State.FINISHED) {
      return null;
    }

    Page page = extractOutput();
    operatorContext.setMemoryReservation(pagesIndex.getEstimatedSize().toBytes());
    return page;
  }
Exemplo n.º 2
0
  @Override
  public void addInput(Page page) {
    checkState(state == State.NEEDS_INPUT, "Operator can not take input at this time");
    requireNonNull(page, "page is null");
    checkState(pendingInput == null, "Operator already has pending input");

    if (page.getPositionCount() == 0) {
      return;
    }

    pendingInput = page;
    if (processPendingInput()) {
      state = State.HAS_OUTPUT;
    }
    operatorContext.setMemoryReservation(pagesIndex.getEstimatedSize().toBytes());
  }