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,
com.atlassian.dc.filestore.api.compat.FilesystemPath sharedHome,
JournalStateStore journalStateStore) |
DefaultLuceneIndexSnapshotManager(com.atlassian.plugin.PluginAccessor pluginAccessor,
BootstrapManager bootstrapManager,
com.atlassian.dc.filestore.api.compat.FilesystemPath sharedHome,
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,
com.atlassian.dc.filestore.api.compat.FilesystemPath sharedHome,
JournalStateStore journalStateStore)
public DefaultLuceneIndexSnapshotManager(com.atlassian.plugin.PluginAccessor pluginAccessor,
BootstrapManager bootstrapManager,
com.atlassian.dc.filestore.api.compat.FilesystemPath sharedHome,
JournalStateStore journalStateStore,
Function<Path,Optional<Long>> indexVersionReader)
public LuceneIndexSnapshot create(JournalIdentifier journalIdentifier)
LuceneIndexSnapshotManagercreate in interface LuceneIndexSnapshotManagerjournalIdentifier - Identifier of a journal of which a snapshot will be createdLuceneIndexSnapshotManager.getFile(LuceneIndexSnapshot)public void restore(LuceneIndexSnapshot snapshot)
LuceneIndexSnapshotManagerrestore in interface LuceneIndexSnapshotManagersnapshot - snapshot to restorepublic List<LuceneIndexSnapshot> findForJournal(JournalIdentifier journalIdentifier)
findForJournal in interface LuceneIndexSnapshotManagerpublic Optional<LuceneIndexSnapshot> find(JournalIdentifier journalIdentifier, long journalEntryId)
LuceneIndexSnapshotManagerLuceneIndexSnapshotManager.find(JournalIdentifier, long, long)find in interface LuceneIndexSnapshotManagerjournalIdentifier - 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
LuceneIndexSnapshotManagerfind in interface LuceneIndexSnapshotManagerjournalIdentifier - 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 emptyInterruptedExceptionpublic void delete(LuceneIndexSnapshot snapshot) throws IOException
LuceneIndexSnapshotManagerdelete in interface LuceneIndexSnapshotManagersnapshot - The snapshot to be deletedIOException - If there is error deleting the snapshot filepublic Optional<Path> getFile(LuceneIndexSnapshot snapshot)
LuceneIndexSnapshotManagergetFile in interface LuceneIndexSnapshotManagersnapshot - Index snapshot to be accessedCopyright © 2003–2021 Atlassian. All rights reserved.