lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1603116 - in /lucene/dev/branches/lucene5752/lucene: ./ codecs/src/java/org/apache/lucene/codecs/blockterms/ codecs/src/java/org/apache/lucene/codecs/memory/ core/src/java/org/apache/lucene/codecs/blocktree/ core/src/java/org/apache/lucene...
Date Tue, 17 Jun 2014 10:16:04 GMT
Author: mikemccand
Date: Tue Jun 17 10:16:03 2014
New Revision: 1603116

URL: http://svn.apache.org/r1603116
Log:
LUCENE-5752: minor cleanups / remove imports / sops, etc.

Modified:
    lucene/dev/branches/lucene5752/lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/BlockTermsReader.java
    lucene/dev/branches/lucene5752/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java
    lucene/dev/branches/lucene5752/lucene/common-build.xml
    lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/codecs/blocktree/BlockTreeTermsReader.java
    lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/codecs/blocktree/IntersectTermsEnumFrame.java
    lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/search/AutomatonQuery.java
    lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/search/FuzzyTermsEnum.java
    lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/util/automaton/RunAutomaton.java
    lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/util/automaton/Transition.java
    lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/util/automaton/UTF32ToUTF8.java
    lucene/dev/branches/lucene5752/lucene/sandbox/src/java/org/apache/lucene/codecs/idversion/VersionBlockTreeTermsReader.java
    lucene/dev/branches/lucene5752/lucene/test-framework/src/java/org/apache/lucene/util/automaton/AutomatonTestUtil.java

Modified: lucene/dev/branches/lucene5752/lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/BlockTermsReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5752/lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/BlockTermsReader.java?rev=1603116&r1=1603115&r2=1603116&view=diff
==============================================================================
--- lucene/dev/branches/lucene5752/lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/BlockTermsReader.java
(original)
+++ lucene/dev/branches/lucene5752/lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/BlockTermsReader.java
Tue Jun 17 10:16:03 2014
@@ -105,7 +105,7 @@ public class BlockTermsReader extends Fi
       return field.hashCode() * 31 + term.hashCode();
     }
   }
-
+  
   // private String segment;
   
   public BlockTermsReader(TermsIndexReaderBase indexReader, Directory dir, FieldInfos fieldInfos,
SegmentInfo info, PostingsReaderBase postingsReader, IOContext context,
@@ -364,7 +364,7 @@ public class BlockTermsReader extends Fi
           throw new IllegalStateException("terms index was not loaded");
         }
    
-        //System.out.println("BTR.seek seg=" + segment + " target=" + fieldInfo.name + ":"
+ target.utf8ToString() + " " + target + " current=" + term().utf8ToString() + " " + term()
+ " indexIsCurrent=" + indexIsCurrent + " didIndexNext=" + didIndexNext + " seekPending="
+ seekPending + " this="  + this);
+        //System.out.println("BTR.seek seg=" + segment + " target=" + fieldInfo.name + ":"
+ target.utf8ToString() + " " + target + " current=" + term().utf8ToString() + " " + term()
+ " indexIsCurrent=" + indexIsCurrent + " didIndexNext=" + didIndexNext + " seekPending="
+ seekPending + " divisor=" + indexReader.getDivisor() + " this="  + this);
         if (didIndexNext) {
           if (nextIndexTerm == null) {
             //System.out.println("  nextIndexTerm=null");
@@ -450,7 +450,6 @@ public class BlockTermsReader extends Fi
         // do we then copy the bytes into the term.
 
         while(true) {
-          //System.out.println("cycle common=" + common + " termBlockPrefix=" + termBlockPrefix
+ " term=" + term + " target=" + target);
 
           // First, see if target term matches common prefix
           // in this block:

Modified: lucene/dev/branches/lucene5752/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5752/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java?rev=1603116&r1=1603115&r2=1603116&view=diff
==============================================================================
--- lucene/dev/branches/lucene5752/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java
(original)
+++ lucene/dev/branches/lucene5752/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java
Tue Jun 17 10:16:03 2014
@@ -46,7 +46,6 @@ import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.RamUsageEstimator;
 import org.apache.lucene.util.automaton.CompiledAutomaton;
-import org.apache.lucene.util.automaton.Automaton;
 import org.apache.lucene.util.automaton.RunAutomaton;
 import org.apache.lucene.util.automaton.Transition;
 

Modified: lucene/dev/branches/lucene5752/lucene/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5752/lucene/common-build.xml?rev=1603116&r1=1603115&r2=1603116&view=diff
==============================================================================
--- lucene/dev/branches/lucene5752/lucene/common-build.xml (original)
+++ lucene/dev/branches/lucene5752/lucene/common-build.xml Tue Jun 17 10:16:03 2014
@@ -981,9 +981,8 @@
             <!-- Restrict access to certain Java features and install security manager:
-->
             <sysproperty key="junit4.tempDir" file="@{workDir}/temp" />
             <sysproperty key="clover.db.dir" file="${clover.db.dir}" />
-	    <!-- nocommit -->
-            <!--<sysproperty key="java.security.manager" value="org.apache.lucene.util.TestSecurityManager"
/>
-            <sysproperty key="java.security.policy" file="${common.dir}/tools/junit4/tests.policy"
/>-->
+            <sysproperty key="java.security.manager" value="org.apache.lucene.util.TestSecurityManager"
/>
+            <sysproperty key="java.security.policy" file="${common.dir}/tools/junit4/tests.policy"
/>
 
             <sysproperty key="lucene.version" value="${version}"/>
 

Modified: lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/codecs/blocktree/BlockTreeTermsReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/codecs/blocktree/BlockTreeTermsReader.java?rev=1603116&r1=1603115&r2=1603116&view=diff
==============================================================================
--- lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/codecs/blocktree/BlockTreeTermsReader.java
(original)
+++ lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/codecs/blocktree/BlockTreeTermsReader.java
Tue Jun 17 10:16:03 2014
@@ -18,42 +18,25 @@ package org.apache.lucene.codecs.blocktr
  */
 
 import java.io.IOException;
-import java.io.PrintStream;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.TreeMap;
 
-import org.apache.lucene.codecs.BlockTermState;
 import org.apache.lucene.codecs.CodecUtil;
 import org.apache.lucene.codecs.FieldsProducer;
 import org.apache.lucene.codecs.PostingsReaderBase;
 import org.apache.lucene.index.CorruptIndexException;
-import org.apache.lucene.index.DocsAndPositionsEnum;
-import org.apache.lucene.index.DocsEnum;
 import org.apache.lucene.index.FieldInfo.IndexOptions;
 import org.apache.lucene.index.FieldInfo;
 import org.apache.lucene.index.FieldInfos;
 import org.apache.lucene.index.IndexFileNames;
 import org.apache.lucene.index.SegmentInfo;
-import org.apache.lucene.index.TermState;
 import org.apache.lucene.index.Terms;
-import org.apache.lucene.index.TermsEnum;
-import org.apache.lucene.store.ByteArrayDataInput;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
 import org.apache.lucene.store.IndexInput;
-import org.apache.lucene.util.ArrayUtil;
-import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.IOUtils;
-import org.apache.lucene.util.RamUsageEstimator;
-import org.apache.lucene.util.StringHelper;
-import org.apache.lucene.util.automaton.CompiledAutomaton;
-import org.apache.lucene.util.automaton.RunAutomaton;
-import org.apache.lucene.util.fst.ByteSequenceOutputs;
-import org.apache.lucene.util.fst.FST;
-import org.apache.lucene.util.fst.Outputs;
-import org.apache.lucene.util.fst.Util;
 
 /** A block-based terms index and dictionary that assigns
  *  terms to variable length blocks according to how they

Modified: lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/codecs/blocktree/IntersectTermsEnumFrame.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/codecs/blocktree/IntersectTermsEnumFrame.java?rev=1603116&r1=1603115&r2=1603116&view=diff
==============================================================================
--- lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/codecs/blocktree/IntersectTermsEnumFrame.java
(original)
+++ lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/codecs/blocktree/IntersectTermsEnumFrame.java
Tue Jun 17 10:16:03 2014
@@ -24,7 +24,6 @@ import org.apache.lucene.index.FieldInfo
 import org.apache.lucene.store.ByteArrayDataInput;
 import org.apache.lucene.util.ArrayUtil;
 import org.apache.lucene.util.BytesRef;
-import org.apache.lucene.util.automaton.Automaton;
 import org.apache.lucene.util.automaton.Transition;
 import org.apache.lucene.util.fst.FST;
 

Modified: lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/search/AutomatonQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/search/AutomatonQuery.java?rev=1603116&r1=1603115&r2=1603116&view=diff
==============================================================================
--- lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/search/AutomatonQuery.java
(original)
+++ lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/search/AutomatonQuery.java
Tue Jun 17 10:16:03 2014
@@ -24,8 +24,8 @@ import org.apache.lucene.index.Terms;
 import org.apache.lucene.index.TermsEnum;
 import org.apache.lucene.util.AttributeSource;
 import org.apache.lucene.util.ToStringUtils;
-import org.apache.lucene.util.automaton.CompiledAutomaton;
 import org.apache.lucene.util.automaton.Automaton;
+import org.apache.lucene.util.automaton.CompiledAutomaton;
 
 /**
  * A {@link Query} that will match terms against a finite-state machine.
@@ -116,7 +116,7 @@ public class AutomatonQuery extends Mult
     return buffer.toString();
   }
   
-  /** Returns the light automaton used to create this query */
+  /** Returns the automaton used to create this query */
   public Automaton getAutomaton() {
     return automaton;
   }

Modified: lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/search/FuzzyTermsEnum.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/search/FuzzyTermsEnum.java?rev=1603116&r1=1603115&r2=1603116&view=diff
==============================================================================
--- lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/search/FuzzyTermsEnum.java
(original)
+++ lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/search/FuzzyTermsEnum.java
Tue Jun 17 10:16:03 2014
@@ -35,10 +35,10 @@ import org.apache.lucene.util.AttributeS
 import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.UnicodeUtil;
+import org.apache.lucene.util.automaton.Automaton;
 import org.apache.lucene.util.automaton.ByteRunAutomaton;
 import org.apache.lucene.util.automaton.CompiledAutomaton;
 import org.apache.lucene.util.automaton.LevenshteinAutomata;
-import org.apache.lucene.util.automaton.Automaton;
 
 /** Subclass of TermsEnum for enumerating all terms that are similar
  * to the specified filter term.

Modified: lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/util/automaton/RunAutomaton.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/util/automaton/RunAutomaton.java?rev=1603116&r1=1603115&r2=1603116&view=diff
==============================================================================
--- lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/util/automaton/RunAutomaton.java
(original)
+++ lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/util/automaton/RunAutomaton.java
Tue Jun 17 10:16:03 2014
@@ -122,28 +122,20 @@ public abstract class RunAutomaton {
    */
   public RunAutomaton(Automaton a, int maxInterval, boolean tableize) {
     this.maxInterval = maxInterval;
-    //System.out.println("before det a=" + a.getNumStates());
     a = Operations.determinize(a);
     this.automaton = a;
-    //System.out.println("AFTER DET tableize= " + tableize + ": ");
-    //System.out.println(a.toDot());
     points = a.getStartPoints();
-    //System.out.println("  points=" + Arrays.toString(points));
     initial = 0;
     size = Math.max(1,a.getNumStates());
     accept = new boolean[size];
     transitions = new int[size * points.length];
     Arrays.fill(transitions, -1);
-    //System.out.println("RA: size=" + size + " points.length=" + points.length + " total="
+ (size * points.length));
     for (int n=0;n<size;n++) {
       accept[n] = a.isAccept(n);
-      //System.out.println("n=" + n + " acc=" + accept[n] + " size=" + size);
       for (int c = 0; c < points.length; c++) {
         int dest = a.step(n, points[c]);
-        //System.out.println("  step from point=" + c + " n=" + n + " label=" + (char) points[c]
+ " -> " + dest);
         assert dest == -1 || dest < size;
         transitions[n * points.length + c] = dest;
-        //System.out.println("  trans label=" + points[c] + " dest=" + transitions[n * points.length
+ c]);
       }
     }
 
