From 7a5106fbeabbb30be8e4f4a3a21d610dea64e418 Mon Sep 17 00:00:00 2001 From: Ankit Gupta Date: Tue, 22 Apr 2014 09:01:57 -0700 Subject: [PATCH] Add doc --- java/org/rocksdb/BloomFilter.java | 14 ++++++++++++++ java/org/rocksdb/Filter.java | 5 ----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/java/org/rocksdb/BloomFilter.java b/java/org/rocksdb/BloomFilter.java index a1cd4a9ce..f0f935a20 100644 --- a/java/org/rocksdb/BloomFilter.java +++ b/java/org/rocksdb/BloomFilter.java @@ -5,12 +5,26 @@ package org.rocksdb; +/** + * This class creates a new filter policy that uses a bloom filter + * with approximately the specified number of bits per key. + * A good value for bitsPerKey is 10, which yields a filter + * with ~ 1% false positive rate. + * + * Default value of bits per key is 10. + */ public class BloomFilter extends Filter { + private static final int DEFAULT_BITS_PER_KEY = 10; private final int bitsPerKey_; + + public BloomFilter() { + this(DEFAULT_BITS_PER_KEY); + } public BloomFilter(int bitsPerKey) { super(); bitsPerKey_ = bitsPerKey; + createNewFilter(); } diff --git a/java/org/rocksdb/Filter.java b/java/org/rocksdb/Filter.java index de7049a4d..186822abd 100644 --- a/java/org/rocksdb/Filter.java +++ b/java/org/rocksdb/Filter.java @@ -11,11 +11,6 @@ package org.rocksdb; * information from disk. In many cases, a filter can cut down the * number of disk seeks form a handful to a single disk seek per * DB::Get() call. - * - * This class creates a new filter policy that uses a bloom filter - * with approximately the specified number of bits per key. - * A good value for bitsPerKey is 10, which yields a filter - * with ~ 1% false positive rate. */ public abstract class Filter { protected long nativeHandle_ = 0;