org.apache.lucene.codecs.lucene60

## Class Lucene60PointsFormat

- java.lang.Object
- - org.apache.lucene.codecs.PointsFormat
  - - org.apache.lucene.codecs.lucene60.Lucene60PointsFormat

-     public final class Lucene60PointsFormat
      extends PointsFormat

  Lucene 6.0 point format, which encodes dimensional values in a block KD-tree structure for fast 1D range and N dimesional shape intersection filtering. See this paper for details.

  This data structure is written as a series of blocks on disk, with an in-memory perfectly balanced binary tree of split values referencing those blocks at the leaves.

  The `.dim` file has both blocks and the index split values, for each field. The file starts with `CodecUtil.writeIndexHeader(org.apache.lucene.store.DataOutput, java.lang.String, int, byte[], java.lang.String)`.

  The blocks are written like this:

  - count (vInt)
  - delta-docID (vInt) count (delta coded docIDs, in sorted order)
  - packedValuecount (the `byte[]` value of each dimension packed into a single `byte[]`)

  After all blocks for a field are written, then the index is written:

  - numDims (vInt)
  - maxPointsInLeafNode (vInt)
  - bytesPerDim (vInt)
  - count (vInt)
  - packed index (byte[])

  The packed index uses hierarchical delta and prefix coding to compactly encode the file pointer for all leaf blocks, once the tree is traversed, as well as the split dimension and split value for each inner node of the tree.

  After all fields blocks + index data are written, `CodecUtil.writeFooter(org.apache.lucene.store.IndexOutput)` writes the checksum.

  The `.dii` file records the file pointer in the `.dim` file where each field's index data was written. It starts with `CodecUtil.writeIndexHeader(org.apache.lucene.store.DataOutput, java.lang.String, int, byte[], java.lang.String)`, then has:

  - fieldCount (vInt)
  - (fieldNumber (vInt), fieldFilePointer (vLong))fieldCount

  After all fields blocks + index data are written, `CodecUtil.writeFooter(org.apache.lucene.store.IndexOutput)` writes the checksum.

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

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DATA_EXTENSION` Filename extension for the leaf blocks
    `static String` | `INDEX_EXTENSION` Filename extension for the index per field

    - ### Fields inherited from class org.apache.lucene.codecs.PointsFormat

      `EMPTY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Lucene60PointsFormat()` Sole constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `PointsReader` | `fieldsReader(SegmentReadState state)` Reads a segment.
    `PointsWriter` | `fieldsWriter(SegmentWriteState state)` Writes a new segment

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DATA_EXTENSION

          public static final String DATA_EXTENSION

      Filename extension for the leaf blocks
      See Also:
        Constant Field Values

    - #### INDEX_EXTENSION

          public static final String INDEX_EXTENSION

      Filename extension for the index per field
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Lucene60PointsFormat

          public Lucene60PointsFormat()

      Sole constructor

  - ### Method Detail

    - #### fieldsWriter

          public PointsWriter fieldsWriter(SegmentWriteState state)
                                    throws IOException

      Description copied from class: `PointsFormat`
      Writes a new segment
      Specified by:
        `fieldsWriter` in class `PointsFormat`
      Throws:
        `IOException`

    - #### fieldsReader

          public PointsReader fieldsReader(SegmentReadState state)
                                    throws IOException

      Description copied from class: `PointsFormat`
      Reads a segment. NOTE: by the time this call returns, it must hold open any files it will need to use; else, those files may be deleted. Additionally, required files may be deleted during the execution of this call before there is a chance to open them. Under these circumstances an IOException should be thrown by the implementation. IOExceptions are expected and will automatically cause a retry of the segment opening logic with the newly revised segments.
      Specified by:
        `fieldsReader` in class `PointsFormat`
      Throws:
        `IOException`

Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.