Class MarkerFactory

  • All Implemented Interfaces:
    AutoCloseable

    public class MarkerFactory
    extends Object
    implements AutoCloseable
    Constraints require typed values in the form of Markers. Each Marker contains, at most, one typed value. This model is awkward to map into Apache Arrow's VectorSchema or RecordBatch constructs without significant memory overhead. To reduce the memory requirement associated with Markers and constraint processing we use a MarkerFactory that is capable of sharing an underlying Apache Arrow Block across multiple Markers. In Testing this was 100x more performant than having a 1-1 relationship between Markers and VectorSchema.
    • Constructor Detail

      • MarkerFactory

        public MarkerFactory​(BlockAllocator allocator)
        Creates a new MarkerFactory using the provided BlockAllocator.
        Parameters:
        allocator - The BlockAllocator to use when creating Apache Arrow resources.
    • Method Detail

      • createNullable

        public Marker createNullable​(org.apache.arrow.vector.types.pojo.ArrowType type,
                                     Object value,
                                     Marker.Bound bound)
        Creates a nullable Marker.
        Parameters:
        type - The type of the value represented by this Marker.
        value - The value of this Marker.
        bound - The Bound of this Marker.
        Returns:
        The newly created SharedBlockMarker satisfying the supplied criteria.
      • create

        public Marker create​(org.apache.arrow.vector.types.pojo.ArrowType type,
                             Object value,
                             Marker.Bound bound)
        Creates a Marker without nulls.
        Parameters:
        type - The type of the value represented by this Marker.
        value - The value of this Marker.
        bound - The Bound of this Marker.
        Returns:
        The newly created Marker satisfying the supplied criteria.
      • create

        public Marker create​(org.apache.arrow.vector.types.pojo.ArrowType type,
                             Marker.Bound bound)
        Creates an empty Marker without nulls.
        Parameters:
        type - The type of the value represented by this Marker.
        bound - The Bound of this Marker.
        Returns:
        The newly created Marker satisfying the supplied criteria.