You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ds...@apache.org on 2014/07/23 06:43:35 UTC
svn commit: r1612765 - in /lucene/dev/trunk/lucene: ./ benchmark/
benchmark/conf/ benchmark/src/java/org/apache/lucene/benchmark/byTask/
benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/
Author: dsmiley
Date: Wed Jul 23 04:43:34 2014
New Revision: 1612765
URL: http://svn.apache.org/r1612765
Log:
LUCENE-5825: new benchmark codec.postingsFormat option
Modified:
lucene/dev/trunk/lucene/CHANGES.txt
lucene/dev/trunk/lucene/benchmark/build.xml
lucene/dev/trunk/lucene/benchmark/conf/spatial.alg
lucene/dev/trunk/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/package.html
lucene/dev/trunk/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.java
Modified: lucene/dev/trunk/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/CHANGES.txt?rev=1612765&r1=1612764&r2=1612765&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/CHANGES.txt (original)
+++ lucene/dev/trunk/lucene/CHANGES.txt Wed Jul 23 04:43:34 2014
@@ -125,6 +125,9 @@ New Features
McCandless)
* LUCENE-5835: TermValComparator can sort missing values last. (Adrien Grand)
+
+* LUCENE-5825: Benchmark module can use custom postings format, e.g.:
+ codec.postingsFormat=Memory (Varun Shenoy, David Smiley)
API Changes
Modified: lucene/dev/trunk/lucene/benchmark/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/benchmark/build.xml?rev=1612765&r1=1612764&r2=1612765&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/benchmark/build.xml (original)
+++ lucene/dev/trunk/lucene/benchmark/build.xml Wed Jul 23 04:43:34 2014
@@ -173,6 +173,7 @@
<pathelement path="${facet.jar}"/>
<pathelement path="${spatial.jar}"/>
<pathelement path="${queries.jar}"/>
+ <pathelement path="${codecs.jar}"/>
<path refid="base.classpath"/>
<fileset dir="lib"/>
</path>
@@ -274,7 +275,7 @@
<echo>Benchmark output in JIRA table format is in file: ${shingle.jira.output.file}</echo>
</target>
- <target name="init" depends="module-build.init,jar-memory,jar-highlighter,jar-analyzers-common,jar-queryparser,jar-facet,jar-spatial"/>
+ <target name="init" depends="module-build.init,jar-memory,jar-highlighter,jar-analyzers-common,jar-queryparser,jar-facet,jar-spatial,jar-codecs"/>
<target name="compile-test" depends="copy-alg-files-for-testing,module-build.compile-test"/>
<target name="copy-alg-files-for-testing" description="copy .alg files as resources for testing">
Modified: lucene/dev/trunk/lucene/benchmark/conf/spatial.alg
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/benchmark/conf/spatial.alg?rev=1612765&r1=1612764&r2=1612765&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/benchmark/conf/spatial.alg (original)
+++ lucene/dev/trunk/lucene/benchmark/conf/spatial.alg Wed Jul 23 04:43:34 2014
@@ -29,12 +29,14 @@ doc.maker=org.apache.lucene.benchmark.by
#spatial.worldBounds=...
# Spatial Grid: (PrefixTree) see SpatialPrefixTreeFactory.makeSPT
#spatial.prefixTree=geohash (or quad)
+spatial.prefixTree=quad
#spatial.maxLevels=11
#spatial.maxDistErr (in degrees) to compute maxLevels -- defaults to 1 meter's worth
# RecursivePrefixTreeStrategy:
spatial.docPointsOnly=true
#spatial.distErrPct=.25
#spatial.prefixGridScanLevel=-4
+#codec.postingsFormat=Memory or (Direct)
### Source & Doc
content.source=org.apache.lucene.benchmark.byTask.feeds.LineDocSource
Modified: lucene/dev/trunk/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/package.html
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/package.html?rev=1612765&r1=1612764&r2=1612765&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/package.html (original)
+++ lucene/dev/trunk/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/package.html Wed Jul 23 04:43:34 2014
@@ -587,6 +587,7 @@ Here is a list of currently defined prop
</li><li>max.buffered
</li><li>directory
</li><li>ram.flush.mb
+ </li><li>codec.postingsFormat (eg Direct) Note: no codec should be specified through default.codec
</li></ul>
</li>
Modified: lucene/dev/trunk/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.java?rev=1612765&r1=1612764&r2=1612765&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.java (original)
+++ lucene/dev/trunk/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.java Wed Jul 23 04:43:34 2014
@@ -20,6 +20,8 @@ package org.apache.lucene.benchmark.byTa
import org.apache.lucene.benchmark.byTask.PerfRunData;
import org.apache.lucene.benchmark.byTask.utils.Config;
import org.apache.lucene.codecs.Codec;
+import org.apache.lucene.codecs.PostingsFormat;
+import org.apache.lucene.codecs.lucene49.Lucene49Codec;
import org.apache.lucene.index.ConcurrentMergeScheduler;
import org.apache.lucene.index.IndexCommit;
import org.apache.lucene.index.IndexDeletionPolicy;
@@ -135,6 +137,21 @@ public class CreateIndexTask extends Per
}
}
+ final String postingsFormat = config.get("codec.postingsFormat",null);
+ if (defaultCodec == null && postingsFormat != null) {
+ try {
+ final PostingsFormat postingsFormatChosen = PostingsFormat.forName(postingsFormat);
+ iwConf.setCodec(new Lucene49Codec(){
+ @Override
+ public PostingsFormat getPostingsFormatForField(String field) {
+ return postingsFormatChosen;
+ }
+ });
+ } catch (Exception e) {
+ throw new RuntimeException("Couldn't instantiate Postings Format: " + postingsFormat, e);
+ }
+ }
+
final String mergePolicy = config.get("merge.policy",
"org.apache.lucene.index.LogByteSizeMergePolicy");
boolean isCompound = config.get("compound", true);