Package io.trino.spiller
Class GenericPartitioningSpiller
- java.lang.Object
-
- io.trino.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.trino.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 voidclose()Closes and removes all underlying resources used during spilling.Iterator<Page>getSpilledPages(int partition)Returns iterator of previously spilled pages from given partition.PartitioningSpiller.PartitioningSpillResultpartitionAndSpill(Page page, IntPredicate spillPartitionMask)Partition page and enqueue partitioned pages to spill writers.voidverifyAllPartitionsRead()
-
-
-
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:PartitioningSpillerReturns 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:
getSpilledPagesin interfacePartitioningSpiller
-
verifyAllPartitionsRead
public void verifyAllPartitionsRead()
- Specified by:
verifyAllPartitionsReadin interfacePartitioningSpiller
-
partitionAndSpill
public PartitioningSpiller.PartitioningSpillResult partitionAndSpill(Page page, IntPredicate spillPartitionMask)
Description copied from interface:PartitioningSpillerPartition 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:
partitionAndSpillin interfacePartitioningSpiller
-
close
public void close() throws IOExceptionDescription copied from interface:PartitioningSpillerCloses and removes all underlying resources used during spilling.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfacePartitioningSpiller- Throws:
IOException
-
-