Class SelectionVector2

java.lang.Object
org.apache.drill.exec.record.selection.SelectionVector2
All Implemented Interfaces:
AutoCloseable

public class SelectionVector2 extends Object implements AutoCloseable
A selection vector that fronts, at most, 64K values. The selection vector is used for two cases:
  1. To create a list of values retained by a filter.
  2. To provide a redirection level for sorted batches.
  • Field Details

  • Constructor Details

    • SelectionVector2

      public SelectionVector2(BufferAllocator allocator)
    • SelectionVector2

      public SelectionVector2(BufferAllocator allocator, DrillBuf buf, int count)
      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 buffer
      buf - the buffer containing the selection vector's data
      count - the number of values in the selection vector
    • SelectionVector2

      public SelectionVector2(BufferAllocator allocator, DrillBuf buf, int count, int actualRecordCount)
  • Method Details

    • getCount

      public int getCount()
    • getBuffer

      public DrillBuf getBuffer()
    • getBuffer

      public DrillBuf getBuffer(boolean clear)
    • setBuffer

      public void setBuffer(DrillBuf bufferHandle)
    • 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

      public SelectionVector2 clone()
      Overrides:
      clone in class Object
    • 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 interface AutoCloseable
    • toString

      public String toString()
      Overrides:
      toString in class Object