@@ -158,9 +150,7 @@ public abstract class RunAutomaton {
           i++;
         }
         classmap[j] = i;
-        //System.out.println("classmap[" + (char) j + "]=" + i);
       }
-      //System.out.println("  after classmap i=" + i + " maxInterval=" + maxInterval);
     } else {
       classmap = null;
     }
@@ -174,11 +164,9 @@ public abstract class RunAutomaton {
    * transition function.)
    */
   public final int step(int state, int c) {
-    //System.out.println("  step state=" + state + " c=" + c + " points.length=" + points.length
+ " transitions.len=" + transitions.length);
     if (classmap == null) {
       return transitions[state * points.length + getCharClass(c)];
     } else {
-      //System.out.println("    classmap[c]=" + classmap[c]);
       return transitions[state * points.length + classmap[c]];
     }
   }

Modified: lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/util/automaton/Transition.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/util/automaton/Transition.java?rev=1603116&r1=1603115&r2=1603116&view=diff
==============================================================================
--- lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/util/automaton/Transition.java
(original)
+++ lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/util/automaton/Transition.java
Tue Jun 17 10:16:03 2014
@@ -17,8 +17,10 @@ package org.apache.lucene.util.automaton
  * limitations under the License.
  */
 
-/** Used temporarily when iterating through transitions from a {@link Automaton}
+/** Holds one transition from an {@link Automaton}.  This is typically
+ *  used temporarily when iterating through transitions by invoking
  *  {@link Automaton#initTransition} and {@link Automaton#getNextTransition}. */
