mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
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
41 lines
1.0 KiB
Java
41 lines
1.0 KiB
Java
package org.rocksdb;
|
|
|
|
/**
|
|
* The config for vector memtable representation.
|
|
*/
|
|
public class VectorMemTableConfig extends MemTableConfig {
|
|
public static final int DEFAULT_RESERVED_SIZE = 0;
|
|
public VectorMemTableConfig() {
|
|
reservedSize_ = DEFAULT_RESERVED_SIZE;
|
|
}
|
|
|
|
/**
|
|
* Set the initial size of the vector that will be used
|
|
* by the memtable created based on this config.
|
|
*
|
|
* @param size the initial size of the vector.
|
|
* @return the reference to the current config.
|
|
*/
|
|
public VectorMemTableConfig setReservedSize(int size) {
|
|
reservedSize_ = size;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Returns the initial size of the vector used by the memtable
|
|
* created based on this config.
|
|
*
|
|
* @return the initial size of the vector.
|
|
*/
|
|
public int reservedSize() {
|
|
return reservedSize_;
|
|
}
|
|
|
|
@Override protected long newMemTableFactoryHandle() {
|
|
return newMemTableFactoryHandle(reservedSize_);
|
|
}
|
|
|
|
private native long newMemTableFactoryHandle(long reservedSize);
|
|
private int reservedSize_;
|
|
}
|