|
|
|
@ -24,9 +24,12 @@ |
|
|
|
|
void Java_org_rocksdb_BloomFilter_createNewBloomFilter( |
|
|
|
|
JNIEnv* env, jobject jobj, jint bits_per_key, |
|
|
|
|
jboolean use_block_base_builder) { |
|
|
|
|
const rocksdb::FilterPolicy* fp = rocksdb::NewBloomFilterPolicy(bits_per_key, |
|
|
|
|
use_block_base_builder); |
|
|
|
|
rocksdb::FilterJni::setHandle(env, jobj, fp); |
|
|
|
|
rocksdb::FilterPolicy* fp = const_cast<rocksdb::FilterPolicy *>( |
|
|
|
|
rocksdb::NewBloomFilterPolicy(bits_per_key, use_block_base_builder)); |
|
|
|
|
std::shared_ptr<rocksdb::FilterPolicy> *pFilterPolicy = |
|
|
|
|
new std::shared_ptr<rocksdb::FilterPolicy>; |
|
|
|
|
*pFilterPolicy = std::shared_ptr<rocksdb::FilterPolicy>(fp); |
|
|
|
|
rocksdb::FilterJni::setHandle(env, jobj, pFilterPolicy); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -35,6 +38,9 @@ void Java_org_rocksdb_BloomFilter_createNewBloomFilter( |
|
|
|
|
* Signature: (J)V |
|
|
|
|
*/ |
|
|
|
|
void Java_org_rocksdb_Filter_disposeInternal( |
|
|
|
|
JNIEnv* env, jobject jobj, jlong handle) { |
|
|
|
|
delete reinterpret_cast<rocksdb::FilterPolicy*>(handle); |
|
|
|
|
JNIEnv* env, jobject jobj, jlong jhandle) { |
|
|
|
|
|
|
|
|
|
std::shared_ptr<rocksdb::FilterPolicy> *handle = |
|
|
|
|
reinterpret_cast<std::shared_ptr<rocksdb::FilterPolicy> *>(jhandle); |
|
|
|
|
handle->reset(); |
|
|
|
|
} |
|
|
|
|