Package io.trino.spiller
Class FileSingleStreamSpiller
- java.lang.Object
-
- io.trino.spiller.FileSingleStreamSpiller
-
- All Implemented Interfaces:
SingleStreamSpiller,Closeable,AutoCloseable
@NotThreadSafe public class FileSingleStreamSpiller extends Object implements SingleStreamSpiller
-
-
Constructor Summary
Constructors Constructor Description FileSingleStreamSpiller(PagesSerde serde, com.google.common.util.concurrent.ListeningExecutorService executor, Path spillPath, SpillerStats spillerStats, SpillContext spillContext, LocalMemoryContext memoryContext, Optional<SpillCipher> spillCipher, Runnable fileSystemErrorHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close releases/removes all underlying resources used during spilling like for example all created temporary files.com.google.common.util.concurrent.ListenableFuture<List<Page>>getAllSpilledPages()Initiates read of previously spilled pages.Iterator<Page>getSpilledPages()Returns list of previously spilled Pages as a single stream.longgetSpilledPagesInMemorySize()Returns estimate size of pages that would be returned bySingleStreamSpiller.getAllSpilledPages().com.google.common.util.concurrent.ListenableFuture<?>spill(Iterator<Page> pageIterator)Initiate spilling of pages stream.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.trino.spiller.SingleStreamSpiller
spill
-
-
-
-
Constructor Detail
-
FileSingleStreamSpiller
public FileSingleStreamSpiller(PagesSerde serde, com.google.common.util.concurrent.ListeningExecutorService executor, Path spillPath, SpillerStats spillerStats, SpillContext spillContext, LocalMemoryContext memoryContext, Optional<SpillCipher> spillCipher, Runnable fileSystemErrorHandler)
-
-
Method Detail
-
spill
public com.google.common.util.concurrent.ListenableFuture<?> spill(Iterator<Page> pageIterator)
Description copied from interface:SingleStreamSpillerInitiate spilling of pages stream. Returns completed future once spilling has finished. Next spill can be initiated as soon as previous one completes.- Specified by:
spillin interfaceSingleStreamSpiller
-
getSpilledPagesInMemorySize
public long getSpilledPagesInMemorySize()
Description copied from interface:SingleStreamSpillerReturns estimate size of pages that would be returned bySingleStreamSpiller.getAllSpilledPages().- Specified by:
getSpilledPagesInMemorySizein interfaceSingleStreamSpiller
-
getSpilledPages
public Iterator<Page> getSpilledPages()
Description copied from interface:SingleStreamSpillerReturns list of previously spilled Pages as a single stream. Pages are in the same order as they were spilled. Method requires the issued spill request to be completed.- Specified by:
getSpilledPagesin interfaceSingleStreamSpiller
-
getAllSpilledPages
public com.google.common.util.concurrent.ListenableFuture<List<Page>> getAllSpilledPages()
Description copied from interface:SingleStreamSpillerInitiates read of previously spilled pages. The returnedFuturewill be complete once all pages are read.- Specified by:
getAllSpilledPagesin interfaceSingleStreamSpiller
-
close
public void close()
Description copied from interface:SingleStreamSpillerClose releases/removes all underlying resources used during spilling like for example all created temporary files.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceSingleStreamSpiller
-
-