Class DocumentIndexBuilder


  • public class DocumentIndexBuilder
    extends java.lang.Object
    A builder for the document index.
    Author:
    Vassilis Plachouras
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.io.DataOutputStream dos
      The stream to which we write the data.
      protected boolean fields
      does this index have fields
      protected FSArrayFile.ArrayFileWriter fileWriter
      utility for writing to disk
      protected IndexOnDisk index
      index object of the index currently being created
      protected static org.slf4j.Logger logger
      The logger used
      protected int numberOfDocumentIndexEntries
      The total number of entries in the document index.
      protected java.lang.String structureName
      Name of the structure to which we're writing
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addEntryToBuffer​(org.apache.hadoop.io.Writable die)
      Adds to the index a new entry, giving to it the next available document id.
      void close()
      Closes the random access file.
      void finishedCollections()
      Closes the underlying file after finished processing the collections.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        protected static final org.slf4j.Logger logger
        The logger used
      • structureName

        protected java.lang.String structureName
        Name of the structure to which we're writing
      • dos

        protected java.io.DataOutputStream dos
        The stream to which we write the data.
      • numberOfDocumentIndexEntries

        protected int numberOfDocumentIndexEntries
        The total number of entries in the document index.
      • index

        protected IndexOnDisk index
        index object of the index currently being created
      • fields

        protected boolean fields
        does this index have fields
    • Constructor Detail

      • DocumentIndexBuilder

        public DocumentIndexBuilder​(IndexOnDisk i,
                                    java.lang.String _structureName,
                                    boolean fields)
        Construct a DocumentIndex associated with the specified index
        Parameters:
        i - Index being constructed
        _structureName - the name of the structure being created
        fields - does this index have fields
      • DocumentIndexBuilder

        @Deprecated
        public DocumentIndexBuilder​(IndexOnDisk i,
                                    java.lang.String _structureName)
        Deprecated.
    • Method Detail

      • addEntryToBuffer

        public void addEntryToBuffer​(org.apache.hadoop.io.Writable die)
                              throws java.io.IOException
        Adds to the index a new entry, giving to it the next available document id.
        Parameters:
        die - The document index entry being written
        Throws:
        java.io.IOException - Throws an exception in the case of an IO error.
      • close

        public void close()
        Closes the random access file.
      • finishedCollections

        public void finishedCollections()
        Closes the underlying file after finished processing the collections.