Updates to the facet test.
Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/ae1f96c0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/ae1f96c0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/ae1f96c0 Branch: refs/heads/master Commit: ae1f96c04a02e3cf680ef6b8503bc964f9d51795 Parents: b13761e Author: Aaron McCurry <[email protected]> Authored: Fri Jan 10 09:15:34 2014 -0500 Committer: Aaron McCurry <[email protected]> Committed: Wed Jan 15 17:02:15 2014 -0500 ---------------------------------------------------------------------- .../org/apache/blur/lucene/search/FacetQueryTest.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/ae1f96c0/blur-query/src/test/java/org/apache/blur/lucene/search/FacetQueryTest.java ---------------------------------------------------------------------- diff --git a/blur-query/src/test/java/org/apache/blur/lucene/search/FacetQueryTest.java b/blur-query/src/test/java/org/apache/blur/lucene/search/FacetQueryTest.java index 45d7354..e098e62 100644 --- a/blur-query/src/test/java/org/apache/blur/lucene/search/FacetQueryTest.java +++ b/blur-query/src/test/java/org/apache/blur/lucene/search/FacetQueryTest.java @@ -26,6 +26,7 @@ import java.io.IOException; import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; +import org.apache.blur.BlurConfiguration; import org.apache.blur.concurrent.Executors; import org.apache.blur.trace.LogTraceStorage; import org.apache.blur.trace.Trace; @@ -73,7 +74,7 @@ public class FacetQueryTest { IndexSearcher indexSearcher = new IndexSearcher(reader); indexSearcher.search(facetQuery, 10); - ExecutorService executor = getThreadPool(); + ExecutorService executor = getThreadPool(10); facetExecutor.processFacets(executor); executor.shutdown(); executor.awaitTermination(10, TimeUnit.SECONDS); @@ -85,7 +86,8 @@ public class FacetQueryTest { @Test public void testFacetQueryPerformance() throws IOException, InterruptedException { - Trace.setStorage(new LogTraceStorage(null)); + BlurConfiguration configuration = new BlurConfiguration(); + Trace.setStorage(new LogTraceStorage(configuration)); int facetCount = 200; int docCount = 1000000; IndexReader reader = createIndex(docCount, facetCount, false); @@ -98,7 +100,7 @@ public class FacetQueryTest { ExecutorService executor = null; try { for (int t = 0; t < 5; t++) { - executor = getThreadPool(); + executor = getThreadPool(20); IndexSearcher indexSearcher = new IndexSearcher(reader, executor); FacetExecutor facetExecutor = new FacetExecutor(facets.length); FacetQuery facetQuery = new FacetQuery(new TermQuery(new Term("f1", "value")), facets, facetExecutor); @@ -145,7 +147,7 @@ public class FacetQueryTest { ExecutorService executor = null; try { for (int t = 0; t < 5; t++) { - executor = getThreadPool(); + executor = getThreadPool(10); IndexSearcher indexSearcher = new IndexSearcher(reader, executor); FacetExecutor facetExecutor = new FacetExecutor(facets.length, minimumsBeforeReturning); FacetQuery facetQuery = new FacetQuery(new TermQuery(new Term("f1", "value")), facets, facetExecutor); @@ -167,8 +169,8 @@ public class FacetQueryTest { } } - private ExecutorService getThreadPool() { - return Executors.newThreadPool("unittest-facets", 10); + private ExecutorService getThreadPool(int threads) { + return Executors.newThreadPool("unittest-facets", threads); } private IndexReader createIndex(int docCount, int facetFields, boolean ram) throws CorruptIndexException,
