From af42440fc0c3d0de09280866b2c7ccc22df067b8 Mon Sep 17 00:00:00 2001 From: Daniel Naber Date: Tue, 7 Jun 2005 20:21:26 +0000 Subject: [PATCH] un-deprecate lastModified() and getCurrentVersion() git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@188856 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/index/IndexReader.java | 56 +++++++------------ 1 file changed, 19 insertions(+), 37 deletions(-) diff --git a/src/java/org/apache/lucene/index/IndexReader.java b/src/java/org/apache/lucene/index/IndexReader.java index 2b02efd19bb..5d807eba7c8 100644 --- a/src/java/org/apache/lucene/index/IndexReader.java +++ b/src/java/org/apache/lucene/index/IndexReader.java @@ -174,71 +174,53 @@ public abstract class IndexReader { public Directory directory() { return directory; } /** - * Returns the time the index in the named directory was last modified. - * - *

Synchronization of IndexReader and IndexWriter instances is - * no longer done via time stamps of the segments file since the time resolution - * depends on the hardware platform. Instead, a version number is maintained - * within the segments file, which is incremented everytime when the index is - * changed.

- * - * @deprecated Replaced by {@link #getCurrentVersion(String)} - * */ + * Returns the time the index in the named directory was last modified. + * Do not use this to check whether the reader is still up-to-date, use + * {@link #isCurrent()} instead. + */ public static long lastModified(String directory) throws IOException { return lastModified(new File(directory)); } /** * Returns the time the index in the named directory was last modified. - * - *

Synchronization of IndexReader and IndexWriter instances is - * no longer done via time stamps of the segments file since the time resolution - * depends on the hardware platform. Instead, a version number is maintained - * within the segments file, which is incremented everytime when the index is - * changed.

- * - * @deprecated Replaced by {@link #getCurrentVersion(File)} - * */ + * Do not use this to check whether the reader is still up-to-date, use + * {@link #isCurrent()} instead. + */ public static long lastModified(File directory) throws IOException { return FSDirectory.fileModified(directory, Constants.INDEX_SEGMENTS_FILENAME); } /** * Returns the time the index in the named directory was last modified. - * - *

Synchronization of IndexReader and IndexWriter instances is - * no longer done via time stamps of the segments file since the time resolution - * depends on the hardware platform. Instead, a version number is maintained - * within the segments file, which is incremented everytime when the index is - * changed.

- * - * @deprecated Replaced by {@link #getCurrentVersion(Directory)} - * */ + * Do not use this to check whether the reader is still up-to-date, use + * {@link #isCurrent()} instead. + */ public static long lastModified(Directory directory) throws IOException { return directory.fileModified(Constants.INDEX_SEGMENTS_FILENAME); } /** - * Reads version number from segments files. The version number counts the - * number of changes of the index. + * 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 IOException if segments file cannot be read - * @deprecated use {@link #isCurrent()} instead */ public static long getCurrentVersion(String directory) throws IOException { return getCurrentVersion(new File(directory)); } /** - * Reads version number from segments files. The version number counts the - * number of changes of the index. + * 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 IOException if segments file cannot be read - * @deprecated use {@link #isCurrent()} instead */ public static long getCurrentVersion(File directory) throws IOException { Directory dir = FSDirectory.getDirectory(directory, false); @@ -248,13 +230,13 @@ public abstract class IndexReader { } /** - * Reads version number from segments files. The version number counts the - * number of changes of the index. + * 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 IOException if segments file cannot be read. - * @deprecated use {@link #isCurrent()} instead */ public static long getCurrentVersion(Directory directory) throws IOException { return SegmentInfos.readCurrentVersion(directory);