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
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
BlockZipper.Context
-
Field Summary
Fields Modifier and Type Field Description int
inputChunkIndexMask
int
posInChunkLogShift
-
Constructor Summary
Constructors Constructor Description BlockZipper(int inputChunksLogSize)
-
Method Summary
Modifier and Type Method Description 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.BlockZipper.Context
getContext(int chunkSize, int logBlockCount)
Constructs a context reflecting the size for the current session
-
Field Details
-
posInChunkLogShift
public final int posInChunkLogShift -
inputChunkIndexMask
public final int inputChunkIndexMask
-
-
Constructor Details
-
BlockZipper
public BlockZipper(int inputChunksLogSize)
-
-
Method Details
-
eval
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 contextblockNumber
- The number of the target block for which we are collecting valueshashChunks
- List of hash value chunks.- Returns:
- A chunk with the element's position encoded as (element position in chunk,chunk number)
-
getContext
Constructs a context reflecting the size for the current session- Parameters:
chunkSize
- - The size of the hash input chunkslogBlockCount
- - Log base 2 of the number of blocks in the target hash table
-