public final class LuceneUtil extends Object
Constructor and Description |
---|
LuceneUtil() |
Modifier and Type | Method and Description |
---|---|
static long |
generationFromSegmentsFileName(String fileName)
Parse the generation off the segments file name and return it.
|
static long |
getCurrentSegmentGeneration(org.apache.lucene.store.Directory directory)
Get the generation (N) of the current segments_N file in the directory.
|
static long |
getCurrentSegmentGeneration(String[] files)
Get the generation (N) of the current segments_N file from a list of
files.
|
static boolean |
isSegmentsFile(String name)
Check if the file is a segments_N file
|
static boolean |
isSegmentsGenFile(String name)
Check if the file is the segments.gen file
|
public static boolean isSegmentsFile(String name)
name
- public static boolean isSegmentsGenFile(String name)
name
- public static long getCurrentSegmentGeneration(org.apache.lucene.store.Directory directory) throws IOException
directory
- -- directory to search for the latest segments_N fileIOException
public static long getCurrentSegmentGeneration(String[] files)
files
- -- array of file names to checkpublic static long generationFromSegmentsFileName(String fileName)
Copyright © 2010 The Apache Software Foundation