public class LuceneIndexHelper extends Object
Constructor and Description |
---|
LuceneIndexHelper() |
Modifier and Type | Method and Description |
---|---|
static Optional<Long> |
getIndexVersion(Path indexDirectory) |
static void |
replaceIndexDirectory(Path destination,
Path source)
Delete existing index files in
destination then move all index files from source to destination |
static long |
sizeOfIndex(Path indexDirectory)
Calculate (approximately) current size of a Lucene index.
|
static long |
sizeOfIndexMB(Path indexDirectory)
Calculate the total size in megabytes of the index located in
the specified directory
|
public static long sizeOfIndex(Path indexDirectory) throws IOException
indexDirectory
- The index directoryIOException
- if there is any error sizing index filespublic static long sizeOfIndexMB(Path indexDirectory)
public static Optional<Long> getIndexVersion(Path indexDirectory)
indexDirectory
- directory of the indexpublic static void replaceIndexDirectory(Path destination, Path source) throws IOException
destination
then move all index files from source
to destination
destination
- Index directory whose content is to be replacedsource
- Index directory whose content is to be moved to destination
IOException
- if there is any exception moving the files aroundCopyright © 2003–2021 Atlassian. All rights reserved.