Class SortRecordBatchBuilder
java.lang.Object
org.apache.drill.exec.physical.impl.sort.SortRecordBatchBuilder
- All Implemented Interfaces:
AutoCloseable
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(RecordBatchData rbd) boolean
add
(VectorAccessible batch) Add another record batch to the set of record batches.void
build
(VectorContainer outputContainer) void
clear()
void
close()
getSv4()
boolean
isEmpty()
static long
memoryNeeded
(int recordCount) For given record count, return the memory that SortRecordBatchBuilder needs for its own purpose.
-
Constructor Details
-
SortRecordBatchBuilder
-
-
Method Details
-
add
Add another record batch to the set of record batches. TODO: Refactor this and other(RecordBatchData)
method into one method.- Parameters:
batch
-- Returns:
- True if the requested add completed successfully. Returns false in the case that this builder is full and cannot receive additional packages.
- Throws:
SchemaChangeException
-
add
-
isEmpty
public boolean isEmpty() -
build
-
getSv4
-
clear
public void clear() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
getHeldRecordBatches
-
memoryNeeded
public static long memoryNeeded(int recordCount) For given record count, return the memory that SortRecordBatchBuilder needs for its own purpose. This is used in ExternalSortBatch to make decisions about whether to spill or not.- Parameters:
recordCount
- expected output record count- Returns:
- number of bytes needed for an SV4, power-of-two rounded
-