Interface LongRangeBlock

All Superinterfaces:
org.apache.lucene.util.Accountable, AutoCloseable, Block, BlockLoader.Block, Closeable, org.elasticsearch.core.RefCounted, org.elasticsearch.core.Releasable, Writeable
All Known Implementing Classes:
ConstantNullBlock, LongRangeArrayBlock

public sealed interface LongRangeBlock extends Block permits LongRangeArrayBlock, ConstantNullBlock
Block that stores long ranges.
  • Method Details

    • filter

      LongRangeBlock filter(boolean mayContainDuplicates, int... positions)
      Description copied from interface: Block
      Creates a new block that only exposes the positions provided.
      Specified by:
      filter in interface Block
      Parameters:
      mayContainDuplicates - may the positions array contain duplicate positions?
      positions - the positions to retain
      Returns:
      a filtered block
    • keepMask

      LongRangeBlock keepMask(BooleanVector mask)
      Description copied from interface: Block
      Build a Block with the same values as this Block, but replacing all values for which mask.getBooleanValue(position) returns false with null. The mask vector must be at least as long as this Block.
      Specified by:
      keepMask in interface Block
    • lookup

      org.elasticsearch.core.ReleasableIterator<? extends LongRangeBlock> lookup(IntBlock positions, ByteSizeValue targetBlockSize)
      Description copied from interface: Block
      Builds an Iterator of new Blocks with the same Block.elementType() as this Block whose values are copied from positions in this Block. It has the same number of positions as the positions parameter.

      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 ReleasableIterator may retain a reference to the positions parameter. Close it to release those references.

      This block is built using the same BlockFactory as was used to build the positions parameter.

      Specified by:
      lookup in interface Block
    • expand

      LongRangeBlock expand()
      Description copied from interface: Block
      Expand 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.
      Specified by:
      expand in interface Block
    • equals

      static boolean equals(LongRangeBlock lhs, LongRangeBlock rhs)
      Returns true if the given blocks are equal to each other, otherwise false. 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 LongRangeBlock interface.
    • hash

      static int hash(LongRangeBlock block)
    • getFromBlock

      LongBlock getFromBlock()
    • getToBlock

      LongBlock getToBlock()