Package io.prestosql.spiller
Class FileSingleStreamSpiller
- java.lang.Object
-
- io.prestosql.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 void
close()
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.long
getSpilledPagesInMemorySize()
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.prestosql.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:SingleStreamSpiller
Initiate spilling of pages stream. Returns completed future once spilling has finished. Next spill can be initiated as soon as previous one completes.- Specified by:
spill
in interfaceSingleStreamSpiller
-
getSpilledPagesInMemorySize
public long getSpilledPagesInMemorySize()
Description copied from interface:SingleStreamSpiller
Returns estimate size of pages that would be returned bySingleStreamSpiller.getAllSpilledPages()
.- Specified by:
getSpilledPagesInMemorySize
in interfaceSingleStreamSpiller
-
getSpilledPages
public Iterator<Page> getSpilledPages()
Description copied from interface:SingleStreamSpiller
Returns 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:
getSpilledPages
in interfaceSingleStreamSpiller
-
getAllSpilledPages
public com.google.common.util.concurrent.ListenableFuture<List<Page>> getAllSpilledPages()
Description copied from interface:SingleStreamSpiller
Initiates read of previously spilled pages. The returnedFuture
will be complete once all pages are read.- Specified by:
getAllSpilledPages
in interfaceSingleStreamSpiller
-
close
public void close()
Description copied from interface:SingleStreamSpiller
Close releases/removes all underlying resources used during spilling like for example all created temporary files.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceSingleStreamSpiller
-
-