lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1603521 - in /lucene/dev/branches/lucene_solr_4_9/lucene: CHANGES.txt suggest/src/java/org/apache/lucene/search/suggest/jaspell/JaspellLookup.java suggest/src/java/org/apache/lucene/search/suggest/jaspell/JaspellTernarySearchTrie.java
Date Wed, 18 Jun 2014 16:55:29 GMT
Author: mikemccand
Date: Wed Jun 18 16:55:28 2014
New Revision: 1603521

URL: http://svn.apache.org/r1603521
Log:
LUCENE-5775: Deprecate JaspellLookup; fix its ramBytesUsed to not StackOverflow

Modified:
    lucene/dev/branches/lucene_solr_4_9/lucene/CHANGES.txt
    lucene/dev/branches/lucene_solr_4_9/lucene/suggest/src/java/org/apache/lucene/search/suggest/jaspell/JaspellLookup.java
    lucene/dev/branches/lucene_solr_4_9/lucene/suggest/src/java/org/apache/lucene/search/suggest/jaspell/JaspellTernarySearchTrie.java

Modified: lucene/dev/branches/lucene_solr_4_9/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_9/lucene/CHANGES.txt?rev=1603521&r1=1603520&r2=1603521&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_9/lucene/CHANGES.txt (original)
+++ lucene/dev/branches/lucene_solr_4_9/lucene/CHANGES.txt Wed Jun 18 16:55:28 2014
@@ -138,6 +138,8 @@ API Changes
 * LUCENE-5761: Removed DiskDocValuesFormat, it was very inefficient and saved very little
   RAM over the default codec. (Robert Muir)
 
+* LUCENE-5775: Deprecate JaspellLookup. (Mike McCandless)
+
 Optimizations
 
 * LUCENE-5603: hunspell stemmer more efficiently strips prefixes

Modified: lucene/dev/branches/lucene_solr_4_9/lucene/suggest/src/java/org/apache/lucene/search/suggest/jaspell/JaspellLookup.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_9/lucene/suggest/src/java/org/apache/lucene/search/suggest/jaspell/JaspellLookup.java?rev=1603521&r1=1603520&r2=1603521&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_9/lucene/suggest/src/java/org/apache/lucene/search/suggest/jaspell/JaspellLookup.java
(original)
+++ lucene/dev/branches/lucene_solr_4_9/lucene/suggest/src/java/org/apache/lucene/search/suggest/jaspell/JaspellLookup.java
Wed Jun 18 16:55:28 2014
@@ -38,7 +38,9 @@ import org.apache.lucene.util.UnicodeUti
  * <a href="http://jaspell.sourceforge.net/">JaSpell</a>.
  * 
  * @see JaspellTernarySearchTrie
+ * @deprecated Migrate to one of the newer suggesters which are much more RAM efficient.
  */
+@Deprecated
 public class JaspellLookup extends Lookup implements Accountable {
   JaspellTernarySearchTrie trie = new JaspellTernarySearchTrie();
   private boolean usePrefix = true;

Modified: lucene/dev/branches/lucene_solr_4_9/lucene/suggest/src/java/org/apache/lucene/search/suggest/jaspell/JaspellTernarySearchTrie.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_9/lucene/suggest/src/java/org/apache/lucene/search/suggest/jaspell/JaspellTernarySearchTrie.java?rev=1603521&r1=1603520&r2=1603521&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_9/lucene/suggest/src/java/org/apache/lucene/search/suggest/jaspell/JaspellTernarySearchTrie.java
(original)
+++ lucene/dev/branches/lucene_solr_4_9/lucene/suggest/src/java/org/apache/lucene/search/suggest/jaspell/JaspellTernarySearchTrie.java
Wed Jun 18 16:55:28 2014
@@ -62,7 +62,10 @@ import org.apache.lucene.util.RamUsageEs
  * Algorithms, January 1997). Algorithms in C, Third Edition, by Robert
  * Sedgewick (Addison-Wesley, 1998) provides yet another view of ternary search
  * trees.
+ *
+ * @deprecated Migrate to one of the newer suggesters which are much more RAM efficient.
  */
+@Deprecated
 public class JaspellTernarySearchTrie implements Accountable {
 
   /**
@@ -98,7 +101,9 @@ public class JaspellTernarySearchTrie im
     @Override
     public long ramBytesUsed() {
       long mem = RamUsageEstimator.shallowSizeOf(this) + RamUsageEstimator.shallowSizeOf(relatives);
-      for (TSTNode node : relatives) {
+      // We don't need to add parent since our parent added itself:
+      for (int i=1;i<4;i++) {
+        TSTNode node = relatives[i];
         if (node != null) {
           mem += node.ramBytesUsed();
         }



Mime
View raw message