private Page spillAndMaskSpilledPositions(Page page, IntPredicate spillMask)
{
checkState(spillInProgress.isDone(), "Previous spill still in progress");
checkSuccess(spillInProgress, "spilling failed");
if (!spiller.isPresent()) {
spiller = Optional.of(partitioningSpillerFactory.create(
probeTypes,
getPartitionGenerator(),
operatorContext.getSpillContext().newLocalSpillContext(),
operatorContext.newAggregateSystemMemoryContext()));
}
PartitioningSpillResult result = spiller.get().partitionAndSpill(page, spillMask);
spillInProgress = result.getSpillingFuture();
return result.getRetained();
}