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