@@ -145,24 +145,14 @@ public long blockSize() {
145
145
}
146
146
147
147
/**
148
- * Filters are stored in rocksdb and are consulted automatically
149
- * by rocksdb to decide whether or not to read some
150
- * information from disk. In many cases, a filter can cut down the
151
- * number of disk seeks form a handful to a single disk seek per
152
- * DB::Get() call.
153
- *
154
- * This function a new filter policy that uses a bloom filter
155
- * with approximately the specified number of bits per key.
156
- * A good value for bitsPerKey is 10, which yields a filter
157
- * with ~ 1% false positive rate.
158
- *
159
- * @param Bits per key for bloom filter.
148
+ * Use the specified filter policy to reduce disk reads.
149
+ * @param Filter policy java instance.
160
150
* @return the instance of the current Options.
161
151
* @see RocksDB.open()
162
152
*/
163
- public Options createBloomFilter ( int bitsPerKey ) {
153
+ public Options setFilter ( Filter filter ) {
164
154
assert (isInitialized ());
165
- createBloomFilter0 (nativeHandle_ , bitsPerKey );
155
+ setFilter0 (nativeHandle_ , filter . getNativeHandle () );
166
156
return this ;
167
157
}
168
158
@@ -1260,7 +1250,7 @@ private native void setMaxBackgroundCompactions(
1260
1250
private native void useFixedLengthPrefixExtractor (
1261
1251
long handle , int prefixLength );
1262
1252
1263
- private native void createBloomFilter0 (long handle , int bitsPerKey );
1253
+ private native void setFilter0 (long optHandle , long fpHandle );
1264
1254
1265
1255
long nativeHandle_ ;
1266
1256
long cacheSize_ ;
0 commit comments