Class MarkerFactory
- java.lang.Object
-
- com.amazonaws.athena.connector.lambda.domain.predicate.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
MarkerFactory.SharedBlockMarker
Extends Marker with functionality to allow for sharing the same underlying Apache Arrow Block.
-
Constructor Summary
Constructors Constructor Description MarkerFactory(BlockAllocator allocator)
Creates a new MarkerFactory using the provided BlockAllocator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Marker
create(org.apache.arrow.vector.types.pojo.ArrowType type, Marker.Bound bound)
Creates an empty Marker without nulls.Marker
create(org.apache.arrow.vector.types.pojo.ArrowType type, Object value, Marker.Bound bound)
Creates a Marker without nulls.Marker
createNullable(org.apache.arrow.vector.types.pojo.ArrowType type, Object value, Marker.Bound bound)
Creates a nullable Marker.
-
-
-
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.
-
close
public void close() throws Exception
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
-