Class NullVectorState

java.lang.Object
org.apache.drill.exec.physical.resultSet.impl.NullVectorState
All Implemented Interfaces:
VectorState
Direct Known Subclasses:
NullVectorState.UnmanagedVectorState

public class NullVectorState extends Object implements VectorState
Do-nothing vector state for a map column which has no actual vector associated with it.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Near-do-nothing state for a vector that requires no work to allocate or roll-over, but where we do want to at least track the vector itself.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    allocate(int cardinality)
    Allocate a new vector with the number of elements given.
    void
    Clear the vector(s) associated with this state.
    void
     
    void
    A batch is being harvested after an overflow.
    boolean
    Report whether this column is projected (has materialized vectors), or is unprojected (has no materialized backing.)
    void
    rollover(int cardinality)
    A vector has overflowed.
    void
    A new batch is starting while an look-ahead vector exists.
    <T extends ValueVector>
    T
    Underlying vector: the one presented to the consumer of the result set loader.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NullVectorState

      public NullVectorState()
  • Method Details

    • allocate

      public int allocate(int cardinality)
      Description copied from interface: VectorState
      Allocate a new vector with the number of elements given. If the vector is an array, then the cardinality given is the number of arrays.
      Specified by:
      allocate in interface VectorState
      Parameters:
      cardinality - number of elements desired in the allocated vector
      Returns:
      the number of bytes allocated
    • rollover

      public void rollover(int cardinality)
      Description copied from interface: VectorState
      A vector has overflowed. Create a new look-ahead vector of the given cardinality, then copy the overflow values from the main vector to the look-ahead vector.
      Specified by:
      rollover in interface VectorState
      Parameters:
      cardinality - the number of elements in the new vector. If this vector is an array, then this is the number of arrays
    • harvestWithLookAhead

      public void harvestWithLookAhead()
      Description copied from interface: VectorState
      A batch is being harvested after an overflow. Put the full batch back into the main vector so it can be harvested.
      Specified by:
      harvestWithLookAhead in interface VectorState
    • startBatchWithLookAhead

      public void startBatchWithLookAhead()
      Description copied from interface: VectorState
      A new batch is starting while an look-ahead vector exists. Move the look-ahead buffers into the main vector to prepare for writing the rest of the batch.
      Specified by:
      startBatchWithLookAhead in interface VectorState
    • close

      public void close()
      Description copied from interface: VectorState
      Clear the vector(s) associated with this state.
      Specified by:
      close in interface VectorState
    • vector

      public <T extends ValueVector> T vector()
      Description copied from interface: VectorState
      Underlying vector: the one presented to the consumer of the result set loader.
      Specified by:
      vector in interface VectorState
    • isProjected

      public boolean isProjected()
      Description copied from interface: VectorState
      Report whether this column is projected (has materialized vectors), or is unprojected (has no materialized backing.)
      Specified by:
      isProjected in interface VectorState
      Returns:
      true if the column is projected to the output, false if not
    • dump

      public void dump(HierarchicalFormatter format)
      Specified by:
      dump in interface VectorState