Interface IndexRecoveryService

All Known Implementing Classes:
DefaultIndexRecoveryService, NoopIndexRecoveryService

public interface IndexRecoveryService
This service will support the recovery of a Lucene index.
Since:
5.8
  • Method Details

    • isIndexRecoveryRequired

      boolean isIndexRecoveryRequired(JournalIdentifier journalId, String indexDirName)
      Checks to see whether the index needs to be recovered.

      This will be true if the index folder does not exist, or, if the index is copied over from a live system and is invalid, or, if the journal has been purged past where the node is currently processing, Note, this will always return false if the instance is not clustered.

      Parameters:
      journalId - the index to check whether it needs to be recovered
      indexDirName - the name of the subdirectory containing the Lucene index
    • recoverIndex

      boolean recoverIndex(JournalIdentifier journalId, String indexDirName)
      Recovers the index required by asking other nodes in the cluster for a snapshot of their index and copying it to its local home directory.

      This will overwrite the local index files if it already exists.

      Parameters:
      journalId - the index to recover
      indexDirName - the name of the subdirectory containing the Lucene index
      Returns:
      true if index recovery was successful, false otherwise.
    • recoverIndexFromSharedHome

      boolean recoverIndexFromSharedHome(JournalIdentifier journalId, String indexDirName)
      Recovers the index snapshot stored in the shared home.

      This will overwrite the local index files if it already exists.

      Parameters:
      journalId - the index to recover
      indexDirName - the name of the subdirectory where the Lucene index will be moved to
      Returns:
      true if index recovery was successful, false otherwise.
      Since:
      5.9.1
    • createIndexBackup

      boolean createIndexBackup(JournalIdentifier journalId, String indexDirName, IndexRecoverer indexRecoverer)
      Creates an index snapshot in the cluster shared home.

      This will overwrite existing snapshots of the same index in the shared home.

      Parameters:
      journalId - the index to backup
      indexDirName - the name of the subdirectory containing the Lucene index
      indexRecoverer - the index recover module that will take the lucene index snapshot
      Returns:
      true if successful
      Since:
      5.9.1