|
|
|
@ -7,10 +7,10 @@ package org.rocksdb; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Options to control the behavior of a database. It will be used |
|
|
|
|
* during the creation of a RocksDB (i.e., RocksDB.open()). |
|
|
|
|
* during the creation of a {@link org.rocksdb.RocksDB} (i.e., RocksDB.open()). |
|
|
|
|
* |
|
|
|
|
* If dispose() function is not called, then it will be GC'd automatically and |
|
|
|
|
* native resources will be released as part of the process. |
|
|
|
|
* If {@link #dispose()} function is not called, then it will be GC'd automatically |
|
|
|
|
* and native resources will be released as part of the process. |
|
|
|
|
*/ |
|
|
|
|
public class Options extends RocksObject { |
|
|
|
|
static { |
|
|
|
@ -30,7 +30,7 @@ public class Options extends RocksObject { |
|
|
|
|
* Construct options for opening a RocksDB. |
|
|
|
|
* |
|
|
|
|
* This constructor will create (by allocating a block of memory) |
|
|
|
|
* an rocksdb::Options in the c++ side. |
|
|
|
|
* an {@code rocksdb::Options} in the c++ side. |
|
|
|
|
*/ |
|
|
|
|
public Options() { |
|
|
|
|
super(); |
|
|
|
@ -42,13 +42,14 @@ public class Options extends RocksObject { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* If this value is set to true, then the database will be created |
|
|
|
|
* if it is missing during RocksDB.open(). |
|
|
|
|
* if it is missing during {@code RocksDB.open()}. |
|
|
|
|
* Default: false |
|
|
|
|
* |
|
|
|
|
* @param flag a flag indicating whether to create a database the |
|
|
|
|
* specified database in RocksDB.open() operation is missing. |
|
|
|
|
* @return the instance of the current Options. |
|
|
|
|
* @see RocksDB.open() |
|
|
|
|
* specified database in {@link org.rocksdb.RocksDB#open(Options, String)} operation |
|
|
|
|
* is missing. |
|
|
|
|
* @return the instance of the current Options |
|
|
|
|
* @see org.rocksdb.RocksDB#open(Options, String) |
|
|
|
|
*/ |
|
|
|
|
public Options setCreateIfMissing(boolean flag) { |
|
|
|
|
assert(isInitialized()); |
|
|
|
@ -59,7 +60,7 @@ public class Options extends RocksObject { |
|
|
|
|
/** |
|
|
|
|
* Use the specified object to interact with the environment, |
|
|
|
|
* e.g. to read/write files, schedule background work, etc. |
|
|
|
|
* Default: RocksEnv.getDefault() |
|
|
|
|
* Default: {@link RocksEnv#getDefault()} |
|
|
|
|
*/ |
|
|
|
|
public Options setEnv(RocksEnv env) { |
|
|
|
|
assert(isInitialized()); |
|
|
|
@ -79,7 +80,7 @@ public class Options extends RocksObject { |
|
|
|
|
* If true, the database will be created if it is missing. |
|
|
|
|
* |
|
|
|
|
* @return true if the createIfMissing option is set to true. |
|
|
|
|
* @see setCreateIfMissing() |
|
|
|
|
* @see #setCreateIfMissing(boolean) |
|
|
|
|
*/ |
|
|
|
|
public boolean createIfMissing() { |
|
|
|
|
assert(isInitialized()); |
|
|
|
@ -87,12 +88,12 @@ public class Options extends RocksObject { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Set BuiltinComparator to be used with RocksDB. |
|
|
|
|
* Set {@link org.rocksdb.Options.BuiltinComparator} to be used with RocksDB. |
|
|
|
|
* |
|
|
|
|
* Note: Comparator can be set once upon database creation. |
|
|
|
|
* |
|
|
|
|
* Default: BytewiseComparator. |
|
|
|
|
* @param builtinComparator a BuiltinComparator type. |
|
|
|
|
* @param builtinComparator a {@link org.rocksdb.Options.BuiltinComparator} type. |
|
|
|
|
*/ |
|
|
|
|
public void setBuiltinComparator(BuiltinComparator builtinComparator) { |
|
|
|
|
assert(isInitialized()); |
|
|
|
@ -106,7 +107,7 @@ public class Options extends RocksObject { |
|
|
|
|
* on disk) before converting to a sorted on-disk file. |
|
|
|
|
* |
|
|
|
|
* Larger values increase performance, especially during bulk loads. |
|
|
|
|
* Up to max_write_buffer_number write buffers may be held in memory |
|
|
|
|
* Up to {@code max_write_buffer_number} write buffers may be held in memory |
|
|
|
|
* at the same time, so you may wish to adjust this parameter |
|
|
|
|
* to control memory usage. |
|
|
|
|
* |
|
|
|
@ -116,7 +117,7 @@ public class Options extends RocksObject { |
|
|
|
|
* Default: 4MB |
|
|
|
|
* @param writeBufferSize the size of write buffer. |
|
|
|
|
* @return the instance of the current Options. |
|
|
|
|
* @see RocksDB.open() |
|
|
|
|
* @see org.rocksdb.RocksDB#open(Options, String) |
|
|
|
|
*/ |
|
|
|
|
public Options setWriteBufferSize(long writeBufferSize) { |
|
|
|
|
assert(isInitialized()); |
|
|
|
@ -128,7 +129,7 @@ public class Options extends RocksObject { |
|
|
|
|
* Return size of write buffer size. |
|
|
|
|
* |
|
|
|
|
* @return size of write buffer. |
|
|
|
|
* @see setWriteBufferSize() |
|
|
|
|
* @see #setWriteBufferSize(long) |
|
|
|
|
*/ |
|
|
|
|
public long writeBufferSize() { |
|
|
|
|
assert(isInitialized()); |
|
|
|
@ -143,7 +144,7 @@ public class Options extends RocksObject { |
|
|
|
|
* |
|
|
|
|
* @param maxWriteBufferNumber maximum number of write buffers. |
|
|
|
|
* @return the instance of the current Options. |
|
|
|
|
* @see RocksDB.open() |
|
|
|
|
* @see org.rocksdb.RocksDB#open(Options, String) |
|
|
|
|
*/ |
|
|
|
|
public Options setMaxWriteBufferNumber(int maxWriteBufferNumber) { |
|
|
|
|
assert(isInitialized()); |
|
|
|
@ -155,7 +156,7 @@ public class Options extends RocksObject { |
|
|
|
|
* Returns maximum number of write buffers. |
|
|
|
|
* |
|
|
|
|
* @return maximum number of write buffers. |
|
|
|
|
* @see setMaxWriteBufferNumber() |
|
|
|
|
* @see #setMaxWriteBufferNumber(int) |
|
|
|
|
*/ |
|
|
|
|
public int maxWriteBufferNumber() { |
|
|
|
|
assert(isInitialized()); |
|
|
|
@ -181,9 +182,9 @@ public class Options extends RocksObject { |
|
|
|
|
* Default: false |
|
|
|
|
* |
|
|
|
|
* @param errorIfExists if true, an exception will be thrown |
|
|
|
|
* during RocksDB.open() if the database already exists. |
|
|
|
|
* during {@code RocksDB.open()} if the database already exists. |
|
|
|
|
* @return the reference to the current option. |
|
|
|
|
* @see RocksDB.open() |
|
|
|
|
* @see org.rocksdb.RocksDB#open(Options, String) |
|
|
|
|
*/ |
|
|
|
|
public Options setErrorIfExists(boolean errorIfExists) { |
|
|
|
|
assert(isInitialized()); |
|
|
|
@ -237,8 +238,9 @@ public class Options extends RocksObject { |
|
|
|
|
* Number of open files that can be used by the DB. You may need to |
|
|
|
|
* increase this if your database has a large working set. Value -1 means |
|
|
|
|
* files opened are always kept open. You can estimate number of files based |
|
|
|
|
* on target_file_size_base and target_file_size_multiplier for level-based |
|
|
|
|
* compaction. For universal-style compaction, you can usually set it to -1. |
|
|
|
|
* on {@code target_file_size_base} and {@code target_file_size_multiplier} |
|
|
|
|
* for level-based compaction. For universal-style compaction, you can usually |
|
|
|
|
* set it to -1. |
|
|
|
|
* |
|
|
|
|
* @return the maximum number of open files. |
|
|
|
|
*/ |
|
|
|
@ -252,8 +254,9 @@ public class Options extends RocksObject { |
|
|
|
|
* Number of open files that can be used by the DB. You may need to |
|
|
|
|
* increase this if your database has a large working set. Value -1 means |
|
|
|
|
* files opened are always kept open. You can estimate number of files based |
|
|
|
|
* on target_file_size_base and target_file_size_multiplier for level-based |
|
|
|
|
* compaction. For universal-style compaction, you can usually set it to -1. |
|
|
|
|
* on {@code target_file_size_base} and {@code target_file_size_multiplier} |
|
|
|
|
* for level-based compaction. For universal-style compaction, you can usually |
|
|
|
|
* set it to -1. |
|
|
|
|
* Default: 5000 |
|
|
|
|
* |
|
|
|
|
* @param maxOpenFiles the maximum number of open files. |
|
|
|
@ -271,7 +274,7 @@ public class Options extends RocksObject { |
|
|
|
|
* to stable storage. Their contents remain in the OS buffers till the |
|
|
|
|
* OS decides to flush them. This option is good for bulk-loading |
|
|
|
|
* of data. Once the bulk-loading is complete, please issue a |
|
|
|
|
* sync to the OS to flush all dirty buffesrs to stable storage. |
|
|
|
|
* sync to the OS to flush all dirty buffers to stable storage. |
|
|
|
|
* |
|
|
|
|
* @return if true, then data-sync is disabled. |
|
|
|
|
*/ |
|
|
|
@ -286,7 +289,7 @@ public class Options extends RocksObject { |
|
|
|
|
* to stable storage. Their contents remain in the OS buffers till the |
|
|
|
|
* OS decides to flush them. This option is good for bulk-loading |
|
|
|
|
* of data. Once the bulk-loading is complete, please issue a |
|
|
|
|
* sync to the OS to flush all dirty buffesrs to stable storage. |
|
|
|
|
* sync to the OS to flush all dirty buffers to stable storage. |
|
|
|
|
* Default: false |
|
|
|
|
* |
|
|
|
|
* @param disableDataSync a boolean flag to specify whether to |
|
|
|
@ -306,7 +309,7 @@ public class Options extends RocksObject { |
|
|
|
|
* This parameter should be set to true while storing data to |
|
|
|
|
* filesystem like ext3 that can lose files after a reboot. |
|
|
|
|
* |
|
|
|
|
* @return true if fsync is used. |
|
|
|
|
* @return boolean value indicating if fsync is used. |
|
|
|
|
*/ |
|
|
|
|
public boolean useFsync() { |
|
|
|
|
assert(isInitialized()); |
|
|
|
@ -438,7 +441,8 @@ public class Options extends RocksObject { |
|
|
|
|
* Default: 1 |
|
|
|
|
* |
|
|
|
|
* @return the maximum number of concurrent background compaction jobs. |
|
|
|
|
* @see Env.setBackgroundThreads() |
|
|
|
|
* @see org.rocksdb.RocksEnv#setBackgroundThreads(int) |
|
|
|
|
* @see org.rocksdb.RocksEnv#setBackgroundThreads(int, int) |
|
|
|
|
*/ |
|
|
|
|
public int maxBackgroundCompactions() { |
|
|
|
|
assert(isInitialized()); |
|
|
|
@ -451,7 +455,7 @@ public class Options extends RocksObject { |
|
|
|
|
it does not use any locks to prevent concurrent updates. |
|
|
|
|
* |
|
|
|
|
* @return the instance of the current Options. |
|
|
|
|
* @see RocksDB.open() |
|
|
|
|
* @see org.rocksdb.RocksDB#open(Options, String) |
|
|
|
|
*/ |
|
|
|
|
public Options createStatistics() { |
|
|
|
|
assert(isInitialized()); |
|
|
|
@ -460,11 +464,11 @@ public class Options extends RocksObject { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns statistics object. Calls createStatistics() if |
|
|
|
|
* C++ returns NULL pointer for statistics. |
|
|
|
|
* Returns statistics object. Calls {@link #createStatistics()} if |
|
|
|
|
* C++ returns {@code nullptr} for statistics. |
|
|
|
|
* |
|
|
|
|
* @return the instance of the statistics object. |
|
|
|
|
* @see createStatistics() |
|
|
|
|
* @see #createStatistics() |
|
|
|
|
*/ |
|
|
|
|
public Statistics statisticsPtr() { |
|
|
|
|
assert(isInitialized()); |
|
|
|
@ -489,8 +493,9 @@ public class Options extends RocksObject { |
|
|
|
|
* compaction jobs. |
|
|
|
|
* @return the reference to the current option. |
|
|
|
|
* |
|
|
|
|
* @see Env.setBackgroundThreads() |
|
|
|
|
* @see maxBackgroundFlushes() |
|
|
|
|
* @see org.rocksdb.RocksEnv#setBackgroundThreads(int) |
|
|
|
|
* @see org.rocksdb.RocksEnv#setBackgroundThreads(int, int) |
|
|
|
|
* @see #maxBackgroundFlushes() |
|
|
|
|
*/ |
|
|
|
|
public Options setMaxBackgroundCompactions(int maxBackgroundCompactions) { |
|
|
|
|
assert(isInitialized()); |
|
|
|
@ -505,7 +510,8 @@ public class Options extends RocksObject { |
|
|
|
|
* Default: 1 |
|
|
|
|
* |
|
|
|
|
* @return the maximum number of concurrent background flush jobs. |
|
|
|
|
* @see Env.setBackgroundThreads() |
|
|
|
|
* @see org.rocksdb.RocksEnv#setBackgroundThreads(int) |
|
|
|
|
* @see org.rocksdb.RocksEnv#setBackgroundThreads(int, int) |
|
|
|
|
*/ |
|
|
|
|
public int maxBackgroundFlushes() { |
|
|
|
|
assert(isInitialized()); |
|
|
|
@ -519,11 +525,12 @@ public class Options extends RocksObject { |
|
|
|
|
* HIGH priority thread pool. For more information, see |
|
|
|
|
* Default: 1 |
|
|
|
|
* |
|
|
|
|
* @param maxBackgroundFlushes |
|
|
|
|
* @param maxBackgroundFlushes number of max concurrent flush jobs |
|
|
|
|
* @return the reference to the current option. |
|
|
|
|
* |
|
|
|
|
* @see Env.setBackgroundThreads() |
|
|
|
|
* @see maxBackgroundCompactions() |
|
|
|
|
* @see org.rocksdb.RocksEnv#setBackgroundThreads(int) |
|
|
|
|
* @see org.rocksdb.RocksEnv#setBackgroundThreads(int, int) |
|
|
|
|
* @see #maxBackgroundCompactions() |
|
|
|
|
*/ |
|
|
|
|
public Options setMaxBackgroundFlushes(int maxBackgroundFlushes) { |
|
|
|
|
assert(isInitialized()); |
|
|
|
@ -713,20 +720,22 @@ public class Options extends RocksObject { |
|
|
|
|
/** |
|
|
|
|
* WalTtlSeconds() and walSizeLimitMB() affect how archived logs |
|
|
|
|
* will be deleted. |
|
|
|
|
* 1. If both set to 0, logs will be deleted asap and will not get into |
|
|
|
|
* the archive. |
|
|
|
|
* 2. If WAL_ttl_seconds is 0 and WAL_size_limit_MB is not 0, |
|
|
|
|
* <ol> |
|
|
|
|
* <li>If both set to 0, logs will be deleted asap and will not get into |
|
|
|
|
* the archive.</li> |
|
|
|
|
* <li>If WAL_ttl_seconds is 0 and WAL_size_limit_MB is not 0, |
|
|
|
|
* WAL files will be checked every 10 min and if total size is greater |
|
|
|
|
* then WAL_size_limit_MB, they will be deleted starting with the |
|
|
|
|
* earliest until size_limit is met. All empty files will be deleted. |
|
|
|
|
* 3. If WAL_ttl_seconds is not 0 and WAL_size_limit_MB is 0, then |
|
|
|
|
* earliest until size_limit is met. All empty files will be deleted.</li> |
|
|
|
|
* <li>If WAL_ttl_seconds is not 0 and WAL_size_limit_MB is 0, then |
|
|
|
|
* WAL files will be checked every WAL_ttl_secondsi / 2 and those that |
|
|
|
|
* are older than WAL_ttl_seconds will be deleted. |
|
|
|
|
* 4. If both are not 0, WAL files will be checked every 10 min and both |
|
|
|
|
* checks will be performed with ttl being first. |
|
|
|
|
* are older than WAL_ttl_seconds will be deleted.</li> |
|
|
|
|
* <li>If both are not 0, WAL files will be checked every 10 min and both |
|
|
|
|
* checks will be performed with ttl being first.</li> |
|
|
|
|
* </ol> |
|
|
|
|
* |
|
|
|
|
* @return the wal-ttl seconds |
|
|
|
|
* @see walSizeLimitMB() |
|
|
|
|
* @see #walSizeLimitMB() |
|
|
|
|
*/ |
|
|
|
|
public long walTtlSeconds() { |
|
|
|
|
assert(isInitialized()); |
|
|
|
@ -735,23 +744,24 @@ public class Options extends RocksObject { |
|
|
|
|
private native long walTtlSeconds(long handle); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* WalTtlSeconds() and walSizeLimitMB() affect how archived logs |
|
|
|
|
* {@link #walTtlSeconds()} and {@link #walSizeLimitMB()} affect how archived logs |
|
|
|
|
* will be deleted. |
|
|
|
|
* 1. If both set to 0, logs will be deleted asap and will not get into |
|
|
|
|
* the archive. |
|
|
|
|
* 2. If WAL_ttl_seconds is 0 and WAL_size_limit_MB is not 0, |
|
|
|
|
* <ol> |
|
|
|
|
* <li>If both set to 0, logs will be deleted asap and will not get into |
|
|
|
|
* the archive.</li> |
|
|
|
|
* <li>If WAL_ttl_seconds is 0 and WAL_size_limit_MB is not 0, |
|
|
|
|
* WAL files will be checked every 10 min and if total size is greater |
|
|
|
|
* then WAL_size_limit_MB, they will be deleted starting with the |
|
|
|
|
* earliest until size_limit is met. All empty files will be deleted. |
|
|
|
|
* 3. If WAL_ttl_seconds is not 0 and WAL_size_limit_MB is 0, then |
|
|
|
|
* earliest until size_limit is met. All empty files will be deleted.</li> |
|
|
|
|
* <li>If WAL_ttl_seconds is not 0 and WAL_size_limit_MB is 0, then |
|
|
|
|
* WAL files will be checked every WAL_ttl_secondsi / 2 and those that |
|
|
|
|
* are older than WAL_ttl_seconds will be deleted. |
|
|
|
|
* 4. If both are not 0, WAL files will be checked every 10 min and both |
|
|
|
|
* checks will be performed with ttl being first. |
|
|
|
|
* are older than WAL_ttl_seconds will be deleted.</li> |
|
|
|
|
* <li>If both are not 0, WAL files will be checked every 10 min and both |
|
|
|
|
* checks will be performed with ttl being first.</li> |
|
|
|
|
* |
|
|
|
|
* @param walTtlSeconds the ttl seconds |
|
|
|
|
* @return the reference to the current option. |
|
|
|
|
* @see setWalSizeLimitMB() |
|
|
|
|
* @see #setWalSizeLimitMB(long) |
|
|
|
|
*/ |
|
|
|
|
public Options setWalTtlSeconds(long walTtlSeconds) { |
|
|
|
|
assert(isInitialized()); |
|
|
|
@ -761,22 +771,23 @@ public class Options extends RocksObject { |
|
|
|
|
private native void setWalTtlSeconds(long handle, long walTtlSeconds); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* WalTtlSeconds() and walSizeLimitMB() affect how archived logs |
|
|
|
|
* {@link #walTtlSeconds()} and {@link #walSizeLimitMB()} affect how archived logs |
|
|
|
|
* will be deleted. |
|
|
|
|
* 1. If both set to 0, logs will be deleted asap and will not get into |
|
|
|
|
* the archive. |
|
|
|
|
* 2. If WAL_ttl_seconds is 0 and WAL_size_limit_MB is not 0, |
|
|
|
|
* <ol> |
|
|
|
|
* <li>If both set to 0, logs will be deleted asap and will not get into |
|
|
|
|
* the archive.</li> |
|
|
|
|
* <li>If WAL_ttl_seconds is 0 and WAL_size_limit_MB is not 0, |
|
|
|
|
* WAL files will be checked every 10 min and if total size is greater |
|
|
|
|
* then WAL_size_limit_MB, they will be deleted starting with the |
|
|
|
|
* earliest until size_limit is met. All empty files will be deleted. |
|
|
|
|
* 3. If WAL_ttl_seconds is not 0 and WAL_size_limit_MB is 0, then |
|
|
|
|
* WAL files will be checked every WAL_ttl_secondsi / 2 and those that |
|
|
|
|
* are older than WAL_ttl_seconds will be deleted. |
|
|
|
|
* 4. If both are not 0, WAL files will be checked every 10 min and both |
|
|
|
|
* checks will be performed with ttl being first. |
|
|
|
|
* |
|
|
|
|
* earliest until size_limit is met. All empty files will be deleted.</li> |
|
|
|
|
* <li>If WAL_ttl_seconds is not 0 and WAL_size_limit_MB is 0, then |
|
|
|
|
* WAL files will be checked every WAL_ttl_seconds i / 2 and those that |
|
|
|
|
* are older than WAL_ttl_seconds will be deleted.</li> |
|
|
|
|
* <li>If both are not 0, WAL files will be checked every 10 min and both |
|
|
|
|
* checks will be performed with ttl being first.</li> |
|
|
|
|
* </ol> |
|
|
|
|
* @return size limit in mega-bytes. |
|
|
|
|
* @see walSizeLimitMB() |
|
|
|
|
* @see #walSizeLimitMB() |
|
|
|
|
*/ |
|
|
|
|
public long walSizeLimitMB() { |
|
|
|
|
assert(isInitialized()); |
|
|
|
@ -787,21 +798,22 @@ public class Options extends RocksObject { |
|
|
|
|
/** |
|
|
|
|
* WalTtlSeconds() and walSizeLimitMB() affect how archived logs |
|
|
|
|
* will be deleted. |
|
|
|
|
* 1. If both set to 0, logs will be deleted asap and will not get into |
|
|
|
|
* the archive. |
|
|
|
|
* 2. If WAL_ttl_seconds is 0 and WAL_size_limit_MB is not 0, |
|
|
|
|
* <ol> |
|
|
|
|
* <li>If both set to 0, logs will be deleted asap and will not get into |
|
|
|
|
* the archive.</li> |
|
|
|
|
* <li>If WAL_ttl_seconds is 0 and WAL_size_limit_MB is not 0, |
|
|
|
|
* WAL files will be checked every 10 min and if total size is greater |
|
|
|
|
* then WAL_size_limit_MB, they will be deleted starting with the |
|
|
|
|
* earliest until size_limit is met. All empty files will be deleted. |
|
|
|
|
* 3. If WAL_ttl_seconds is not 0 and WAL_size_limit_MB is 0, then |
|
|
|
|
* earliest until size_limit is met. All empty files will be deleted.</li> |
|
|
|
|
* <li>If WAL_ttl_seconds is not 0 and WAL_size_limit_MB is 0, then |
|
|
|
|
* WAL files will be checked every WAL_ttl_secondsi / 2 and those that |
|
|
|
|
* are older than WAL_ttl_seconds will be deleted. |
|
|
|
|
* 4. If both are not 0, WAL files will be checked every 10 min and both |
|
|
|
|
* checks will be performed with ttl being first. |
|
|
|
|
* are older than WAL_ttl_seconds will be deleted.</li> |
|
|
|
|
* <li>If both are not 0, WAL files will be checked every 10 min and both |
|
|
|
|
* checks will be performed with ttl being first.</li> |
|
|
|
|
* |
|
|
|
|
* @param sizeLimitMB size limit in mega-bytes. |
|
|
|
|
* @return the reference to the current option. |
|
|
|
|
* @see setWalSizeLimitMB() |
|
|
|
|
* @see #setWalSizeLimitMB(long) |
|
|
|
|
*/ |
|
|
|
|
public Options setWalSizeLimitMB(long sizeLimitMB) { |
|
|
|
|
assert(isInitialized()); |
|
|
|
@ -857,7 +869,7 @@ public class Options extends RocksObject { |
|
|
|
|
* Data being read from file storage may be buffered in the OS |
|
|
|
|
* Default: true |
|
|
|
|
* |
|
|
|
|
* @param allowOsBufferif true, then OS buffering is allowed. |
|
|
|
|
* @param allowOsBuffer if true, then OS buffering is allowed. |
|
|
|
|
* @return the reference to the current option. |
|
|
|
|
*/ |
|
|
|
|
public Options setAllowOsBuffer(boolean allowOsBuffer) { |
|
|
|
@ -1122,7 +1134,7 @@ public class Options extends RocksObject { |
|
|
|
|
* Memtable format can be set using setTableFormatConfig. |
|
|
|
|
* |
|
|
|
|
* @return the name of the currently-used memtable factory. |
|
|
|
|
* @see setTableFormatConfig() |
|
|
|
|
* @see #setTableFormatConfig(TableFormatConfig) |
|
|
|
|
*/ |
|
|
|
|
public String memTableFactoryName() { |
|
|
|
|
assert(isInitialized()); |
|
|
|
@ -1273,7 +1285,7 @@ public class Options extends RocksObject { |
|
|
|
|
long handle, int numLevels); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The number of files in leve 0 to trigger compaction from level-0 to |
|
|
|
|
* The number of files in level 0 to trigger compaction from level-0 to |
|
|
|
|
* level-1. A value < 0 means that level-0 compaction will not be |
|
|
|
|
* triggered by number of files at all. |
|
|
|
|
* Default: 4 |
|
|
|
@ -1400,7 +1412,7 @@ public class Options extends RocksObject { |
|
|
|
|
* |
|
|
|
|
* @return the target size of a level-0 file. |
|
|
|
|
* |
|
|
|
|
* @see targetFileSizeMultiplier() |
|
|
|
|
* @see #targetFileSizeMultiplier() |
|
|
|
|
*/ |
|
|
|
|
public int targetFileSizeBase() { |
|
|
|
|
return targetFileSizeBase(nativeHandle_); |
|
|
|
@ -1421,7 +1433,7 @@ public class Options extends RocksObject { |
|
|
|
|
* @param targetFileSizeBase the target size of a level-0 file. |
|
|
|
|
* @return the reference to the current option. |
|
|
|
|
* |
|
|
|
|
* @see setTargetFileSizeMultiplier() |
|
|
|
|
* @see #setTargetFileSizeMultiplier(int) |
|
|
|
|
*/ |
|
|
|
|
public Options setTargetFileSizeBase(int targetFileSizeBase) { |
|
|
|
|
setTargetFileSizeBase(nativeHandle_, targetFileSizeBase); |
|
|
|
@ -1471,7 +1483,7 @@ public class Options extends RocksObject { |
|
|
|
|
* by default 'maxBytesForLevelBase' is 10MB. |
|
|
|
|
* |
|
|
|
|
* @return the upper-bound of the total size of leve-1 files in bytes. |
|
|
|
|
* @see maxBytesForLevelMultiplier() |
|
|
|
|
* @see #maxBytesForLevelMultiplier() |
|
|
|
|
*/ |
|
|
|
|
public long maxBytesForLevelBase() { |
|
|
|
|
return maxBytesForLevelBase(nativeHandle_); |
|
|
|
@ -1491,7 +1503,7 @@ public class Options extends RocksObject { |
|
|
|
|
* @return maxBytesForLevelBase the upper-bound of the total size of |
|
|
|
|
* leve-1 files in bytes. |
|
|
|
|
* @return the reference to the current option. |
|
|
|
|
* @see setMaxBytesForLevelMultiplier() |
|
|
|
|
* @see #setMaxBytesForLevelMultiplier(int) |
|
|
|
|
*/ |
|
|
|
|
public Options setMaxBytesForLevelBase(long maxBytesForLevelBase) { |
|
|
|
|
setMaxBytesForLevelBase(nativeHandle_, maxBytesForLevelBase); |
|
|
|
@ -1507,7 +1519,7 @@ public class Options extends RocksObject { |
|
|
|
|
* |
|
|
|
|
* @return the ratio between the total size of level-(L+1) files and |
|
|
|
|
* the total size of level-L files for all L. |
|
|
|
|
* @see maxBytesForLevelBase() |
|
|
|
|
* @see #maxBytesForLevelBase() |
|
|
|
|
*/ |
|
|
|
|
public int maxBytesForLevelMultiplier() { |
|
|
|
|
return maxBytesForLevelMultiplier(nativeHandle_); |
|
|
|
@ -1522,7 +1534,7 @@ public class Options extends RocksObject { |
|
|
|
|
* @param multiplier the ratio between the total size of level-(L+1) |
|
|
|
|
* files and the total size of level-L files for all L. |
|
|
|
|
* @return the reference to the current option. |
|
|
|
|
* @see setMaxBytesForLevelBase() |
|
|
|
|
* @see #setMaxBytesForLevelBase(long) |
|
|
|
|
*/ |
|
|
|
|
public Options setMaxBytesForLevelMultiplier(int multiplier) { |
|
|
|
|
setMaxBytesForLevelMultiplier(nativeHandle_, multiplier); |
|
|
|
@ -1538,7 +1550,7 @@ public class Options extends RocksObject { |
|
|
|
|
* (expanded_compaction_factor * targetFileSizeLevel()) many bytes. |
|
|
|
|
* |
|
|
|
|
* @return the maximum number of bytes in all compacted files. |
|
|
|
|
* @see sourceCompactionFactor() |
|
|
|
|
* @see #sourceCompactionFactor() |
|
|
|
|
*/ |
|
|
|
|
public int expandedCompactionFactor() { |
|
|
|
|
return expandedCompactionFactor(nativeHandle_); |
|
|
|
@ -1554,7 +1566,7 @@ public class Options extends RocksObject { |
|
|
|
|
* @param expandedCompactionFactor the maximum number of bytes in all |
|
|
|
|
* compacted files. |
|
|
|
|
* @return the reference to the current option. |
|
|
|
|
* @see setSourceCompactionFactor() |
|
|
|
|
* @see #setSourceCompactionFactor(int) |
|
|
|
|
*/ |
|
|
|
|
public Options setExpandedCompactionFactor(int expandedCompactionFactor) { |
|
|
|
|
setExpandedCompactionFactor(nativeHandle_, expandedCompactionFactor); |
|
|
|
@ -1573,7 +1585,7 @@ public class Options extends RocksObject { |
|
|
|
|
* a compaction. |
|
|
|
|
* |
|
|
|
|
* @return the maximum number of bytes in all source files to be compactedo. |
|
|
|
|
* @see expendedCompactionFactor() |
|
|
|
|
* @see #expandedCompactionFactor() |
|
|
|
|
*/ |
|
|
|
|
public int sourceCompactionFactor() { |
|
|
|
|
return sourceCompactionFactor(nativeHandle_); |
|
|
|
@ -1592,7 +1604,7 @@ public class Options extends RocksObject { |
|
|
|
|
* @param sourceCompactionFactor the maximum number of bytes in all |
|
|
|
|
* source files to be compacted in a single compaction run. |
|
|
|
|
* @return the reference to the current option. |
|
|
|
|
* @see setExpendedCompactionFactor() |
|
|
|
|
* @see #setExpandedCompactionFactor(int) |
|
|
|
|
*/ |
|
|
|
|
public Options setSourceCompactionFactor(int sourceCompactionFactor) { |
|
|
|
|
setSourceCompactionFactor(nativeHandle_, sourceCompactionFactor); |
|
|
|
@ -1979,7 +1991,7 @@ public class Options extends RocksObject { |
|
|
|
|
* This value will be used only when a prefix-extractor is specified. |
|
|
|
|
* |
|
|
|
|
* @return the number of bloom-bits. |
|
|
|
|
* @see useFixedLengthPrefixExtractor() |
|
|
|
|
* @see #useFixedLengthPrefixExtractor(int) |
|
|
|
|
*/ |
|
|
|
|
public int memtablePrefixBloomBits() { |
|
|
|
|
return memtablePrefixBloomBits(nativeHandle_); |
|
|
|
@ -2037,7 +2049,7 @@ public class Options extends RocksObject { |
|
|
|
|
* Default: 0 |
|
|
|
|
* |
|
|
|
|
* @return the level of locality of bloom-filter probes. |
|
|
|
|
* @see setMemTablePrefixBloomProbes |
|
|
|
|
* @see #setMemtablePrefixBloomProbes(int) |
|
|
|
|
*/ |
|
|
|
|
public int bloomLocality() { |
|
|
|
|
return bloomLocality(nativeHandle_); |
|
|
|
@ -2149,7 +2161,7 @@ public class Options extends RocksObject { |
|
|
|
|
* |
|
|
|
|
* Default: 2 |
|
|
|
|
* |
|
|
|
|
* @return |
|
|
|
|
* @return min partial merge operands |
|
|
|
|
*/ |
|
|
|
|
public int minPartialMergeOperands() { |
|
|
|
|
return minPartialMergeOperands(nativeHandle_); |
|
|
|
|