public final class LuceneUtil
extends java.lang.Object
Constructor and Description |
---|
LuceneUtil() |
Modifier and Type | Method and Description |
---|---|
static long |
generationFromSegmentsFileName(java.lang.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(java.lang.String[] files)
Get the generation (N) of the current segments_N file from a list of
files.
|
static boolean |
isSegmentsFile(java.lang.String name)
Check if the file is a segments_N file
|
static boolean |
isSegmentsGenFile(java.lang.String name)
Check if the file is the segments.gen file
|
public static boolean isSegmentsFile(java.lang.String name)
name
- public static boolean isSegmentsGenFile(java.lang.String name)
name
- public static long getCurrentSegmentGeneration(org.apache.lucene.store.Directory directory) throws java.io.IOException
directory
- -- directory to search for the latest segments_N filejava.io.IOException
public static long getCurrentSegmentGeneration(java.lang.String[] files)
files
- -- array of file names to checkpublic static long generationFromSegmentsFileName(java.lang.String fileName)
Copyright © 2009 The Apache Software Foundation