Class SelectionVector2
java.lang.Object
org.apache.drill.exec.record.selection.SelectionVector2
- All Implemented Interfaces:
AutoCloseable
A selection vector that fronts, at most, 64K values.
The selection vector is used for two cases:
- To create a list of values retained by a filter.
- To provide a redirection level for sorted batches.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSelectionVector2(BufferAllocator allocator) SelectionVector2(BufferAllocator allocator, DrillBuf buf, int count) Create a selection vector with the given buffer.SelectionVector2(BufferAllocator allocator, DrillBuf buf, int count, int actualRecordCount) -
Method Summary
Modifier and TypeMethodDescriptionvoidallocateNew(int size) booleanallocateNewSafe(int size) booleanvoidclear()clone()voidclose()intgetBuffer(boolean clear) intgetCount()longchargetIndex(int index) voidsetBatchActualRecordCount(int actualRecordCount) voidvoidsetIndex(int index, char value) voidsetIndex(int index, int value) voidsetRecordCount(int recordCount) toString()
-
Field Details
-
RECORD_SIZE
public static final int RECORD_SIZE- See Also:
-
-
Constructor Details
-
SelectionVector2
-
SelectionVector2
Create a selection vector with the given buffer. The selection vector increments the buffer's reference count, talking ownership of the buffer.- Parameters:
allocator- allocator used to allocate the bufferbuf- the buffer containing the selection vector's datacount- the number of values in the selection vector
-
SelectionVector2
-
-
Method Details
-
getCount
public int getCount() -
getBuffer
-
getBuffer
-
setBuffer
-
getIndex
public char getIndex(int index) -
setIndex
public void setIndex(int index, char value) -
getDataAddr
public long getDataAddr() -
setIndex
public void setIndex(int index, int value) -
allocateNewSafe
public boolean allocateNewSafe(int size) -
allocateNew
public void allocateNew(int size) -
clone
-
clear
public void clear() -
setRecordCount
public void setRecordCount(int recordCount) -
canDoFullTransfer
public boolean canDoFullTransfer() -
setBatchActualRecordCount
public void setBatchActualRecordCount(int actualRecordCount) -
getBatchActualRecordCount
public int getBatchActualRecordCount() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
toString
-