/** * Reads version number from segments files. The version number counts the * number of changes of the index. * * @param directory where the index resides. * @return version number. * @throws IOException if segments file cannot be read */ public static long getCurrentVersion(String directory) throws IOException { return getCurrentVersion(new File(directory)); }
/** * Reads version number from segments files. The version number is * initialized with a timestamp and then increased by one for each change of * the index. * * @param directory where the index resides. * @return version number. * @throws CorruptIndexException if the index is corrupt * @throws IOException if there is a low-level IO error */ public static long getCurrentVersion(String directory) throws CorruptIndexException, IOException { return getCurrentVersion(new File(directory)); }
/** * Reads version number from segments files. The version number is * initialized with a timestamp and then increased by one for each change of * the index. * * @param directory where the index resides. * @return version number. * @throws CorruptIndexException if the index is corrupt * @throws IOException if there is a low-level IO error */ public static long getCurrentVersion(String directory) throws CorruptIndexException, IOException { return getCurrentVersion(new File(directory)); }
/** * Reads version number from segments files. The version number counts the * number of changes of the index. * * @param directory where the index resides. * @return version number. * @throws IOException if segments file cannot be read */ public static long getCurrentVersion(File directory) throws IOException { Directory dir = FSDirectory.getDirectory(directory, false); long version = getCurrentVersion(dir); dir.close(); return version; }
/** * Reads version number from segments files. The version number is * initialized with a timestamp and then increased by one for each change of * the index. * * @param directory where the index resides. * @return version number. * @throws CorruptIndexException if the index is corrupt * @throws IOException if there is a low-level IO error */ public static long getCurrentVersion(File directory) throws CorruptIndexException, IOException { Directory dir = FSDirectory.getDirectory(directory); long version = getCurrentVersion(dir); dir.close(); return version; }
/** * Reads version number from segments files. The version number is * initialized with a timestamp and then increased by one for each change of * the index. * * @param directory where the index resides. * @return version number. * @throws CorruptIndexException if the index is corrupt * @throws IOException if there is a low-level IO error */ public static long getCurrentVersion(File directory) throws CorruptIndexException, IOException { Directory dir = FSDirectory.getDirectory(directory); long version = getCurrentVersion(dir); dir.close(); return version; }