Class FieldsIndexWriter

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public final class FieldsIndexWriter
    extends java.lang.Object
    implements java.io.Closeable
    Efficient index format for block-based Codecs.

    For each block of compressed stored fields, this stores the first document of the block and the start pointer of the block in a DirectMonotonicWriter. At read time, the docID is binary-searched in the DirectMonotonicReader that records doc IDS, and the returned index is used to look up the start pointer in the DirectMonotonicReader that records start pointers.

    • Field Detail

      • FIELDS_INDEX_EXTENSION_SUFFIX

        public static final java.lang.String FIELDS_INDEX_EXTENSION_SUFFIX
        Extension of stored fields index file.
        See Also:
        Constant Field Values
      • FIELDS_META_EXTENSION_SUFFIX

        public static final java.lang.String FIELDS_META_EXTENSION_SUFFIX
        Extension of stored fields meta file.
        See Also:
        Constant Field Values
      • name

        private final java.lang.String name
      • suffix

        private final java.lang.String suffix
      • extension

        private final java.lang.String extension
      • codecName

        private final java.lang.String codecName
      • id

        private final byte[] id
      • blockShift

        private final int blockShift
      • ioContext

        private final IOContext ioContext
      • totalDocs

        private int totalDocs
      • totalChunks

        private int totalChunks
      • previousFP

        private long previousFP
    • Constructor Detail

      • FieldsIndexWriter

        FieldsIndexWriter​(Directory dir,
                          java.lang.String name,
                          java.lang.String suffix,
                          java.lang.String extension,
                          java.lang.String codecName,
                          byte[] id,
                          int blockShift,
                          IOContext ioContext)
                   throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • writeIndex

        void writeIndex​(int numDocs,
                        long startPointer)
                 throws java.io.IOException
        Throws:
        java.io.IOException
      • finish

        void finish​(int numDocs,
                    long maxPointer)
             throws java.io.IOException
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException