lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1574925 - in /lucene/dev/branches/lucene5493/lucene/misc/src/java/org/apache/lucene/index/sorter: Sorter.java SortingMergePolicy.java
Date Thu, 06 Mar 2014 15:39:36 GMT
Author: rmuir
Date: Thu Mar  6 15:39:35 2014
New Revision: 1574925

URL: http://svn.apache.org/r1574925
Log:
LUCENE-5493: remove dead code

Modified:
    lucene/dev/branches/lucene5493/lucene/misc/src/java/org/apache/lucene/index/sorter/Sorter.java
    lucene/dev/branches/lucene5493/lucene/misc/src/java/org/apache/lucene/index/sorter/SortingMergePolicy.java

Modified: lucene/dev/branches/lucene5493/lucene/misc/src/java/org/apache/lucene/index/sorter/Sorter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5493/lucene/misc/src/java/org/apache/lucene/index/sorter/Sorter.java?rev=1574925&r1=1574924&r2=1574925&view=diff
==============================================================================
--- lucene/dev/branches/lucene5493/lucene/misc/src/java/org/apache/lucene/index/sorter/Sorter.java
(original)
+++ lucene/dev/branches/lucene5493/lucene/misc/src/java/org/apache/lucene/index/sorter/Sorter.java
Thu Mar  6 15:39:35 2014
@@ -36,14 +36,6 @@ import org.apache.lucene.util.packed.Mon
  */
 abstract class Sorter {
 
-  /** A comparator that keeps documents in index order. */
-  public static final DocComparator INDEX_ORDER_COMPARATOR = new DocComparator() {
-    @Override
-    public int compare(int docID1, int docID2) {
-      return docID1 - docID2;
-    }
-  };
-
   /**
    * A permutation of doc IDs. For every document ID between <tt>0</tt> and
    * {@link IndexReader#maxDoc()}, <code>oldToNew(newToOld(docID))</code> must
@@ -89,38 +81,6 @@ abstract class Sorter {
 
   }
 
-  /**
-   * Sorts documents in reverse order. <b>NOTE</b>: This {@link Sorter} is not
-   * idempotent. Sorting an {@link AtomicReader} once or twice will return two
-   * different {@link AtomicReader} views. This {@link Sorter} should not be
-   * used with {@link SortingMergePolicy}.
-   */
-  public static final Sorter REVERSE_DOCS = new Sorter() {
-    @Override
-    public DocMap sort(final AtomicReader reader) throws IOException {
-      final int maxDoc = reader.maxDoc();
-      return new DocMap() {
-        @Override
-        public int oldToNew(int docID) {
-          return maxDoc - docID - 1;
-        }
-        @Override
-        public int newToOld(int docID) {
-          return maxDoc - docID - 1;
-        }
-        @Override
-        public int size() {
-          return maxDoc;
-        }
-      };
-    }
-    
-    @Override
-    public String getID() {
-      return "ReverseDocs";
-    }
-  };
-  
   private static final class DocValueSorter extends TimSorter {
     
     private final int[] docs;

Modified: lucene/dev/branches/lucene5493/lucene/misc/src/java/org/apache/lucene/index/sorter/SortingMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5493/lucene/misc/src/java/org/apache/lucene/index/sorter/SortingMergePolicy.java?rev=1574925&r1=1574924&r2=1574925&view=diff
==============================================================================
--- lucene/dev/branches/lucene5493/lucene/misc/src/java/org/apache/lucene/index/sorter/SortingMergePolicy.java
(original)
+++ lucene/dev/branches/lucene5493/lucene/misc/src/java/org/apache/lucene/index/sorter/SortingMergePolicy.java
Thu Mar  6 15:39:35 2014
@@ -47,7 +47,7 @@ import org.apache.lucene.util.packed.Mon
  *  to have sequentially-assigned doc IDs, this policy will scatter doc IDs.
  *  <p><b>NOTE</b>: This {@link MergePolicy} should only be used with idempotent
  *  {@link Sort}s so that the order of segments is predictable. For example,
- *  using {@link SortingMergePolicy} with {@link Sorter#REVERSE_DOCS} (which is
+ *  using {@link SortingMergePolicy} with {@link Sort#INDEXORDER in reverse} (which is
  *  not idempotent) will make the order of documents in a segment depend on the
  *  number of times the segment has been merged.
  *  @lucene.experimental */



Mime
View raw message