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
WriteBuffer
put
in interface WriteBuffer
IOException
public int size()
WriteBuffer
size
in interface WriteBuffer
public long memoryOccupancy()
WriteBuffer
memoryOccupancy
in interface WriteBuffer
public boolean flushMemory() throws IOException
WriteBuffer
flushMemory
in interface WriteBuffer
IOException
public void forEach(Comparator<InternalRow> keyComparator, MergeFunction<KeyValue> mergeFunction, @Nullable WriteBuffer.KvConsumer rawConsumer, WriteBuffer.KvConsumer mergedConsumer) throws IOException
WriteBuffer
forEach
in interface WriteBuffer
rawConsumer
- consumer to consume records without merging.mergedConsumer
- consumer to consume records after merging.IOException
public void clear()
WriteBuffer
clear
in interface WriteBuffer
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.