lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r834707 - in /lucene/java/trunk/contrib: benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ benchmark/src/java/org/apache/lucene/benchmark/utils/ highlighter/src/java/or...
Date Tue, 10 Nov 2009 23:22:48 GMT
Author: rmuir
Date: Tue Nov 10 23:22:48 2009
New Revision: 834707

URL: http://svn.apache.org/viewvc?rev=834707&view=rev
Log:
LUCENE-2022: remove contrib deprecations

Removed:
    lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiDocMaker.java
    lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/LineDocMaker.java
    lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/misc/LengthNormModifier.java
Modified:
    lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/PerfTask.java
    lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java
    lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/utils/ExtractWikipedia.java
    lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/Highlighter.java
    lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/TextFragment.java
    lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
    lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/misc/ChainedFilter.java
    lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/BooleanFilter.java
    lucene/java/trunk/contrib/spatial/src/java/org/apache/lucene/spatial/geometry/shape/DistanceApproximation.java

Modified: lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/PerfTask.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/PerfTask.java?rev=834707&r1=834706&r2=834707&view=diff
==============================================================================
--- lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/PerfTask.java
(original)
+++ lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/PerfTask.java
Tue Nov 10 23:22:48 2009
@@ -69,25 +69,6 @@
       name = name.substring(0, name.length() - 4);
     }
   }
-
-  /**
-   * @deprecated will be removed in 3.0. checks if there are any obsolete
-   *             settings, like doc.add.log.step and doc.delete.log.step and
-   *             alerts the user.
-   */
-  private void checkObsoleteSettings(Config config) {
-    if (config.get("doc.add.log.step", null) != null) {
-      throw new RuntimeException("doc.add.log.step is not supported anymore. " +
-      		"Use log.step.AddDoc and refer to CHANGES to read on the recent " +
-      		"API changes done to Benchmark's DocMaker and Task-based logging.");
-    }
-    
-    if (config.get("doc.delete.log.step", null) != null) {
-      throw new RuntimeException("doc.delete.log.step is not supported anymore. " +
-          "Use log.step.DeleteDoc and refer to CHANGES to read on the recent " +
-          "API changes done to Benchmark's DocMaker and Task-based logging.");
-    }
-  }
   
   public PerfTask(PerfRunData runData) {
     this();
@@ -114,7 +95,6 @@
     if (logStep <= 0) {
       logStep = Integer.MAX_VALUE;
     }
-    checkObsoleteSettings(config);
   }
   
   @Override

Modified: lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java?rev=834707&r1=834706&r2=834707&view=diff
==============================================================================
--- lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java
(original)
+++ lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java
Tue Nov 10 23:22:48 2009
@@ -256,53 +256,12 @@
   }
 
   /**
-   * @deprecated Use {@link #getBenchmarkHighlighter(Query)}
-   */
-  final Highlighter getHighlighter(Query q) {
-    // not called
-    return null;
-  }
-  
-  /**
    * Return an appropriate highlighter to be used with
    * highlighting tasks
    */
   protected BenchmarkHighlighter getBenchmarkHighlighter(Query q){
     return null;
   }
