java.lang.Object
org.elasticsearch.compute.data.DoubleBigArrayVector
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.lucene.util.Accountable,DoubleVector,Vector,org.elasticsearch.core.RefCounted,org.elasticsearch.core.Releasable
public final class DoubleBigArrayVector
extends Object
implements DoubleVector, org.elasticsearch.core.Releasable
Vector implementation that defers to an enclosed
DoubleArray.
Does not take ownership of the array and does not adjust circuit breakers to account for it.
This class is generated. Edit X-BigArrayVector.java.st instead.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.compute.data.DoubleVector
DoubleVector.Builder, DoubleVector.FixedBuilderNested classes/interfaces inherited from interface org.elasticsearch.compute.data.Vector
Vector.Builder -
Field Summary
Fields 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
ConstructorsConstructorDescriptionDoubleBigArrayVector(DoubleArray values, int positionCount, 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 Returns a new Block containing this vector..The block factory associated with this vector.final voidclose()voidThis is called when the number of references reaches zero.final booleandecRef()Returns the element type of this vector.booleanCompares the given object with this vector for equality.filter(int... positions) Creates a new vector that only exposes the positions provided.doublegetDouble(int position) final intThe number of positions in this vector.inthashCode()Returns the hash code of this vector, as defined byDoubleVector.hash(DoubleVector).final booleanfinal voidincRef()booleanReturns true iff this vector is a constant vector - returns the same constant value for every position.final booleankeepMask(BooleanVector mask) org.elasticsearch.core.ReleasableIterator<DoubleBlock> lookup(IntBlock positions, ByteSizeValue targetBlockSize) Builds an Iterator of newBlocks with the sameVector.elementType()as thisVectorwhose values are copied from positions in this Vector.longtoString()final booleanMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResourcesMethods inherited from interface org.elasticsearch.compute.data.DoubleVector
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, isReleased
-
Constructor Details
-
DoubleBigArrayVector
-
-
Method Details
-
asBlock
Description copied from interface:VectorReturns Returns a new Block containing this vector..- Specified by:
asBlockin interfaceDoubleVector- Specified by:
asBlockin interfaceVector- Returns:
- Returns a new Block containing this vector.
-
getDouble
public double getDouble(int position) - Specified by:
getDoublein interfaceDoubleVector
-
elementType
Description copied from interface:VectorReturns the element type of this vector.- Specified by:
elementTypein interfaceVector- Returns:
- the element type of 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
-
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.- Specified by:
filterin interfaceDoubleVector- Specified by:
filterin interfaceVector- Parameters:
positions- the positions to retain- Returns:
- a filtered vector
-
keepMask
Description copied from interface:VectorBuild aBlockthe same values as thisVector, but replacing all values for whichmask.getBooleanValue(position)returnsfalsewithnull. Themaskvector must be at least as long as this Vector.- Specified by:
keepMaskin interfaceDoubleVector- Specified by:
keepMaskin interfaceVector
-
lookup
public org.elasticsearch.core.ReleasableIterator<DoubleBlock> 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 interfaceDoubleVector- Specified by:
lookupin interfaceVector
-
closeInternal
public void closeInternal()This is called when the number of references reaches zero. This is where resources should be released (adjusting circuit breakers if needed). -
equals
Description copied from interface:DoubleVectorCompares the given object with this vector for equality. Returnstrueif and only if the given object is a DoubleVector, and both vectors areequal.- Specified by:
equalsin interfaceDoubleVector- Overrides:
equalsin classObject
-
hashCode
public int hashCode()Description copied from interface:DoubleVectorReturns the hash code of this vector, as defined byDoubleVector.hash(DoubleVector).- Specified by:
hashCodein interfaceDoubleVector- Overrides:
hashCodein classObject
-
toString
-
getPositionCount
public final int getPositionCount()Description copied from interface:VectorThe number of positions in this vector.- Specified by:
getPositionCountin interfaceVector- Returns:
- the number of positions
-
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
-
incRef
public final void incRef()- Specified by:
incRefin interfaceorg.elasticsearch.core.RefCounted
-
tryIncRef
public final boolean tryIncRef()- Specified by:
tryIncRefin interfaceorg.elasticsearch.core.RefCounted
-
decRef
public final boolean decRef()- Specified by:
decRefin interfaceorg.elasticsearch.core.RefCounted
-
hasReferences
public final boolean hasReferences()- Specified by:
hasReferencesin interfaceorg.elasticsearch.core.RefCounted
-
close
public final void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.elasticsearch.core.Releasable
-
isReleased
public final boolean isReleased()
-