kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bbej...@apache.org
Subject [kafka] branch 2.2 updated: Moved initialization of bloom filter (#6734)
Date Wed, 15 May 2019 02:55:57 GMT
This is an automated email from the ASF dual-hosted git repository.

bbejeck pushed a commit to branch 2.2
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/2.2 by this push:
     new bb3c61b  Moved initialization of bloom filter (#6734)
bb3c61b is described below

commit bb3c61b3553beed0d4496f0c9f0cfc75c3cc7dc6
Author: A. Sophie Blee-Goldman <sophie@confluent.io>
AuthorDate: Tue May 14 19:55:45 2019 -0700

    Moved initialization of bloom filter (#6734)
    
    Bug-fix that moves the initialization of the Bloom Filter Rocks object out of the @before
test setup method. Don't use KIP-453 so we can apply to previous versions
    
    Reviewers: Bill Bejeck <bbejeck@gmail.com>
---
 .../org/apache/kafka/streams/state/internals/RocksDBStoreTest.java  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/streams/src/test/java/org/apache/kafka/streams/state/internals/RocksDBStoreTest.java
b/streams/src/test/java/org/apache/kafka/streams/state/internals/RocksDBStoreTest.java
index 3cc1697..878f0db 100644
--- a/streams/src/test/java/org/apache/kafka/streams/state/internals/RocksDBStoreTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/state/internals/RocksDBStoreTest.java
@@ -79,7 +79,6 @@ public class RocksDBStoreTest {
             Serdes.String(),
             Serdes.String(),
             new StreamsConfig(props));
-        filter = new BloomFilter();
     }
 
     RocksDBStore getRocksDBStore() {
@@ -88,7 +87,9 @@ public class RocksDBStoreTest {
 
     @After
     public void tearDown() {
-        filter.close();
+        if (filter != null) {
+            filter.close();
+        }
         rocksDBStore.close();
     }
 
@@ -498,6 +499,7 @@ public class RocksDBStoreTest {
             tableConfig.setBlockCacheSize(50 * 1024 * 1024L);
             tableConfig.setBlockSize(4096L);
             if (enableBloomFilters) {
+                filter = new BloomFilter();
                 tableConfig.setFilter(filter);
                 options.optimizeFiltersForHits();
                 bloomFiltersSet = true;


Mime
View raw message