Class BlockWriter

java.lang.Object
org.apache.lucene.codecs.uniformsplit.BlockWriter
Direct Known Subclasses:
STBlockWriter

public class BlockWriter extends Object
Writes blocks in the block file.

According the Uniform Split technique, the writing combines three steps per block, and it is repeated for all the field blocks:

  1. Select the term with the shortest minimal distinguishing prefix (MDP) in the neighborhood of the target block size (+- delta size)
  2. The selected term becomes the first term of the next block, and its MDP is the next block key.
  3. The current block is written to the block file. And its block key is added to the index dictionary.

This stateful BlockWriter is called repeatedly to add all the BlockLine terms of a field. Then finishLastBlock(org.apache.lucene.codecs.uniformsplit.IndexDictionary.Builder) is called. And then this BlockWriter can be reused to add the terms of another field.

WARNING: This API is experimental and might change in incompatible ways in the next release.