com.atlassian.jira.index.ha
Class IndexUtils

java.lang.Object
  extended by com.atlassian.jira.index.ha.IndexUtils

public class IndexUtils
extends Object

Helper methods to work with LuceneIndexes.

Since:
v6.1

Nested Class Summary
static class IndexUtils.IndexPath
          Represents the paths in jira home where indexes are stored
 
Constructor Summary
IndexUtils(IssueIndexManager issueIndexManager, JiraHome jiraHome, LuceneDirectoryUtils luceneDirectoryUtils)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexUtils

public IndexUtils(IssueIndexManager issueIndexManager,
                  JiraHome jiraHome,
                  LuceneDirectoryUtils luceneDirectoryUtils)
Method Detail

copyIndexes

public void copyIndexes(@Nonnull
                        String sourcePath,
                        @Nonnull
                        String destinationPath)
Copies all indexes from a specified directory to another specified directory. Any indexes on the destination directory will be deleted.

Parameters:
sourcePath - source of index files
destinationPath - destination of index files

buildIndexPathMappings

public Map<IndexUtils.IndexPath,com.atlassian.jira.index.ha.IndexUtils.IndexPathMapping> buildIndexPathMappings(@Nonnull
                                                                                                                String sourcePath,
                                                                                                                @Nonnull
                                                                                                                String destinationPath)
Builds a mapping from the source index filepath to the destination filepath - keyed by the type of index

Parameters:
sourcePath - the root of the source index
destinationPath - the root of the destination index
Returns:

clearIndex

public void clearIndex(@Nonnull
                       String path)
This deletes all documents in all indexes (if they exist)

Parameters:
path - the root of the index to clear


Copyright © 2002-2014 Atlassian. All Rights Reserved.