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
Constructor and Description |
---|
ResettableExternalBuffer(MemoryManager memoryManager,
IOManager ioManager,
List<MemorySegment> memory,
AbstractRowSerializer serializer,
boolean isRowAllInFixedPart) |
Modifier and Type | Method and Description |
---|---|
void |
add(BaseRow 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 ResettableExternalBuffer(MemoryManager memoryManager, IOManager ioManager, List<MemorySegment> memory, AbstractRowSerializer serializer, boolean isRowAllInFixedPart)
public void reset()
ResettableRowBuffer
reset
in interface ResettableRowBuffer
public void add(BaseRow 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–2020 The Apache Software Foundation. All rights reserved.