mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Squashed 'src/rocksdb2/' content from commit 37c6740
git-subtree-dir: src/rocksdb2 git-subtree-split: 37c6740c383bb9a6ee2747b04f08bc77fcfa10c5
This commit is contained in:
40
java/org/rocksdb/VectorMemTableConfig.java
Normal file
40
java/org/rocksdb/VectorMemTableConfig.java
Normal file
@@ -0,0 +1,40 @@
|
||||
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_;
|
||||
}
|
||||
Reference in New Issue
Block a user