You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2016/11/15 16:06:00 UTC

lucene-solr:master: SOLR-9284: Reduce off heap cache size and fix test asserts.

Repository: lucene-solr
Updated Branches:
  refs/heads/master 212b1d846 -> 358c16462


SOLR-9284: Reduce off heap cache size and fix test asserts.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/358c1646
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/358c1646
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/358c1646

Branch: refs/heads/master
Commit: 358c164620f774820bd22278fcf425c599a254b2
Parents: 212b1d8
Author: markrmiller <ma...@apache.org>
Authored: Tue Nov 15 11:05:20 2016 -0500
Committer: markrmiller <ma...@apache.org>
Committed: Tue Nov 15 11:05:41 2016 -0500

----------------------------------------------------------------------
 .../solr/store/blockcache/BlockDirectoryTest.java     | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/358c1646/solr/core/src/test/org/apache/solr/store/blockcache/BlockDirectoryTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/store/blockcache/BlockDirectoryTest.java b/solr/core/src/test/org/apache/solr/store/blockcache/BlockDirectoryTest.java
index f21b5aa..5e4f1c5 100644
--- a/solr/core/src/test/org/apache/solr/store/blockcache/BlockDirectoryTest.java
+++ b/solr/core/src/test/org/apache/solr/store/blockcache/BlockDirectoryTest.java
@@ -115,7 +115,7 @@ public class BlockDirectoryTest extends SolrTestCaseJ4 {
       Metrics metrics = new Metrics();
       int blockSize = 8192;
       int slabSize = blockSize * 32768;
-      long totalMemory = 2 * slabSize;
+      long totalMemory = 1 * slabSize;
       BlockCache blockCache = new BlockCache(metrics, true, totalMemory, slabSize, blockSize);
       BlockDirectoryCache cache = new BlockDirectoryCache(blockCache, "/collection1", metrics, true);
       directory = new BlockDirectory("test", dir, cache, null, true, false);
@@ -267,7 +267,11 @@ public class BlockDirectoryTest extends SolrTestCaseJ4 {
 
     BlockDirectory d = directory;
     assertTrue(d.useReadCache("", IOContext.DEFAULT));
-    assertTrue(d.useWriteCache("", IOContext.DEFAULT));
+    if (d.getCache() instanceof MapperCache) {
+      assertTrue(d.useWriteCache("", IOContext.DEFAULT));
+    } else {
+      assertFalse(d.useWriteCache("", IOContext.DEFAULT));
+    }
     assertFalse(d.useWriteCache("", mergeContext));
 
     d = new BlockDirectory("test", directory, mapperCache, null, true, false);
@@ -277,7 +281,11 @@ public class BlockDirectoryTest extends SolrTestCaseJ4 {
 
     d = new BlockDirectory("test", directory, mapperCache, null, false, true);
     assertFalse(d.useReadCache("", IOContext.DEFAULT));
-    assertTrue(d.useWriteCache("", IOContext.DEFAULT));
+    if (d.getCache() instanceof MapperCache) {
+      assertTrue(d.useWriteCache("", IOContext.DEFAULT));
+    } else {
+      assertFalse(d.useWriteCache("", IOContext.DEFAULT));
+    }
     assertFalse(d.useWriteCache("", mergeContext));
   }
 }