Module org.elasticsearch.compute
Class FloatArrowBufVector
java.lang.Object
org.elasticsearch.compute.data.AbstractNonThreadSafeRefCounted
org.elasticsearch.compute.data.arrow.AbstractArrowBufVector<FloatVector,FloatBlock>
org.elasticsearch.compute.data.arrow.FloatArrowBufVector
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.lucene.util.Accountable,FloatVector,Vector,org.elasticsearch.core.RefCounted,org.elasticsearch.core.Releasable
public final class FloatArrowBufVector
extends AbstractArrowBufVector<FloatVector,FloatBlock>
implements FloatVector
Implementation of FloatVector backed by an Arrow buffer holding 32 bits floats.
This class is generated. Edit X-ArrowBufVector.java.st instead.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.compute.data.FloatVector
FloatVector.Builder, FloatVector.FixedBuilderNested classes/interfaces inherited from interface org.elasticsearch.compute.data.Vector
Vector.Builder -
Field Summary
Fields inherited from class org.elasticsearch.compute.data.arrow.AbstractArrowBufVector
blockFactory, closed, positionCount, valueBufferFields 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
ConstructorsConstructorDescriptionFloatArrowBufVector(org.apache.arrow.memory.ArrowBuf valueBuffer, int positionCount, BlockFactory blockFactory) Create an ArrowBuf vector based on the constituents of an ArrowValueVector. -
Method Summary
Modifier and TypeMethodDescriptionprotected ArrowBufBlockConstructor<FloatBlock> protected intbyteSize()Returns the element type of this vector.floatgetFloat(int valueIndex) org.elasticsearch.core.ReleasableIterator<FloatBlock> lookup(IntBlock positions, ByteSizeValue targetBlockSize) Builds an Iterator of newBlocks with the sameVector.elementType()as thisVectorwhose values are copied from positions in this Vector.static FloatArrowBufVectorof(org.apache.arrow.vector.FixedWidthVector arrowVector, BlockFactory blockFactory) slice(int beginInclusive, int endExclusive) Return a subset of this vector frombeginInclusivetoendExclusive.protected ArrowBufVectorConstructor<FloatVector> Methods inherited from class org.elasticsearch.compute.data.arrow.AbstractArrowBufVector
allowPassingToDifferentDriver, asBlock, blockFactory, closeInternal, filter, getPositionCount, isConstant, keepMask, ramBytesUsed, releaseBuffers, retainBuffersMethods 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
getChildResources, ramBytesUsedMethods inherited from interface org.elasticsearch.compute.data.FloatVector
asBlock, copyTo, deepCopy, equals, filter, hashCode, keepMask, writeToMethods 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
allowPassingToDifferentDriver, blockFactory, getPositionCount, isConstant, isReleased
-
Constructor Details
-
FloatArrowBufVector
public FloatArrowBufVector(org.apache.arrow.memory.ArrowBuf valueBuffer, int positionCount, BlockFactory blockFactory) Create an ArrowBuf vector based on the constituents of an ArrowValueVector. The caller must retain the buffers if they are shared with other blocks or Arrow vectors.
-
-
Method Details
-
of
public static FloatArrowBufVector of(org.apache.arrow.vector.FixedWidthVector arrowVector, BlockFactory blockFactory) -
vectorConstructor
- Specified by:
vectorConstructorin classAbstractArrowBufVector<FloatVector,FloatBlock>
-
blockConstructor
- Specified by:
blockConstructorin classAbstractArrowBufVector<FloatVector,FloatBlock>
-
getFloat
public float getFloat(int valueIndex) - Specified by:
getFloatin interfaceFloatVector
-
byteSize
protected int byteSize()- Specified by:
byteSizein classAbstractArrowBufVector<FloatVector,FloatBlock>
-
elementType
Description copied from interface:VectorReturns the element type of this vector.- Specified by:
elementTypein interfaceVector- Returns:
- the element type of this vector
-
lookup
public org.elasticsearch.core.ReleasableIterator<FloatBlock> lookup(IntBlock positions, ByteSizeValue targetBlockSize) Description copied from interface:VectorBuilds an Iterator of newBlocks with the sameVector.elementType()as thisVectorwhose values are copied from positions in this Vector. It has the same number ofpositionsas thepositionsparameter.For example, if this vector contained
[a, b, c]and were called with the block[0, 1, 1, [1, 2]]then the result would be[a, b, b, [b, c]].This process produces
count(positions)values per positions which could be quite large. Instead of returning a single Block, this returns an Iterator of Blocks containing all of the promised values.The returned
ReleasableIteratormay retain a reference to thepositionsparameter. Close it to release those references.This block is built using the same
BlockFactoryas was used to build thepositionsparameter.- Specified by:
lookupin interfaceFloatVector- Specified by:
lookupin interfaceVector
-
slice
Description copied from interface:FloatVectorReturn a subset of this vector frombeginInclusivetoendExclusive. This may return the same instance if the range covers all positions, but if it does it willRefCounted.incRef()it.- Specified by:
slicein interfaceFloatVector- Specified by:
slicein interfaceVector
-