public class DefaultLuceneIndexSnapshotManager extends Object implements LuceneIndexSnapshotManager
shared-home/index-snapshots
.
There is a limit of how many snapshots are retained at any time for an index. The default is 3.
Exceeded snapshots are regularly purged by LuceneIndexSnapshotCleaner
.Constructor and Description |
---|
DefaultLuceneIndexSnapshotManager(com.atlassian.plugin.PluginAccessor pluginAccessor,
BootstrapManager bootstrapManager,
JournalStateStore journalStateStore) |
DefaultLuceneIndexSnapshotManager(com.atlassian.plugin.PluginAccessor pluginAccessor,
BootstrapManager bootstrapManager,
JournalStateStore journalStateStore,
Function<Path,Optional<Long>> indexVersionReader) |
Modifier and Type | Method and Description |
---|---|
LuceneIndexSnapshot |
create(JournalIdentifier journalIdentifier)
Create a new Lucene index snapshot for given journal (index)
|
void |
delete(LuceneIndexSnapshot snapshot)
Delete an index snapshot from file system.
|
Optional<LuceneIndexSnapshot> |
find(JournalIdentifier journalIdentifier,
long journalEntryId)
Find a specific index snapshot corresponding to a journal entry ID.
|
Optional<LuceneIndexSnapshot> |
find(JournalIdentifier journalIdentifier,
long journalEntryId,
long timeoutMs)
Find a specific index snapshot corresponding to a journal entry ID.
|
List<LuceneIndexSnapshot> |
findForJournal(JournalIdentifier journalIdentifier) |
Optional<Path> |
getFile(LuceneIndexSnapshot snapshot)
Obtain location of an index snapshot.
|
void |
restore(LuceneIndexSnapshot snapshot)
Restore a Lucene snapshot for given journal (index) to the current node
|
public DefaultLuceneIndexSnapshotManager(com.atlassian.plugin.PluginAccessor pluginAccessor, BootstrapManager bootstrapManager, JournalStateStore journalStateStore)
public DefaultLuceneIndexSnapshotManager(com.atlassian.plugin.PluginAccessor pluginAccessor, BootstrapManager bootstrapManager, JournalStateStore journalStateStore, Function<Path,Optional<Long>> indexVersionReader)
public LuceneIndexSnapshot create(JournalIdentifier journalIdentifier)
LuceneIndexSnapshotManager
create
in interface LuceneIndexSnapshotManager
journalIdentifier
- Identifier of a journal of which a snapshot will be createdLuceneIndexSnapshotManager.getFile(LuceneIndexSnapshot)
public void restore(LuceneIndexSnapshot snapshot)
LuceneIndexSnapshotManager
restore
in interface LuceneIndexSnapshotManager
snapshot
- snapshot to restorepublic List<LuceneIndexSnapshot> findForJournal(JournalIdentifier journalIdentifier)
findForJournal
in interface LuceneIndexSnapshotManager
public Optional<LuceneIndexSnapshot> find(JournalIdentifier journalIdentifier, long journalEntryId)
LuceneIndexSnapshotManager
LuceneIndexSnapshotManager.find(JournalIdentifier, long, long)
find
in interface LuceneIndexSnapshotManager
journalIdentifier
- Identifier of a journal of which a snapshot will be createdjournalEntryId
- place in journal when snapshot was createdpublic Optional<LuceneIndexSnapshot> find(JournalIdentifier journalIdentifier, long journalEntryId, long timeoutMs) throws InterruptedException
LuceneIndexSnapshotManager
find
in interface LuceneIndexSnapshotManager
journalIdentifier
- Identifier of a journal of which a snapshot will be createdjournalEntryId
- place in journal when snapshot was createdtimeoutMs
- max time to wait until the snapshot file is availablewaitTimeMs
or emptyInterruptedException
public void delete(LuceneIndexSnapshot snapshot) throws IOException
LuceneIndexSnapshotManager
delete
in interface LuceneIndexSnapshotManager
snapshot
- The snapshot to be deletedIOException
- If there is error deleting the snapshot filepublic Optional<Path> getFile(LuceneIndexSnapshot snapshot)
LuceneIndexSnapshotManager
getFile
in interface LuceneIndexSnapshotManager
snapshot
- Index snapshot to be accessedCopyright © 2003–2020 Atlassian. All rights reserved.