mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
git-subtree-dir: src/rocksdb2 git-subtree-split: 37c6740c383bb9a6ee2747b04f08bc77fcfa10c5
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_;
|
|
}
|