- All Superinterfaces:
org.apache.lucene.util.Accountable,AutoCloseable,Block,BlockLoader.Block,Closeable,NamedWriteable,org.elasticsearch.core.RefCounted,org.elasticsearch.core.Releasable,Writeable
- All Known Implementing Classes:
BooleanBigArrayBlock,BooleanVectorBlock
X-Block.java.st instead.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.elasticsearch.compute.data.Block
Block.MvOrderingNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLEFields inherited from interface org.elasticsearch.compute.data.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 -
Method Summary
Modifier and TypeMethodDescriptionasVector()Returns an efficient dense single-value view of this block.booleanCompares the given object with this block for equality.static booleanequals(BooleanBlock block1, BooleanBlock block2) Returnstrueif the given blocks are equal to each other, otherwisefalse.expand()Expand multivalued fields into one row per value.filter(int... positions) Creates a new block that only exposes the positions provided.booleangetBoolean(int valueIndex) Retrieves the boolean value stored at the given value index.default Stringstatic inthash(BooleanBlock block) Generates the hash code for the given block.inthashCode()Returns the hash code of this block, as defined byhash(BooleanBlock).keepMask(BooleanVector mask) org.elasticsearch.core.ReleasableIterator<? extends BooleanBlock> 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.static BooleanBlocktoMask()Convert this to a"mask"that's appropriate for passing tokeepMask(org.elasticsearch.compute.data.BooleanVector).default voidwriteTo(StreamOutput out) Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources, ramBytesUsedMethods inherited from interface org.elasticsearch.compute.data.Block
allowPassingToDifferentDriver, areAllValuesNull, blockFactory, doesHaveMultivaluedFields, elementType, getFirstValueIndex, getPositionCount, getTotalValueCount, getValueCount, insertNulls, isNull, isReleased, mayHaveMultivaluedFields, mayHaveNulls, mvDeduplicated, mvOrdering, mvSortedAscendingMethods inherited from interface org.elasticsearch.core.RefCounted
decRef, hasReferences, incRef, mustIncRef, tryIncRefMethods inherited from interface org.elasticsearch.core.Releasable
close
-
Field Details
-
ENTRY
-
-
Method Details
-
getBoolean
boolean getBoolean(int valueIndex) Retrieves the boolean value stored at the given value index.Values for a given position are between getFirstValueIndex(position) (inclusive) and getFirstValueIndex(position) + getValueCount(position) (exclusive).
- Parameters:
valueIndex- the value index- Returns:
- the data value (as a boolean)
-
asVector
BooleanVector 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. -
toMask
ToMask toMask()Convert this to a"mask"that's appropriate for passing tokeepMask(org.elasticsearch.compute.data.BooleanVector). Null and multivalued positions will be converted tofalse. -
filter
Description copied from interface:BlockCreates a new block that only exposes the positions provided. -
keepMask
Description copied from interface:Block -
lookup
org.elasticsearch.core.ReleasableIterator<? extends BooleanBlock> 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. -
expand
BooleanBlock 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. -
getWriteableName
- Specified by:
getWriteableNamein interfaceNamedWriteable
-
readFrom
- Throws:
IOException
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
equals
Compares the given object with this block for equality. Returnstrueif and only if the given object is a BooleanBlock, and both blocks areequal. -
hashCode
int hashCode()Returns the hash code of this block, as defined byhash(BooleanBlock). -
equals
Returnstrueif the given blocks are equal to each other, otherwisefalse. Two blocks are considered equal if they have the same position count, and contain the same values (including absent null values) in the same order. This definition ensures that the equals method works properly across different implementations of the BooleanBlock interface. -
hash
Generates the hash code for the given block. The hash code is computed from the block's values. This ensures thatblock1.equals(block2)implies thatblock1.hashCode()==block2.hashCode()for any two blocks,block1andblock2, as required by the general contract ofObject.hashCode().
-