- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.lucene.util.Accountable,Writeable,Block,LongBlock,org.elasticsearch.core.RefCounted,org.elasticsearch.core.Releasable,BlockLoader.Block
LongBigArrayVector. Does not take ownership of the given
LongArray and does not adjust circuit breakers to account for it.
This class is generated. Edit X-BigArrayBlock.java.st instead.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.compute.data.Block
Block.Builder, Block.MvOrderingNested classes/interfaces inherited from interface org.elasticsearch.compute.data.LongBlock
LongBlock.BuilderNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final int[]protected final BitSetprotected final intFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLEFields inherited from interface org.elasticsearch.compute.data.Block
ESQL_AGGREGATE_METRIC_DOUBLE_BLOCK, MAX_LOOKUP, PAGE_MEM_OVERHEAD_PER_BLOCK, SERIALIZE_BLOCK_ARRAY, SERIALIZE_BLOCK_BIG_ARRAY, SERIALIZE_BLOCK_ORDINAL, SERIALIZE_BLOCK_VALUES, SERIALIZE_BLOCK_VECTORFields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCED -
Constructor Summary
ConstructorsConstructorDescriptionLongBigArrayBlock(LongArray values, int positionCount, int[] firstValueIndexes, BitSet nulls, Block.MvOrdering mvOrdering, BlockFactory blockFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidBefore passing a Block to another Driver, it is necessary to switch the owning block factory to its parent, which is associated with the global circuit breaker.final booleanasVector()Returns an efficient dense single-value view of this block.The block factory associated with this block.voidThis is called when the number of references reaches zero.booleanDoes this block have multivalued fields? UnlikeBlock.mayHaveMultivaluedFields()this will never return a false positive.Returns the element type of this block.booleanCompares the given object with this block for equality.expand()Expand multivalued fields into one row per value.filter(boolean mayContainDuplicates, int... positions) Creates a new block that only exposes the positions provided.final intgetFirstValueIndex(int position) Gets the index of the first value for the given position.longgetLong(int valueIndex) Retrieves the long value stored at the given value index.final intReturns the number of positions (rows) in this block.final intReturns the total number of values in this block not counting nulls.final intgetValueCount(int position) Gets the number of values for the given position, possibly 0.inthashCode()Returns the hash code of this block, as defined byLongBlock.hash(LongBlock).final booleanisNull(int position) keepMask(BooleanVector mask) org.elasticsearch.core.ReleasableIterator<LongBlock> lookup(IntBlock positions, ByteSizeValue targetBlockSize) Builds an Iterator of newBlocks with the sameBlock.elementType()as this Block whose values are copied from positions in this Block.final booleanCan this block have multivalued fields? Blocks that returnfalsewill never return more than one fromBlock.getValueCount(int).final booleanfinal Block.MvOrderingHow are multivalued fields ordered?longprotected final BitSettoString()Methods inherited from class org.elasticsearch.compute.data.AbstractNonThreadSafeRefCounted
close, decRef, hasReferences, incRef, isReleased, tryIncRefMethods 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.Block
areAllValuesNull, doesHaveMultivaluedFields, getFirstValueIndex, getPositionCount, getTotalValueCount, getValueCount, insertNulls, isNull, isReleased, mayHaveMultivaluedFields, mayHaveNulls, mvDeduplicated, mvOrdering, mvSortedAscendingMethods inherited from interface org.elasticsearch.compute.data.LongBlock
deepCopy, hasValue, slice, writeToMethods inherited from interface org.elasticsearch.core.RefCounted
decRef, hasReferences, incRef, mustIncRef, tryIncRefMethods inherited from interface org.elasticsearch.core.Releasable
close
-
Field Details
-
positionCount
protected final int positionCount -
firstValueIndexes
@Nullable protected final int[] firstValueIndexes -
nullsMask
-
-
Constructor Details
-
LongBigArrayBlock
public LongBigArrayBlock(LongArray values, int positionCount, int[] firstValueIndexes, BitSet nulls, Block.MvOrdering mvOrdering, BlockFactory blockFactory)
-
-
Method Details
-
asVector
Description copied from interface:BlockReturns an efficient dense single-value view of this block. Null, if the block is not dense single-valued. That is, if mayHaveNulls returns true, or getTotalValueCount is not equal to getPositionCount. -
getLong
public long getLong(int valueIndex) Description copied from interface:LongBlockRetrieves the long value stored at the given value index.Values for a given position are between getFirstValueIndex(position) (inclusive) and getFirstValueIndex(position) + getValueCount(position) (exclusive).
-
filter
Description copied from interface:BlockCreates a new block that only exposes the positions provided. -
keepMask
Description copied from interface:Block -
lookup
public org.elasticsearch.core.ReleasableIterator<LongBlock> lookup(IntBlock positions, ByteSizeValue targetBlockSize) Description copied from interface:BlockBuilds an Iterator of newBlocks with the sameBlock.elementType()as this Block whose values are copied from positions in this Block. It has the same number ofpositionsas thepositionsparameter.For example, if this block contained
[a, b, [b, c]]and were called with the block[0, 1, 1, [1, 2]]then the result would be[a, b, b, [b, b, c]].This process produces
count(this) * 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. -
elementType
Description copied from interface:BlockReturns the element type of this block.- Specified by:
elementTypein interfaceBlock- Returns:
- the element type of this block
-
expand
Description copied from interface:BlockExpand multivalued fields into one row per value. Returns the same block if there aren't any multivalued fields to expand. The returned block needs to be closed by the caller to release the block's resources. -
ramBytesUsed
public long ramBytesUsed()- Specified by:
ramBytesUsedin interfaceorg.apache.lucene.util.Accountable
-
equals
Description copied from interface:LongBlockCompares the given object with this block for equality. Returnstrueif and only if the given object is a LongBlock, and both blocks areequal. -
hashCode
public int hashCode()Description copied from interface:LongBlockReturns the hash code of this block, as defined byLongBlock.hash(LongBlock). -
toString
-
allowPassingToDifferentDriver
public void allowPassingToDifferentDriver()Description copied from interface:BlockBefore passing a Block 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 Block, 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 interfaceBlock
-
blockFactory
Description copied from interface:BlockThe block factory associated with this block.- Specified by:
blockFactoryin interfaceBlock
-
closeInternal
public 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
-
mayHaveMultivaluedFields
public final boolean mayHaveMultivaluedFields()Description copied from interface:BlockCan this block have multivalued fields? Blocks that returnfalsewill never return more than one fromBlock.getValueCount(int). This may returntruefor Blocks that do not have multivalued fields, but it will always answer quickly.- Specified by:
mayHaveMultivaluedFieldsin interfaceBlock
-
doesHaveMultivaluedFields
public boolean doesHaveMultivaluedFields()Description copied from interface:BlockDoes this block have multivalued fields? UnlikeBlock.mayHaveMultivaluedFields()this will never return a false positive. In other words, if this returnstruethen there are positions for whichBlock.getValueCount(int)will return more than 1. This will answer quickly if it can but may have to check all positions.- Specified by:
doesHaveMultivaluedFieldsin interfaceBlock
-
mvOrdering
Description copied from interface:BlockHow are multivalued fields ordered?- Specified by:
mvOrderingin interfaceBlock
-
shiftNullsToExpandedPositions
-
getTotalValueCount
public final int getTotalValueCount()Description copied from interface:BlockReturns the total number of values in this block not counting nulls. This powers theCOUNTaggregation and is used to report the number of fields loaded by ESQL.- Specified by:
getTotalValueCountin interfaceBlock- Returns:
- the total number of values in this block not counting nulls
-
getPositionCount
public final int getPositionCount()Description copied from interface:BlockReturns the number of positions (rows) in this block. See class javadoc for the usual way to iterate these positions.- Specified by:
getPositionCountin interfaceBlock- Returns:
- the number of positions (rows) in this block
-
getFirstValueIndex
public final int getFirstValueIndex(int position) Gets the index of the first value for the given position.- Specified by:
getFirstValueIndexin interfaceBlock- Returns:
- the index of the first value for the given position
-
getValueCount
public final int getValueCount(int position) Gets the number of values for the given position, possibly 0.- Specified by:
getValueCountin interfaceBlock- Returns:
- the number of values for the given position
-
isNull
public final boolean isNull(int position) -
mayHaveNulls
public final boolean mayHaveNulls()- Specified by:
mayHaveNullsin interfaceBlock- Returns:
- true if some values might be null. False, if all values are guaranteed to be not null.
-
areAllValuesNull
public final boolean areAllValuesNull()- Specified by:
areAllValuesNullin interfaceBlock- Returns:
- true if all values in this block are guaranteed to be null.
-