lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r796916 - in /lucene/java/trunk/src: java/org/apache/lucene/index/ test/org/apache/lucene/index/
Date Thu, 23 Jul 2009 00:02:48 GMT
Author: mikemccand
Date: Thu Jul 23 00:02:48 2009
New Revision: 796916

URL: http://svn.apache.org/viewvc?rev=796916&view=rev
Log:
LUCENE-1609: un-deprecate IndexReader.getTermInfosIndexDivisor

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/DirectoryReader.java
    lucene/java/trunk/src/java/org/apache/lucene/index/IndexReader.java
    lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReader.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermDocs.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/DirectoryReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/DirectoryReader.java?rev=796916&r1=796915&r2=796916&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/DirectoryReader.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/DirectoryReader.java Thu Jul 23 00:02:48
2009
@@ -846,6 +846,10 @@
     return directory;
   }
 
+  public int getTermInfosIndexDivisor() {
+    return termInfosIndexDivisor;
+  }
+
   /**
    * Expert: return the IndexCommit that this reader has opened.
    * <p/>

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/IndexReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/IndexReader.java?rev=796916&r1=796915&r2=796916&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 Thu Jul 23 00:02:48
2009
@@ -736,12 +736,11 @@
 
   /** <p>For IndexReader implementations that use
    *  TermInfosReader to read terms, this returns the
-   *  current indexDivisor.
-   *  @see #setTermInfosIndexDivisor
-   * @deprecated Please use {@link IndexReader#open(Directory, IndexDeletionPolicy, boolean,
int)} to specify the required TermInfos index divisor instead.
+   *  current indexDivisor as specified when the reader was
+   *  opened.
    */
   public int getTermInfosIndexDivisor() {
-    throw new UnsupportedOperationException("Please pass termInfosIndexDivisor up-front when
opening IndexReader");
+    throw new UnsupportedOperationException("This reader does not support this method.");
   }
 
   /**

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java?rev=796916&r1=796915&r2=796916&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java Thu Jul 23 00:02:48
2009
@@ -1355,4 +1355,7 @@
     throw new IllegalArgumentException(reader + " is not a SegmentReader or a single-segment
DirectoryReader");
   }
 
+  public int getTermInfosIndexDivisor() {
+    return core.termsIndexDivisor;
+  }
 }

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReader.java?rev=796916&r1=796915&r2=796916&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReader.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReader.java Thu Jul 23 00:02:48
2009
@@ -1821,6 +1821,7 @@
     }
     assertFalse(((SegmentReader) r.getSequentialSubReaders()[0]).termsIndexLoaded());
 
+    assertEquals(-1, r.getTermInfosIndexDivisor());
     writer = new IndexWriter(dir, new WhitespaceAnalyzer(), IndexWriter.MaxFieldLength.UNLIMITED);
     writer.addDocument(doc);
     writer.close();

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermDocs.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermDocs.java?rev=796916&r1=796915&r2=796916&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermDocs.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermDocs.java Thu Jul 23
00:02:48 2009
@@ -54,6 +54,7 @@
     //After adding the document, we should be able to read it back in
     SegmentReader reader = SegmentReader.get(true, info, indexDivisor);
     assertTrue(reader != null);
+    assertEquals(indexDivisor, reader.getTermInfosIndexDivisor());
     SegmentTermDocs segTermDocs = new SegmentTermDocs(reader);
     assertTrue(segTermDocs != null);
     segTermDocs.seek(new Term(DocHelper.TEXT_FIELD_2_KEY, "field"));



Mime
View raw message