com.atlassian.jira.index.ha
Class ClusteredIndexUtils

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

public class ClusteredIndexUtils
extends Object

Helper methods to work with LuceneIndexes on a clustered environment

Since:
v6.1

Nested Class Summary
static class ClusteredIndexUtils.IndexPath
          Represents the paths in jira home where indexes are stored
 
Constructor Summary
ClusteredIndexUtils(IssueIndexManager issueIndexManager, JiraHome jiraHome, LuceneDirectoryUtils luceneDirectoryUtils)
           
 
Method Summary
 Map<ClusteredIndexUtils.IndexPath,com.atlassian.jira.index.ha.ClusteredIndexUtils.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

ClusteredIndexUtils

public ClusteredIndexUtils(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<ClusteredIndexUtils.IndexPath,com.atlassian.jira.index.ha.ClusteredIndexUtils.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-2013 Atlassian. All Rights Reserved.