public class

LuceneDirectoryUtilsImpl

extends Object
implements LuceneDirectoryUtils
java.lang.Object
   ↳ com.atlassian.jira.util.LuceneDirectoryUtilsImpl

Summary

Public Constructors
LuceneDirectoryUtilsImpl()
Public Methods
void createDirRobust(String path)
Creates a directory (robustly) or throws appropriate Exception
Directory getDirectory(File path)
Creates an index directory for the given path on the filesystem.
Collection<String> getLocks(String path)
Collection<String> getStaleLockPaths(Collection<String> indexDirectoryPaths)
Given a Collection of paths that represent index directories checks if there are any existing Lucene lock files for the passed paths.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.util.LuceneDirectoryUtils

Public Constructors

public LuceneDirectoryUtilsImpl ()

Public Methods

public void createDirRobust (String path)

Creates a directory (robustly) or throws appropriate Exception

Parameters
path Lucene index directory path
Throws
IOException

public Directory getDirectory (File path)

Creates an index directory for the given path on the filesystem.

Parameters
path to the index directory.
Returns

public Collection<String> getLocks (String path)

Throws
IOException

public Collection<String> getStaleLockPaths (Collection<String> indexDirectoryPaths)

Given a Collection of paths that represent index directories checks if there are any existing Lucene lock files for the passed paths. This method returns a Collection of file paths of any existing Lucene lock files. If no lock files are found an empty collection is returned.

A common usage of this methdo would be:

 Collection existingLockFilepaths = LuceneUtils.getStaleLockPaths(indexManager.getAllIndexPaths());
 

Parameters
indexDirectoryPaths collection of index directory paths
Returns
  • collection of file paths of any existing Lucene lock files