use of io.prestosql.spi.block.PageBuilderStatus.DEFAULT_MAX_PAGE_SIZE_IN_BYTES in project hetu-core by openlookeng.
the class TaskOutputOperator method addInput.
@Override
public void addInput(Page page) {
requireNonNull(page, "page is null");
Page inputPage = page;
if (snapshotState != null) {
if (snapshotState.processPage(inputPage)) {
inputPage = snapshotState.nextMarker();
}
}
if (inputPage.getPositionCount() == 0) {
return;
}
if (!(inputPage instanceof MarkerPage)) {
inputPage = pagePreprocessor.apply(inputPage);
} else if (isStage0) {
// Do not add marker to final output.
return;
}
List<SerializedPage> serializedPages = splitPage(inputPage, DEFAULT_MAX_PAGE_SIZE_IN_BYTES).stream().map(p -> serde.serialize(p)).collect(toImmutableList());
if (inputPage instanceof MarkerPage) {
// The result is that for buffer #2, it receives marker 2 before marker 1.
synchronized (outputBuffer) {
outputBuffer.enqueue(serializedPages, id);
}
} else {
outputBuffer.enqueue(serializedPages, id);
}
operatorContext.recordOutput(inputPage.getSizeInBytes(), inputPage.getPositionCount());
}
Aggregations