Class DefaultIndexUpdater

  • All Implemented Interfaces:
    IndexUpdater

    @Singleton
    @Named
    public class DefaultIndexUpdater
    extends java.lang.Object
    implements IndexUpdater
    A default index updater implementation
    • Method Detail

      • getLogger

        protected org.slf4j.Logger getLogger()
      • loadIndexDirectory

        private java.util.Date loadIndexDirectory​(IndexUpdateRequest updateRequest,
                                                  ResourceFetcher fetcher,
                                                  boolean merge,
                                                  java.lang.String remoteIndexFile)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • filterDirectory

        private static void filterDirectory​(org.apache.lucene.store.Directory directory,
                                            DocumentFilter filter)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • loadIndexProperties

        private java.util.Properties loadIndexProperties​(java.io.File indexDirectoryFile,
                                                         java.lang.String remoteIndexPropertiesName)
      • storeIndexProperties

        private void storeIndexProperties​(java.io.File dir,
                                          java.lang.String indexPropertiesName,
                                          java.util.Properties properties)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • downloadIndexProperties

        private java.util.Properties downloadIndexProperties​(ResourceFetcher fetcher)
                                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • getTimestamp

        public java.util.Date getTimestamp​(java.util.Properties properties,
                                           java.lang.String key)
      • unpackIndexData

        public static IndexDataReader.IndexDataReadResult unpackIndexData​(java.io.InputStream is,
                                                                          org.apache.lucene.store.Directory d,
                                                                          IndexingContext context)
                                                                   throws java.io.IOException
        Unpack index data using specified Lucene Index writer
        Parameters:
        is - an input stream to unpack index data from
        w - a writer to save index data
        ics - a collection of index creators for updating unpacked documents.
        Throws:
        java.io.IOException
      • cleanCacheDirectory

        protected void cleanCacheDirectory​(java.io.File dir)
                                    throws java.io.IOException
        Cleans specified cache directory. If present, Locker.LOCK_FILE will not be deleted.
        Throws:
        java.io.IOException