Class SortRecordBatchBuilder
java.lang.Object
org.apache.drill.exec.physical.impl.sort.SortRecordBatchBuilder
- All Implemented Interfaces:
AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(RecordBatchData rbd) booleanadd(VectorAccessible batch) Add another record batch to the set of record batches.voidbuild(VectorContainer outputContainer) voidclear()voidclose()getSv4()booleanisEmpty()static longmemoryNeeded(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:
closein 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
-