-
-  /**
-   * @return the maximum number of highlighter fragments
-   * @deprecated Please define getBenchmarkHighlighter instead
-   */
-  final int maxNumFragments(){
-    // not called -- we switched this method to final to
-    // force any external subclasses to cutover to
-    // getBenchmarkHighlighter instead
-    return 10;
-  }
-
-  /**
-   *
-   * @return true if the highlighter should merge contiguous fragments
-   * @deprecated Please define getBenchmarkHighlighter instead
-   */
-  final boolean isMergeContiguousFragments(){
-    // not called -- we switched this method to final to
-    // force any external subclasses to cutover to
-    // getBenchmarkHighlighter instead
-    return false;
-  }
-
-  /**
-   * @deprecated Please define getBenchmarkHighlighter instead
-   */
-  final int doHighlight(TokenStream ts, String text,  Highlighter highlighter, boolean mergeContiguous,
int maxFragments) throws IOException, InvalidTokenOffsetsException {
-    // not called -- we switched this method to final to
-    // force any external subclasses to cutover to
-    // getBenchmarkHighlighter instead
-    return 0;
-  }
   
   protected Sort getSort() {
     return null;

Modified: lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/utils/ExtractWikipedia.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/utils/ExtractWikipedia.java?rev=834707&r1=834706&r2=834707&view=diff
==============================================================================
--- lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/utils/ExtractWikipedia.java
(original)
+++ lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/utils/ExtractWikipedia.java
Tue Nov 10 23:22:48 2009
@@ -23,7 +23,6 @@
 import java.util.Properties;
 
 import org.apache.lucene.benchmark.byTask.feeds.DocMaker;
-import org.apache.lucene.benchmark.byTask.feeds.EnwikiDocMaker;
 import org.apache.lucene.benchmark.byTask.feeds.NoMoreDataException;
 import org.apache.lucene.benchmark.byTask.utils.Config;
 import org.apache.lucene.document.Document;
@@ -125,16 +124,16 @@
       }
 
     }
-    DocMaker docMaker = new EnwikiDocMaker();
+    DocMaker docMaker = new DocMaker();
     Properties properties = new Properties();
-
+    properties.setProperty("content.source", "org.apache.lucene.benchmark.byTask.feeds.EnwikiContentSource");
     properties.setProperty("docs.file", wikipedia.getAbsolutePath());
     properties.setProperty("content.source.forever", "false");
     properties.setProperty("keep.image.only.docs", String.valueOf(keepImageOnlyDocs));
     docMaker.setConfig(new Config(properties));
     docMaker.resetInputs();
     if (wikipedia != null && wikipedia.exists()) {
-      System.out.println("Extracting Wikipedia to: " + outputDir + " using EnwikiDocMaker");
+      System.out.println("Extracting Wikipedia to: " + outputDir + " using EnwikiContentSource");
       outputDir.mkdirs();
       ExtractWikipedia extractor = new ExtractWikipedia(docMaker, outputDir);
       extractor.extract();
@@ -145,9 +144,8 @@
 
   private static void printUsage() {
     System.err.println("Usage: java -cp <...> org.apache.lucene.benchmark.utils.ExtractWikipedia
--input|-i <Path to Wikipedia XML file> " +
-            "[--output|-o <Output Path>] [--discardImageOnlyDocs|-d] [--useLineDocMaker|-l]");
+            "[--output|-o <Output Path>] [--discardImageOnlyDocs|-d]");
     System.err.println("--discardImageOnlyDocs tells the extractor to skip Wiki docs that
contain only images");
-    System.err.println("--useLineDocMaker uses the LineDocMaker.  Default is EnwikiDocMaker");
   }
 
 }
\ No newline at end of file

