public class ResettableExternalBuffer extends Object implements ResettableRowBuffer
NOTE: Not supports reading while writing. In the face of concurrent modification, the iterator fails quickly and cleanly, rather than risking arbitrary, non-deterministic behavior at an undetermined time in the future.
Modifier and Type | Class and Description |
---|---|
class |
ResettableExternalBuffer.BufferIterator
Iterator of external buffer.
|
ResettableRowBuffer.ResettableIterator
Modifier and Type | Field and Description |
---|---|
static int |
MIN_NUM_MEMORY
The minimum number of segments that are required, 320 KibiBytes.
|
Constructor and Description |
---|
ResettableExternalBuffer(IOManager ioManager,
LazyMemorySegmentPool pool,
AbstractRowDataSerializer serializer,
boolean isRowAllInFixedPart) |
Modifier and Type | Method and Description |
---|---|
void |
add(RowData row)
Appends the specified row to the end of this buffer.
|
void |
close()
Delete all files and release the memory.
|
void |
complete()
Finally, complete add.
|
int |
getNumSpillFiles() |
long |
getSpillInBytes() |
long |
getUsedMemoryInBytes() |
ResettableExternalBuffer.BufferIterator |
newIterator()
Get a new iterator starting from first row.
|
ResettableExternalBuffer.BufferIterator |
newIterator(int beginRow)
Get a new iterator starting from the `beginRow`-th row.
|
void |
reset()
Re-initialize the buffer state.
|
int |
size() |
public static final int MIN_NUM_MEMORY
public ResettableExternalBuffer(IOManager ioManager, LazyMemorySegmentPool pool, AbstractRowDataSerializer serializer, boolean isRowAllInFixedPart)
public void reset()
ResettableRowBuffer
reset
in interface ResettableRowBuffer
public void add(RowData row) throws IOException
ResettableRowBuffer
add
in interface ResettableRowBuffer
IOException
public void complete()
ResettableRowBuffer
complete
in interface ResettableRowBuffer
public ResettableExternalBuffer.BufferIterator newIterator()
ResettableRowBuffer
newIterator
in interface ResettableRowBuffer
public ResettableExternalBuffer.BufferIterator newIterator(int beginRow)
ResettableRowBuffer
newIterator
in interface ResettableRowBuffer
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public int size()
public long getUsedMemoryInBytes()
public int getNumSpillFiles()
public long getSpillInBytes()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.