public class SortBufferWriteBuffer extends Object implements WriteBuffer
WriteBuffer which stores records in BinaryInMemorySortBuffer.WriteBuffer.KvConsumer| Constructor and Description |
|---|
SortBufferWriteBuffer(RowType keyType,
RowType valueType,
FieldsComparator userDefinedSeqComparator,
MemorySegmentPool memoryPool,
boolean spillable,
MemorySize maxDiskSize,
int sortMaxFan,
CompressOptions compression,
IOManager ioManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all records from this table.
|
boolean |
flushMemory()
Flush memory, return false if not supported.
|
void |
forEach(Comparator<InternalRow> keyComparator,
MergeFunction<KeyValue> mergeFunction,
WriteBuffer.KvConsumer rawConsumer,
WriteBuffer.KvConsumer mergedConsumer)
Performs the given action for each remaining element in this buffer until all elements have
been processed or the action throws an exception.
|
long |
memoryOccupancy()
Memory occupancy size of this table.
|
boolean |
put(long sequenceNumber,
RowKind valueKind,
InternalRow key,
InternalRow value)
Put a record with sequence number and value kind.
|
int |
size()
Record size of this table.
|
public SortBufferWriteBuffer(RowType keyType, RowType valueType, @Nullable FieldsComparator userDefinedSeqComparator, MemorySegmentPool memoryPool, boolean spillable, MemorySize maxDiskSize, int sortMaxFan, CompressOptions compression, IOManager ioManager)
public boolean put(long sequenceNumber,
RowKind valueKind,
InternalRow key,
InternalRow value)
throws IOException
WriteBufferput in interface WriteBufferIOExceptionpublic int size()
WriteBuffersize in interface WriteBufferpublic long memoryOccupancy()
WriteBuffermemoryOccupancy in interface WriteBufferpublic boolean flushMemory()
throws IOException
WriteBufferflushMemory in interface WriteBufferIOExceptionpublic void forEach(Comparator<InternalRow> keyComparator, MergeFunction<KeyValue> mergeFunction, @Nullable WriteBuffer.KvConsumer rawConsumer, WriteBuffer.KvConsumer mergedConsumer) throws IOException
WriteBufferforEach in interface WriteBufferrawConsumer - consumer to consume records without merging.mergedConsumer - consumer to consume records after merging.IOExceptionpublic void clear()
WriteBufferclear in interface WriteBufferCopyright © 2023–2024 The Apache Software Foundation. All rights reserved.