Modified: lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/Highlighter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/Highlighter.java?rev=834707&r1=834706&r2=834707&view=diff
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/Highlighter.java
(original)
+++ lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/Highlighter.java
Tue Nov 10 23:22:48 2009
@@ -36,10 +36,7 @@
 public class Highlighter
 {
   public static final int DEFAULT_MAX_CHARS_TO_ANALYZE = 50*1024;
-  /**
-   * @deprecated See {@link #DEFAULT_MAX_CHARS_TO_ANALYZE}
-   */
-	public static final  int DEFAULT_MAX_DOC_BYTES_TO_ANALYZE=DEFAULT_MAX_CHARS_TO_ANALYZE;
+
   private int maxDocCharsToAnalyze = DEFAULT_MAX_CHARS_TO_ANALYZE;
 	private Formatter formatter;
 	private Encoder encoder;
@@ -119,29 +116,6 @@
 	 *
 	 * @param analyzer   the analyzer that will be used to split <code>text</code>
 	 * into chunks
-	 * @param text        	text to highlight terms in
-	 * @param maxNumFragments  the maximum number of fragments.
-	 * @deprecated This method incorrectly hardcodes the choice of fieldname. Use the
-	 * method of the same name that takes a fieldname.
-	 * @return highlighted text fragments (between 0 and maxNumFragments number of fragments)
-	 * @throws InvalidTokenOffsetsException  thrown if any token's endOffset exceeds the provided
text's length
-	 */
-	public final String[] getBestFragments(
-		Analyzer analyzer,
-		String text,
-		int maxNumFragments)
-		throws IOException, InvalidTokenOffsetsException
-	{
-		TokenStream tokenStream = analyzer.tokenStream("field", new StringReader(text));
-		return getBestFragments(tokenStream, text, maxNumFragments);
-	}
-	/**
-	 * Highlights chosen terms in a text, extracting the most relevant sections.
-	 * This is a convenience method that calls
-	 * {@link #getBestFragments(TokenStream, String, int)}
-	 *
-	 * @param analyzer   the analyzer that will be used to split <code>text</code>
-	 * into chunks
 	 * @param fieldName     the name of the field being highlighted (used by analyzer)
 	 * @param text        	text to highlight terms in
 	 * @param maxNumFragments  the maximum number of fragments.
@@ -498,27 +472,6 @@
 		return result.toString();
 	}
 
-	/**
-	 * @return the maximum number of bytes to be tokenized per doc
-   *
-   * @deprecated See {@link #getMaxDocCharsToAnalyze()}, since this value has always counted
on chars.  They both set the same internal value, however
-	 */
-	public int getMaxDocBytesToAnalyze()
-	{
-		return maxDocCharsToAnalyze;
-	}
-
-	/**
-	 * @param byteCount the maximum number of bytes to be tokenized per doc
-	 * (This can improve performance with large documents)
-   *
-   * @deprecated See {@link #setMaxDocCharsToAnalyze(int)}, since this value has always counted
chars
-	 */
-	public void setMaxDocBytesToAnalyze(int byteCount)
-	{
-		maxDocCharsToAnalyze = byteCount;
-	}
-
   public int getMaxDocCharsToAnalyze() {
     return maxDocCharsToAnalyze;
   }

Modified: lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/TextFragment.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/TextFragment.java?rev=834707&r1=834706&r2=834707&view=diff
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/TextFragment.java
(original)
+++ lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/TextFragment.java
Tue Nov 10 23:22:48 2009
@@ -37,7 +37,10 @@
 		this.textStartPos = textStartPos;
 		this.fragNum = fragNum;
 	}
-  /** @deprecated */
+  /** 
+   * @deprecated Use {@link #TextFragment(CharSequence, int, int)} instead.
+   * This constructor will be removed in Lucene 4.0
+   */
 	public TextFragment(StringBuffer markedUpText,int textStartPos, int fragNum)
 	{
 		this.markedUpText=markedUpText;

Modified: lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java?rev=834707&r1=834706&r2=834707&view=diff
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
(original)
+++ lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
Tue Nov 10 23:22:48 2009
@@ -1096,7 +1096,7 @@
         Highlighter highlighter = getHighlighter(query, FIELD_NAME, tokenStream,
             HighlighterTest.this);// new Highlighter(this, new
         // QueryTermScorer(query));
-        highlighter.setMaxDocBytesToAnalyze(30);
+        highlighter.setMaxDocCharsToAnalyze(30);
 
         highlighter.getBestFragment(tokenStream, texts[0]);
         assertTrue("Setting MaxDocBytesToAnalyze should have prevented "
@@ -1133,10 +1133,10 @@
         // new
         // QueryTermScorer(query));
         hg.setTextFragmenter(new NullFragmenter());
-        hg.setMaxDocBytesToAnalyze(100);
+        hg.setMaxDocCharsToAnalyze(100);
         match = hg.getBestFragment(new StandardAnalyzer(TEST_VERSION, stopWords), "data",
sb.toString());
         assertTrue("Matched text should be no more than 100 chars in length ", match.length()
< hg
-            .getMaxDocBytesToAnalyze());
+            .getMaxDocCharsToAnalyze());
 
         // add another tokenized word to the overrall length - but set way
         // beyond
@@ -1147,7 +1147,7 @@
         sb.append(goodWord);
         match = hg.getBestFragment(new StandardAnalyzer(TEST_VERSION, stopWords), "data",
sb.toString());
         assertTrue("Matched text should be no more than 100 chars in length ", match.length()
< hg
-            .getMaxDocBytesToAnalyze());
+            .getMaxDocCharsToAnalyze());
       }
     };
 

