@Internal @Deprecated public class BufferSpiller extends Object implements BufferBlocker
This implementation buffers data effectively in the OS cache, which gracefully extends to the disk. Most data is written and re-read milliseconds later. The file is deleted after the read. Consequently, in most cases, the data will never actually hit the physical disks.
IMPORTANT: The SpilledBufferOrEventSequences created by this spiller all reuse the same reading memory (to reduce overhead) and can consequently not be read concurrently.
限定符和类型 | 类和说明 |
---|---|
static class |
BufferSpiller.SpilledBufferOrEventSequence
已过时。
|
构造器和说明 |
---|
BufferSpiller(org.apache.flink.runtime.io.disk.iomanager.IOManager ioManager,
int pageSize)
已过时。
Creates a new buffer spiller, spilling to one of the I/O manager's temp directories.
|
限定符和类型 | 方法和说明 |
---|---|
void |
add(org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent boe)
已过时。
Adds a buffer or event to the sequence of spilled buffers and events.
|
void |
close()
已过时。
Cleans up the current spilling channel and file.
|
long |
getBytesBlocked()
已过时。
Gets the number of bytes written in the current spill file.
|
BufferOrEventSequence |
rollOverReusingResources()
已过时。
NOTE: The BufferOrEventSequences created by this method all reuse the same reading memory
(to reduce overhead) and can consequently not be read concurrently with each other.
|
BufferOrEventSequence |
rollOverWithoutReusingResources()
已过时。
The BufferOrEventSequence returned by this method is safe for concurrent consumption with
any previously returned sequence.
|
public BufferSpiller(org.apache.flink.runtime.io.disk.iomanager.IOManager ioManager, int pageSize) throws IOException
ioManager
- The I/O manager for access to the temp directories.pageSize
- The page size used to re-create spilled buffers.IOException
- Thrown if the temp files for spilling cannot be initialized.public void add(org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent boe) throws IOException
add
在接口中 BufferBlocker
boe
- The buffer or event to add and spill.IOException
- Thrown, if the buffer of event could not be spilled.public BufferOrEventSequence rollOverReusingResources() throws IOException
To create a sequence that can be read concurrently with the previous BufferOrEventSequence,
use the rollOverWithoutReusingResources()
()} method.
rollOverReusingResources
在接口中 BufferBlocker
IOException
- Thrown, if the readable sequence could not be created, or no new spill
file could be created.public BufferOrEventSequence rollOverWithoutReusingResources() throws IOException
rollOverWithoutReusingResources
在接口中 BufferBlocker
IOException
- Thrown, if the readable sequence could not be created, or no new spill
file could be created.public void close() throws IOException
Does not clean up the SpilledBufferOrEventSequences generated by calls to
rollOver(boolean false)
.
close
在接口中 BufferBlocker
IOException
- Thrown if channel closing or file deletion fail.public long getBytesBlocked()
getBytesBlocked
在接口中 BufferBlocker
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.