Interface LuceneIndexSnapshotManager

    • Method Detail

      • restore

        void restore​(LuceneIndexSnapshot luceneIndexSnapshot)
        Restore a Lucene snapshot for given journal (index) to the current node
        Parameters:
        luceneIndexSnapshot - snapshot to restore
        Throws:
        LuceneIndexSnapshotException - if there is not enough space or any error restoring from the snapshot
      • find

        Optional<LuceneIndexSnapshot> find​(JournalIdentifier journalIdentifier,
                                           long journalEntryId)
        Find a specific index snapshot corresponding to a journal entry ID. This method returns immediately. Note: In certain network filesystem it may take a while after a snapshot file is created by a node until it is visible to other nodes. If you want to find a newly created snapshot and wait until it becomes visible, use find(JournalIdentifier, long, long)
        Parameters:
        journalIdentifier - Identifier of a journal of which a snapshot will be created
        journalEntryId - place in journal when snapshot was created
      • find

        Optional<LuceneIndexSnapshot> find​(JournalIdentifier journalIdentifier,
                                           long journalEntryId,
                                           long waitTimeMs)
                                    throws InterruptedException
        Find a specific index snapshot corresponding to a journal entry ID. If it cannot be found immediately then this method will wait until it becomes visible or certain time has passed.
        Parameters:
        journalIdentifier - Identifier of a journal of which a snapshot will be created
        journalEntryId - place in journal when snapshot was created
        waitTimeMs - max time to wait until the snapshot file is available
        Returns:
        Location of the zipped snapshot in file system if found within waitTimeMs or empty
        Throws:
        InterruptedException
      • delete

        void delete​(LuceneIndexSnapshot snapshot)
             throws IOException
        Delete an index snapshot from file system. Do nothing if the snapshot doesn't exist
        Parameters:
        snapshot - The snapshot to be deleted
        Throws:
        IOException - If there is error deleting the snapshot file
      • getFile

        Optional<Path> getFile​(LuceneIndexSnapshot snapshot)
        Obtain location of an index snapshot.
        Parameters:
        snapshot - Index snapshot to be accessed
        Returns:
        Location of the zipped snapshot in file system