public class IndexUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
IndexUtils.IndexPath
Represents the paths in jira home where indexes are stored
|
Modifier and Type | Field and Description |
---|---|
static com.google.common.io.PatternFilenameFilter |
INDEX_SNAPSHOT_FILTER |
Constructor and Description |
---|
IndexUtils(IssueIndexManager issueIndexManager,
LuceneDirectoryUtils luceneDirectoryUtils,
com.atlassian.event.api.EventPublisher eventPublisher) |
Modifier and Type | Method and Description |
---|---|
Map<IndexUtils.IndexPath,com.atlassian.jira.index.ha.IndexUtils.IndexPathMapping> |
buildIndexPathMappings(String sourcePath,
String destinationPath)
Builds a mapping from the source index filepath to the destination filepath - keyed by the type of index
|
void |
clearIndex(String path)
This deletes all documents in all indexes (if they exist)
|
void |
copyIndexes(String sourcePath,
String destinationPath)
Copies all indexes from a specified directory to another specified directory.
|
protected int |
deleteOldSnapshots(File directory,
int numToKeep) |
String |
takeIndexSnapshot(String sourcePath,
String destinationPath,
String snapshotId,
int maxSnapshots,
IndexSnapshotContribution contribution) |
public static final com.google.common.io.PatternFilenameFilter INDEX_SNAPSHOT_FILTER
public IndexUtils(IssueIndexManager issueIndexManager, LuceneDirectoryUtils luceneDirectoryUtils, com.atlassian.event.api.EventPublisher eventPublisher)
public String takeIndexSnapshot(@Nonnull String sourcePath, @Nonnull String destinationPath, @Nonnull String snapshotId, int maxSnapshots, @Nullable IndexSnapshotContribution contribution)
sourcePath
- the root of the source index directorydestinationPath
- the destination directorysnapshotId
- an ID for the snapshotmaxSnapshots
- maximum number of snapshots to keep in the destination directorycontribution
- an additional contribution to include in the snapshotpublic void copyIndexes(@Nonnull String sourcePath, @Nonnull String destinationPath)
sourcePath
- source of index filesdestinationPath
- destination of index filespublic Map<IndexUtils.IndexPath,com.atlassian.jira.index.ha.IndexUtils.IndexPathMapping> buildIndexPathMappings(@Nonnull String sourcePath, @Nonnull String destinationPath)
sourcePath
- the root of the source indexdestinationPath
- the root of the destination indexpublic void clearIndex(@Nonnull String path)
path
- the root of the index to clearprotected int deleteOldSnapshots(File directory, int numToKeep)
Copyright © 2002-2017 Atlassian. All Rights Reserved.