Modified: lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/misc/ChainedFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/misc/ChainedFilter.java?rev=834707&r1=834706&r2=834707&view=diff
==============================================================================
--- lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/misc/ChainedFilter.java (original)
+++ lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/misc/ChainedFilter.java Tue
Nov 10 23:22:48 2009
@@ -150,16 +150,14 @@
         return result;
     }
 
-    // TODO: in 3.0, instead of removing this deprecated
-    // method, make it a no-op and mark it final
     /** Provide a SortedVIntList when it is definitely
      *  smaller than an OpenBitSet
      *  @deprecated Either use CachingWrapperFilter, or
-     *  switch to a different DocIdSet implementation yourself. */
-    protected DocIdSet finalResult(OpenBitSetDISI result, int maxDocs) {
-        return (result.cardinality() < (maxDocs / 9))
-              ? (DocIdSet) new SortedVIntList(result)
-              : (DocIdSet) result;
+     *  switch to a different DocIdSet implementation yourself.
+     *  This method will be removed in Lucene 4.0 
+     **/
+    protected final DocIdSet finalResult(OpenBitSetDISI result, int maxDocs) {
+        return result;
     }
         
 

Modified: lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/BooleanFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/BooleanFilter.java?rev=834707&r1=834706&r2=834707&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/BooleanFilter.java
(original)
+++ lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/BooleanFilter.java
Tue Nov 10 23:22:48 2009
@@ -112,16 +112,14 @@
     return DocIdSet.EMPTY_DOCIDSET;
   }
 
-  // TODO: in 3.0, instead of removing this deprecated
-  // method, make it a no-op and mark it final
   /** Provide a SortedVIntList when it is definitely smaller
    * than an OpenBitSet.
    * @deprecated Either use CachingWrapperFilter, or
-   * switch to a different DocIdSet implementation yourself. */
-  protected DocIdSet finalResult(OpenBitSetDISI result, int maxDocs) {
-    return (result.cardinality() < (maxDocs / 9))
-      ? (DocIdSet) new SortedVIntList(result)
-      : (DocIdSet) result;
+   * switch to a different DocIdSet implementation yourself.
+   * This method will be removed in Lucene 4.0 
+   */
+  protected final DocIdSet finalResult(OpenBitSetDISI result, int maxDocs) {
+    return result;
   }
 
   /**

Modified: lucene/java/trunk/contrib/spatial/src/java/org/apache/lucene/spatial/geometry/shape/DistanceApproximation.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/spatial/src/java/org/apache/lucene/spatial/geometry/shape/DistanceApproximation.java?rev=834707&r1=834706&r2=834707&view=diff
==============================================================================
--- lucene/java/trunk/contrib/spatial/src/java/org/apache/lucene/spatial/geometry/shape/DistanceApproximation.java
(original)
+++ lucene/java/trunk/contrib/spatial/src/java/org/apache/lucene/spatial/geometry/shape/DistanceApproximation.java
Tue Nov 10 23:22:48 2009
@@ -25,7 +25,7 @@
  * release.</font>
  *
  * @deprecated This has been replaced with more accurate
- * math in {@link LLRect}.
+ * math in {@link LLRect}. This class will be removed in a future release.
  */
 public class DistanceApproximation
 {



Mime
View raw message