incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject git commit: Forgot to add the fixed unit test.
Date Sun, 03 Mar 2013 19:43:49 GMT
Updated Branches:
  refs/heads/0.2-dev 1373ccec0 -> 6723b7ffa


Forgot to add the fixed unit 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/6723b7ff
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/6723b7ff
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/6723b7ff

Branch: refs/heads/0.2-dev
Commit: 6723b7ffa328e8bf882a9baa913a4636f88b6c32
Parents: 1373cce
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Sun Mar 3 14:43:26 2013 -0500
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Sun Mar 3 14:43:26 2013 -0500

----------------------------------------------------------------------
 .../blur/manager/writer/BlurNRTIndexTest.java      |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/6723b7ff/src/blur-core/src/test/java/org/apache/blur/manager/writer/BlurNRTIndexTest.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/test/java/org/apache/blur/manager/writer/BlurNRTIndexTest.java
b/src/blur-core/src/test/java/org/apache/blur/manager/writer/BlurNRTIndexTest.java
index c711fcf..0cb0df1 100644
--- a/src/blur-core/src/test/java/org/apache/blur/manager/writer/BlurNRTIndexTest.java
+++ b/src/blur-core/src/test/java/org/apache/blur/manager/writer/BlurNRTIndexTest.java
@@ -31,6 +31,7 @@ import java.util.concurrent.ExecutorService;
 
 import org.apache.blur.analysis.BlurAnalyzer;
 import org.apache.blur.concurrent.Executors;
+import org.apache.blur.server.IndexSearcherClosable;
 import org.apache.blur.server.ShardContext;
 import org.apache.blur.server.TableContext;
 import org.apache.blur.server.TypeManager;
@@ -84,7 +85,6 @@ public class BlurNRTIndexTest {
   private void setupWriter(Configuration configuration, BlurAnalyzer analyzer, long refresh)
throws IOException {
     writer = new BlurNRTIndex();
     writer.setDirectory(FSDirectory.open(new File(base, "index")));
-    writer.setCloser(closer);
     TableDescriptor tableDescriptor = new TableDescriptor();
     tableDescriptor.setStoragePath(new File(base, "index").toURI().toString());
     tableDescriptor.setName("testing-table");
@@ -155,16 +155,20 @@ public class BlurNRTIndexTest {
     int total = 0;
     for (int i = 0; i < TEST_NUMBER_WAIT_VISIBLE; i++) {
       writer.addDocuments(true, true, getDocs(1));
-      IndexReader reader = writer.getIndexReader();
+      IndexSearcherClosable indexSearcherClosable = writer.getIndexReader();
+      IndexReader reader = indexSearcherClosable.getIndexReader();
       assertEquals(i + 1, reader.numDocs());
+      indexSearcherClosable.close();
       total++;
     }
     long e = System.nanoTime();
     double seconds = (e - s) / 1000000000.0;
     double rate = total / seconds;
     System.out.println("Rate " + rate);
-    IndexReader reader = writer.getIndexReader();
+    IndexSearcherClosable indexSearcherClosable = writer.getIndexReader();
+    IndexReader reader = indexSearcherClosable.getIndexReader();
     assertEquals(TEST_NUMBER_WAIT_VISIBLE, reader.numDocs());
+    indexSearcherClosable.close();
   }
 
   @Test
@@ -182,9 +186,10 @@ public class BlurNRTIndexTest {
     double seconds = (e - s) / 1000000000.0;
     double rate = total / seconds;
     System.out.println("Rate " + rate);
-    IndexReader reader = writer.getIndexReader();
+    IndexSearcherClosable indexSearcherClosable = writer.getIndexReader();
+    IndexReader reader = indexSearcherClosable.getIndexReader();
     assertEquals(TEST_NUMBER, reader.numDocs());
-    reader.decRef();
+    indexSearcherClosable.close();
   }
 
   private List<Document> getDocs(int count) {


Mime
View raw message