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
-
Constructor Summary
ConstructorDescriptionSelectionVector2
(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 TypeMethodDescriptionvoid
allocateNew
(int size) boolean
allocateNewSafe
(int size) boolean
void
clear()
clone()
void
close()
int
getBuffer
(boolean clear) int
getCount()
long
char
getIndex
(int index) void
setBatchActualRecordCount
(int actualRecordCount) void
void
setIndex
(int index, char value) void
setIndex
(int index, int value) void
setRecordCount
(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:
close
in interfaceAutoCloseable
-
toString
-