Class IndexAccessorImpl

    • Method Detail

      • createIndexIfMissing

        public void createIndexIfMissing()
        Description copied from interface: IndexAccessor
        Checks whether the index exists (on disk, ...), and creates it if necessary.
        Specified by:
        createIndexIfMissing in interface IndexAccessor
      • validateIndexExists

        public void validateIndexExists()
        Description copied from interface: IndexAccessor
        Checks whether the index exists (on disk, ...), and throws an exception if it doesn't.
        Specified by:
        validateIndexExists in interface IndexAccessor
      • dropIndexIfExisting

        public void dropIndexIfExisting()
        Description copied from interface: IndexAccessor
        Checks whether the index exists (on disk, ...), and drops it if it exists.
        Specified by:
        dropIndexIfExisting in interface IndexAccessor
      • commit

        public void commit()
        Description copied from interface: IndexAccessor
        Commits the underlying index writer, if any.
        Specified by:
        commit in interface IndexAccessor
      • commitOrDelay

        public void commitOrDelay()
        Description copied from interface: IndexAccessor
        Commits the underlying index writer, if any, or delay the commit if a commit happened recently and configuration requires to wait longer between two commits.
        Specified by:
        commitOrDelay in interface IndexAccessor
      • refresh

        public void refresh()
        Description copied from interface: IndexAccessor
        Refreshes the underlying index readers.
        Specified by:
        refresh in interface IndexAccessor
      • cleanUpAfterFailure

        public void cleanUpAfterFailure​(Throwable throwable,
                                        Object failingOperation)
        Description copied from interface: IndexAccessor
        Closes, drops and re-creates any cached resources: index writers, index readers.

        Should be used to clean up the accessor upon write or commit failure, passing an exception with as much information as possible (operation, document ID, ...).

        Specified by:
        cleanUpAfterFailure in interface IndexAccessor
        Parameters:
        throwable - The failure.
        failingOperation - The operation that failed.
      • computeSizeInBytes

        public long computeSizeInBytes()
        Specified by:
        computeSizeInBytes in interface IndexAccessor
        Returns:
        The size of the index on its storage support, in bytes.
      • getDirectoryForTests

        public org.apache.lucene.store.Directory getDirectoryForTests()
      • getWriterForTests

        public org.apache.lucene.index.IndexWriter getWriterForTests()
                                                              throws IOException
        Throws:
        IOException