Class BlockZipper

java.lang.Object
com.illumon.iris.db.v2.sources.chunk.kernels.BlockZipper

public class BlockZipper
extends Object
Collects the location for entries matching a given block
  • Field Details

  • Constructor Details

    • BlockZipper

      public BlockZipper​(int inputChunksLogSize)
  • Method Details

    • eval

      public IntChunk eval​(BlockZipper.Context context, int blockNumber, IntChunk... hashChunks)
      Collects the elements from a set of input chunks that match to a given expected block Elements are collected in the order they appear on each chunk (i.e. all elements apearing at position k in each chunk, followed by all elements at position k+1 etc. Elements are first collected from a range of positions corresponding to the block, and then, for each chunk we search past the end of the range until we find an empty entry, this guarantees we are not missing any elements that we placed outside the range due to colisions. In the event all the elements don't fit in the destination chunk, the function can be called with context lastRegistered pos pointing to the last element examined.
      Parameters:
      context - The context
      blockNumber - The number of the target block for which we are collecting values
      hashChunks - List of hash value chunks.
      Returns:
      A chunk with the element's position encoded as (element position in chunk,chunk number)
    • getContext

      public BlockZipper.Context getContext​(int chunkSize, int logBlockCount)
      Constructs a context reflecting the size for the current session
      Parameters:
      chunkSize - - The size of the hash input chunks
      logBlockCount - - Log base 2 of the number of blocks in the target hash table