You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by dn...@apache.org on 2005/06/07 22:21:27 UTC

svn commit: r188856 - /lucene/java/trunk/src/java/org/apache/lucene/index/IndexReader.java

Author: dnaber
Date: Tue Jun  7 13:21:26 2005
New Revision: 188856

URL: http://svn.apache.org/viewcvs?rev=188856&view=rev
Log:
un-deprecate lastModified() and getCurrentVersion()

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/IndexReader.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/IndexReader.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/src/java/org/apache/lucene/index/IndexReader.java?rev=188856&r1=188855&r2=188856&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/IndexReader.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/IndexReader.java Tue Jun  7 13:21:26 2005
@@ -174,71 +174,53 @@
   public Directory directory() { return directory; }
 
   /** 
-   * Returns the time the index in the named directory was last modified. 
-   * 
-   * <p>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.</p>
-   * 
-   * @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. 
-   * 
-   * <p>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.</p>
-   * 
-   * @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. 
-   * 
-   * <p>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.</p>
-   * 
-   * @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 @@
   }
 
   /**
-   * 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);