+
 public class Transition {
 
   /** Sole constructor. */

Modified: lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/util/automaton/UTF32ToUTF8.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/util/automaton/UTF32ToUTF8.java?rev=1603116&r1=1603115&r2=1603116&view=diff
==============================================================================
--- lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/util/automaton/UTF32ToUTF8.java
(original)
+++ lucene/dev/branches/lucene5752/lucene/core/src/java/org/apache/lucene/util/automaton/UTF32ToUTF8.java
Tue Jun 17 10:16:03 2014
@@ -134,8 +134,6 @@ public final class UTF32ToUTF8 {
   void convertOneEdge(int start, int end, int startCodePoint, int endCodePoint) {
     startUTF8.set(startCodePoint);
     endUTF8.set(endCodePoint);
-    //System.out.println("start = " + startUTF8);
-    //System.out.println("  end = " + endUTF8);
     build(start, end, startUTF8, endUTF8, 0);
   }
 
@@ -294,15 +292,12 @@ public final class UTF32ToUTF8 {
 
       int numTransitions = utf32.getNumTransitions(utf32State);
       utf32.initTransition(utf32State, scratch);
-      //System.out.println("  convert state=" + utf32State + " numTransitions=" + numTransitions);
       for(int i=0;i<numTransitions;i++) {
         utf32.getNextTransition(scratch);
         int destUTF32 = scratch.dest;
         int destUTF8 = map[destUTF32];
-        //System.out.println("    transition min=" + scratch.min + " max=" + scratch.max);
         if (destUTF8 == -1) {
           destUTF8 = utf8.createState();
-          //System.out.println("      create dest=" + destUTF8 +" accept=" + utf32.isAccept(destUTF32));
           utf8.setAccept(destUTF8, utf32.isAccept(destUTF32));
           map[destUTF32] = destUTF8;
           pending.add(destUTF32);

Modified: lucene/dev/branches/lucene5752/lucene/sandbox/src/java/org/apache/lucene/codecs/idversion/VersionBlockTreeTermsReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5752/lucene/sandbox/src/java/org/apache/lucene/codecs/idversion/VersionBlockTreeTermsReader.java?rev=1603116&r1=1603115&r2=1603116&view=diff
==============================================================================
--- lucene/dev/branches/lucene5752/lucene/sandbox/src/java/org/apache/lucene/codecs/idversion/VersionBlockTreeTermsReader.java
(original)
+++ lucene/dev/branches/lucene5752/lucene/sandbox/src/java/org/apache/lucene/codecs/idversion/VersionBlockTreeTermsReader.java
Tue Jun 17 10:16:03 2014
@@ -18,44 +18,25 @@ package org.apache.lucene.codecs.idversi
  */
 
 import java.io.IOException;
-import java.io.PrintStream;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.TreeMap;
 
-import org.apache.lucene.codecs.BlockTermState;
 import org.apache.lucene.codecs.CodecUtil;
 import org.apache.lucene.codecs.FieldsProducer;
 import org.apache.lucene.codecs.PostingsReaderBase;
 import org.apache.lucene.index.CorruptIndexException;
-import org.apache.lucene.index.DocsAndPositionsEnum;
-import org.apache.lucene.index.DocsEnum;
-import org.apache.lucene.index.FieldInfo.IndexOptions;
 import org.apache.lucene.index.FieldInfo;
 import org.apache.lucene.index.FieldInfos;
 import org.apache.lucene.index.IndexFileNames;
 import org.apache.lucene.index.SegmentInfo;
-import org.apache.lucene.index.TermState;
 import org.apache.lucene.index.Terms;
-import org.apache.lucene.index.TermsEnum;
-import org.apache.lucene.store.ByteArrayDataInput;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
 import org.apache.lucene.store.IndexInput;
-import org.apache.lucene.util.ArrayUtil;
-import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.IOUtils;
-import org.apache.lucene.util.RamUsageEstimator;
-import org.apache.lucene.util.StringHelper;
-import org.apache.lucene.util.automaton.CompiledAutomaton;
-import org.apache.lucene.util.automaton.RunAutomaton;
-import org.apache.lucene.util.fst.ByteSequenceOutputs;
-import org.apache.lucene.util.fst.FST;
-import org.apache.lucene.util.fst.Outputs;
 import org.apache.lucene.util.fst.PairOutputs.Pair;
-import org.apache.lucene.util.fst.PairOutputs;
-import org.apache.lucene.util.fst.Util;
 
 /**
  * See {@link VersionBlockTreeTermsWriter}.

Modified: lucene/dev/branches/lucene5752/lucene/test-framework/src/java/org/apache/lucene/util/automaton/AutomatonTestUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5752/lucene/test-framework/src/java/org/apache/lucene/util/automaton/AutomatonTestUtil.java?rev=1603116&r1=1603115&r2=1603116&view=diff
==============================================================================
--- lucene/dev/branches/lucene5752/lucene/test-framework/src/java/org/apache/lucene/util/automaton/AutomatonTestUtil.java
(original)
+++ lucene/dev/branches/lucene5752/lucene/test-framework/src/java/org/apache/lucene/util/automaton/AutomatonTestUtil.java
Tue Jun 17 10:16:03 2014
@@ -129,7 +129,7 @@ public class AutomatonTestUtil {
 
   /**
    * Lets you retrieve random strings accepted
-   * by a LightAutomaton.
+   * by an Automaton.
    * <p>
    * Once created, call {@link #getRandomAcceptedString(Random)}
    * to get a new string (in UTF-32 codepoints).



Mime
View raw message