lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r599131 - in /lucene/java/trunk/src/java/org/apache/lucene/index: DocumentsWriter.java IndexFileDeleter.java IndexWriter.java LogMergePolicy.java
Date Wed, 28 Nov 2007 20:20:22 GMT
Author: mikemccand
Date: Wed Nov 28 12:20:21 2007
New Revision: 599131

URL: http://svn.apache.org/viewvc?rev=599131&view=rev
Log:
remove some dead/unnecessary code

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/DocumentsWriter.java
    lucene/java/trunk/src/java/org/apache/lucene/index/IndexFileDeleter.java
    lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
    lucene/java/trunk/src/java/org/apache/lucene/index/LogMergePolicy.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/DocumentsWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/DocumentsWriter.java?rev=599131&r1=599130&r2=599131&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/DocumentsWriter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/DocumentsWriter.java Wed Nov 28 12:20:21
2007
@@ -726,8 +726,6 @@
         fp.docFields[fp.fieldCount++] = field;
       }
 
-      final int numFields = fieldInfos.size();
-
       // Maybe init the local & global fieldsWriter
       if (localFieldsWriter == null) {
         if (fieldsWriter == null) {
@@ -764,11 +762,11 @@
     }
 
     /** Do in-place sort of Posting array */
-    final void doPostingSort(Posting[] postings, int numPosting) {
+    void doPostingSort(Posting[] postings, int numPosting) {
       quickSort(postings, 0, numPosting-1);
     }
 
-    final void quickSort(Posting[] postings, int lo, int hi) {
+    void quickSort(Posting[] postings, int lo, int hi) {
       if (lo >= hi)
         return;
 
@@ -822,11 +820,11 @@
     }
 
     /** Do in-place sort of PostingVector array */
-    final void doVectorSort(PostingVector[] postings, int numPosting) {
+    void doVectorSort(PostingVector[] postings, int numPosting) {
       quickSort(postings, 0, numPosting-1);
     }
 
-    final void quickSort(PostingVector[] postings, int lo, int hi) {
+    void quickSort(PostingVector[] postings, int lo, int hi) {
       if (lo >= hi)
         return;
 
@@ -1040,7 +1038,6 @@
 
     /** Write vInt into freq stream of current Posting */
     public void writeFreqVInt(int i) {
-      int upto = 0;
       while ((i & ~0x7F) != 0) {
         writeFreqByte((byte)((i & 0x7f) | 0x80));
         i >>>= 7;
@@ -1050,7 +1047,6 @@
 
     /** Write vInt into prox stream of current Posting */
     public void writeProxVInt(int i) {
-      int upto = 0;
       while ((i & ~0x7F) != 0) {
         writeProxByte((byte)((i & 0x7f) | 0x80));
         i >>>= 7;
@@ -1106,7 +1102,6 @@
     /** Write vInt into offsets stream of current
      *  PostingVector */
     public void writeOffsetVInt(int i) {
-      int upto = 0;
       while ((i & ~0x7F) != 0) {
         writeOffsetByte((byte)((i & 0x7f) | 0x80));
         i >>>= 7;
@@ -1132,7 +1127,6 @@
     /** Write vInt into pos stream of current
      *  PostingVector */
     public void writePosVInt(int i) {
-      int upto = 0;
       while ((i & ~0x7F) != 0) {
         writePosByte((byte)((i & 0x7f) | 0x80));
         i >>>= 7;
@@ -1240,7 +1234,6 @@
         offset = 0;
         boost = docBoost;
 
-        final int startNumPostings = numPostings;
         final int maxFieldLength = writer.getMaxFieldLength();
 
         final int limit = fieldCount;
@@ -1401,7 +1394,6 @@
         final int tokenTextLen = token.termLength();
 
         int code = 0;
-        int code2 = 0;
 
         // Compute hashcode
         int downto = tokenTextLen;
@@ -1965,7 +1957,6 @@
       assert result;
     }
 
-    Posting lastPosting = null;
     final int skipInterval = termsOut.skipInterval;
     currentFieldStorePayloads = fields[0].fieldInfo.storePayloads;
 

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/IndexFileDeleter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/IndexFileDeleter.java?rev=599131&r1=599130&r2=599131&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/IndexFileDeleter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/IndexFileDeleter.java Wed Nov 28 12:20:21
2007
@@ -17,9 +17,6 @@
  * limitations under the License.
  */
 
-import org.apache.lucene.index.IndexFileNames;
-import org.apache.lucene.index.SegmentInfos;
-import org.apache.lucene.index.SegmentInfo;
 import org.apache.lucene.store.Directory;
 
 import java.io.IOException;
@@ -562,11 +559,11 @@
 
     int count;
 
-    final public int IncRef() {
+    public int IncRef() {
       return ++count;
     }
 
-    final public int DecRef() {
+    public int DecRef() {
       assert count > 0;
       return --count;
     }

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java?rev=599131&r1=599130&r2=599131&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java Wed Nov 28 12:20:21
2007
@@ -2073,8 +2073,6 @@
       message("flush at addIndexes");
     flush();
 
-    int start = segmentInfos.size();
-
     boolean success = false;
 
     startTransaction();
@@ -2580,7 +2578,6 @@
     try {
       SegmentInfos sourceSegmentsClone = merge.segmentsClone;
       SegmentInfos sourceSegments = merge.segments;
-      final int numSegments = segmentInfos.size();
 
       start = ensureContiguousMerge(merge);
       if (infoStream != null)
@@ -2741,7 +2738,6 @@
 
     assert merge.registerDone;
 
-    int mergedDocCount;
     boolean success = false;
 
     try {
@@ -2752,7 +2748,7 @@
       if (infoStream != null)
         message("now merge\n  merge=" + merge.segString(directory) + "\n  index=" + segString());
 
-      mergedDocCount = mergeMiddle(merge);
+      mergeMiddle(merge);
 
       success = true;
     } finally {
@@ -2833,9 +2829,8 @@
 
     final SegmentInfos sourceSegments = merge.segments;
     final int end = sourceSegments.size();
-    final int numSegments = segmentInfos.size();
 
-    final int start = ensureContiguousMerge(merge);
+    ensureContiguousMerge(merge);
 
     // Check whether this merge will allow us to skip
     // merging the doc stores (stored field & vectors).
@@ -2959,7 +2954,6 @@
     assert merge.registerDone;
 
     final SegmentInfos sourceSegments = merge.segments;
-    final SegmentInfos sourceSegmentsClone = merge.segmentsClone;
     final int end = sourceSegments.size();
     for(int i=0;i<end;i++)
       mergingSegments.remove(sourceSegments.info(i));

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/LogMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/LogMergePolicy.java?rev=599131&r1=599130&r2=599131&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/LogMergePolicy.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/LogMergePolicy.java Wed Nov 28 12:20:21
2007
@@ -168,7 +168,6 @@
    *  (mergeFactor at a time) so the {@link MergeScheduler}
    *  in use may make use of concurrency. */
   public MergeSpecification findMergesForOptimize(SegmentInfos infos, IndexWriter writer,
int maxNumSegments, Set segmentsToOptimize) throws IOException {
-    final Directory dir = writer.getDirectory();
     MergeSpecification spec;
     
     if (!isOptimized(infos, writer, maxNumSegments, segmentsToOptimize)) {



Mime
View raw message