mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-27 20:43:57 +00:00
ef8b8a8ef6
Summary: Add Java bindings for memtables and sst format. Specifically, add two abstract Java classses --- MemTableConfig and SstFormatConfig. Each MemTable / SST implementation should has its own config class extends MemTableConfig / SstFormatConfig respectively and pass it to Options via setMemTableConfig / setSstConfig. Test Plan: make rocksdbjava make jdb_test make jdb_bench java/jdb_bench.sh \ --benchmarks=fillseq,readrandom,readwhilewriting \ --memtablerep=hash_skiplist \ --use_plain_table=1 \ --key_size=20 \ --prefix_size=12 \ --value_size=100 \ --cache_size=17179869184 \ --disable_wal=0 \ --sync=0 \ Reviewers: haobo, ankgup87, sdong Reviewed By: haobo CC: leveldb, dhruba Differential Revision: https://reviews.facebook.net/D17997
26 lines
1 KiB
C++
26 lines
1 KiB
C++
// Copyright (c) 2014, Facebook, Inc. All rights reserved.
|
|
// This source code is licensed under the BSD-style license found in the
|
|
// LICENSE file in the root directory of this source tree. An additional grant
|
|
// of patent rights can be found in the PATENTS file in the same directory.
|
|
//
|
|
// This file implements the "bridge" between Java and C++ for rocksdb::Options.
|
|
|
|
#include <jni.h>
|
|
#include "include/org_rocksdb_PlainTableConfig.h"
|
|
#include "rocksdb/table.h"
|
|
|
|
/*
|
|
* Class: org_rocksdb_PlainTableConfig
|
|
* Method: newTableFactoryHandle
|
|
* Signature: (IIDI)J
|
|
*/
|
|
jlong Java_org_rocksdb_PlainTableConfig_newTableFactoryHandle(
|
|
JNIEnv* env, jobject jobj, jint jkey_size, jint jbloom_bits_per_key,
|
|
jdouble jhash_table_ratio, jint jindex_sparseness) {
|
|
return reinterpret_cast<jlong>(rocksdb::NewPlainTableFactory(
|
|
static_cast<uint32_t>(jkey_size),
|
|
static_cast<int>(jbloom_bits_per_key),
|
|
static_cast<double>(jhash_table_ratio),
|
|
static_cast<size_t>(jindex_sparseness)));
|
|
}
|