Package io.prestosql.spiller
Class GenericPartitioningSpiller
- java.lang.Object
-
- io.prestosql.spiller.GenericPartitioningSpiller
-
- All Implemented Interfaces:
PartitioningSpiller
,Closeable
,AutoCloseable
@ThreadSafe public class GenericPartitioningSpiller extends Object implements PartitioningSpiller
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.prestosql.spiller.PartitioningSpiller
PartitioningSpiller.PartitioningSpillResult
-
-
Constructor Summary
Constructors Constructor Description GenericPartitioningSpiller(List<Type> types, PartitionFunction partitionFunction, SpillContext spillContext, AggregatedMemoryContext memoryContext, SingleStreamSpillerFactory spillerFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes and removes all underlying resources used during spilling.Iterator<Page>
getSpilledPages(int partition)
Returns iterator of previously spilled pages from given partition.PartitioningSpiller.PartitioningSpillResult
partitionAndSpill(Page page, IntPredicate spillPartitionMask)
Partition page and enqueue partitioned pages to spill writers.void
verifyAllPartitionsRead()
-
-
-
Constructor Detail
-
GenericPartitioningSpiller
public GenericPartitioningSpiller(List<Type> types, PartitionFunction partitionFunction, SpillContext spillContext, AggregatedMemoryContext memoryContext, SingleStreamSpillerFactory spillerFactory)
-
-
Method Detail
-
getSpilledPages
public Iterator<Page> getSpilledPages(int partition)
Description copied from interface:PartitioningSpiller
Returns iterator of previously spilled pages from given partition. Callers are expected to call this method once. Calling multiple times can results in undefined behavior.This method may not be called if previously initiated spilling is not finished yet.
This method may perform blocking I/O to flush internal buffers.
- Specified by:
getSpilledPages
in interfacePartitioningSpiller
-
verifyAllPartitionsRead
public void verifyAllPartitionsRead()
- Specified by:
verifyAllPartitionsRead
in interfacePartitioningSpiller
-
partitionAndSpill
public PartitioningSpiller.PartitioningSpillResult partitionAndSpill(Page page, IntPredicate spillPartitionMask)
Description copied from interface:PartitioningSpiller
Partition page and enqueue partitioned pages to spill writers.PartitioningSpiller.PartitioningSpillResult.getSpillingFuture()
is completed when spilling is finished.This method may not be called if previously initiated spilling is not finished yet.
- Specified by:
partitionAndSpill
in interfacePartitioningSpiller
-
close
public void close() throws IOException
Description copied from interface:PartitioningSpiller
Closes and removes all underlying resources used during spilling.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfacePartitioningSpiller
- Throws:
IOException
-
-