Module org.elasticsearch.compute
Class AbstractArrowBufVector<V extends Vector,B extends Block>
java.lang.Object
org.elasticsearch.compute.data.AbstractNonThreadSafeRefCounted
org.elasticsearch.compute.data.arrow.AbstractArrowBufVector<V,B>
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.lucene.util.Accountable,Vector,org.elasticsearch.core.RefCounted,org.elasticsearch.core.Releasable
- Direct Known Subclasses:
BooleanArrowBufVector,BytesRefArrowBufVector,DoubleArrowBufVector,Float16ArrowBufVector,FloatArrowBufVector,Int16ArrowBufVector,Int8ArrowBufVector,IntArrowBufVector,LongArrowBufVector,LongMul1kArrowBufVector,UInt16ArrowBufVector,UInt32ArrowBufVector,UInt8ArrowBufVector
public abstract class AbstractArrowBufVector<V extends Vector,B extends Block>
extends AbstractNonThreadSafeRefCounted
implements Vector
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.compute.data.Vector
Vector.Builder -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BlockFactoryprotected booleanprotected final intprotected final org.apache.arrow.memory.ArrowBufFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLEFields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCEDFields inherited from interface org.elasticsearch.compute.data.Vector
SERIALIZE_VECTOR_ARRAY, SERIALIZE_VECTOR_BIG_ARRAY, SERIALIZE_VECTOR_CONSTANT, SERIALIZE_VECTOR_ORDINAL, SERIALIZE_VECTOR_VALUES -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractArrowBufVector(org.apache.arrow.memory.ArrowBuf valueBuffer, int positionCount, BlockFactory blockFactory) Create an ArrowBuf ES|QL vector based on the constituents of an ArrowValueVector.protectedAbstractArrowBufVector(org.apache.arrow.vector.FixedWidthVector arrowVector, BlockFactory blockFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidBefore passing a Vector to another Driver, it is necessary to switch the owning block factory to its parent, which is associated with the global circuit breaker.asBlock()Returns a new Block containing this vector.protected abstract ArrowBufBlockConstructor<B> The block factory associated with this vector.protected abstract intbyteSize()protected voidThis is called when the number of references reaches zero.filter(boolean mayContainDuplicates, int... positions) Creates a new vector that only exposes the positions provided.intReturns the number of positions (rows) in this vector.booleanReturns true iff this vector is a constant vector - returns the same constant value for every position.keepMask(BooleanVector mask) longvoidReleases (decrements the reference count) this vector's Arrow buffersvoidRetains (increments the reference count) this vector's Arrow buffersprotected abstract ArrowBufVectorConstructor<V> Methods inherited from class org.elasticsearch.compute.data.AbstractNonThreadSafeRefCounted
close, decRef, hasReferences, incRef, isReleased, tryIncRefMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResourcesMethods inherited from interface org.elasticsearch.core.RefCounted
decRef, hasReferences, incRef, mustIncRef, tryIncRefMethods inherited from interface org.elasticsearch.core.Releasable
closeMethods inherited from interface org.elasticsearch.compute.data.Vector
deepCopy, elementType, isReleased, lookup, slice
-
Field Details
-
valueBuffer
protected final org.apache.arrow.memory.ArrowBuf valueBuffer -
positionCount
protected final int positionCount -
blockFactory
-
closed
protected boolean closed
-
-
Constructor Details
-
AbstractArrowBufVector
protected AbstractArrowBufVector(org.apache.arrow.memory.ArrowBuf valueBuffer, int positionCount, BlockFactory blockFactory) Create an ArrowBuf ES|QL vector based on the constituents of an ArrowValueVector. The caller must retain the buffer if it's shared with other blocks or Arrow vectors. -
AbstractArrowBufVector
protected AbstractArrowBufVector(org.apache.arrow.vector.FixedWidthVector arrowVector, BlockFactory blockFactory)
-
-
Method Details
-
retainBuffers
public void retainBuffers()Retains (increments the reference count) this vector's Arrow buffers -
releaseBuffers
public void releaseBuffers()Releases (decrements the reference count) this vector's Arrow buffers -
byteSize
protected abstract int byteSize() -
vectorConstructor
-
blockConstructor
-
closeInternal
protected void closeInternal()Description copied from class:AbstractNonThreadSafeRefCountedThis is called when the number of references reaches zero. This is where resources should be released (adjusting circuit breakers if needed).- Specified by:
closeInternalin classAbstractNonThreadSafeRefCounted
-
getPositionCount
public int getPositionCount()Description copied from interface:VectorReturns the number of positions (rows) in this vector. See class javadoc for the usual way to iterate these positions.- Specified by:
getPositionCountin interfaceVector- Returns:
- the number of positions (rows) in this vector
-
isConstant
public boolean isConstant()Description copied from interface:VectorReturns true iff this vector is a constant vector - returns the same constant value for every position.- Specified by:
isConstantin interfaceVector- Returns:
- true iff this vector is a constant vector - returns the same constant value for every position
-
blockFactory
Description copied from interface:VectorThe block factory associated with this vector.- Specified by:
blockFactoryin interfaceVector
-
allowPassingToDifferentDriver
public void allowPassingToDifferentDriver()Description copied from interface:VectorBefore passing a Vector to another Driver, it is necessary to switch the owning block factory to its parent, which is associated with the global circuit breaker. This ensures that when the new driver releases this Vector, it returns memory directly to the parent block factory instead of the local block factory of this Block. This is important because the local block factory is not thread safe and doesn't support simultaneous access by more than one thread.- Specified by:
allowPassingToDifferentDriverin interfaceVector
-
asBlock
Description copied from interface:VectorReturns a new Block containing this vector. -
keepMask
Description copied from interface:Vector -
ramBytesUsed
public long ramBytesUsed()- Specified by:
ramBytesUsedin interfaceorg.apache.lucene.util.Accountable
-
filter
Description copied from interface:VectorCreates a new vector that only exposes the positions provided. Materialization of the selected positions is avoided.
-