public class RocksEnv extends RocksObject
A RocksEnv is an interface used by the rocksdb implementation to access operating system functionality like the filesystem etc.
All Env implementations are safe for concurrent access from multiple threads without any external synchronization.
Modifier and Type | Field and Description |
---|---|
static int |
COMPACTION_POOL |
static int |
FLUSH_POOL |
nativeHandle_
Modifier and Type | Method and Description |
---|---|
protected void |
disposeInternal()
The helper function of
RocksObject.dispose() which all subclasses of
RocksObject must implement to release their associated C++
resource. |
static RocksEnv |
getDefault()
Returns the default environment suitable for the current operating
system.
|
int |
getThreadPoolQueueLen(int poolID)
Returns the length of the queue associated with the specified
thread pool.
|
RocksEnv |
setBackgroundThreads(int num)
Sets the number of background worker threads of the flush pool
for this environment.
|
RocksEnv |
setBackgroundThreads(int num,
int poolID)
Sets the number of background worker threads of the specified thread
pool for this environment.
|
disOwnNativeHandle, dispose, finalize, isInitialized, isOwningNativeHandle
public static final int FLUSH_POOL
public static final int COMPACTION_POOL
public static RocksEnv getDefault()
Returns the default environment suitable for the current operating system.
The result of getDefault()
is a singleton whose ownership
belongs to rocksdb c++. As a result, the returned RocksEnv will not
have the ownership of its c++ resource, and calling its dispose()
will be no-op.
RocksEnv
instance.public RocksEnv setBackgroundThreads(int num)
Sets the number of background worker threads of the flush pool for this environment.
Default number: 1
num
- the number of threadsRocksEnv
instance.public RocksEnv setBackgroundThreads(int num, int poolID)
Sets the number of background worker threads of the specified thread pool for this environment.
num
- the number of threadspoolID
- the id to specified a thread pool. Should be either
FLUSH_POOL or COMPACTION_POOL.
Default number: 1
RocksEnv
instance.public int getThreadPoolQueueLen(int poolID)
Returns the length of the queue associated with the specified thread pool.
poolID
- the id to specified a thread pool. Should be either
FLUSH_POOL or COMPACTION_POOL.protected void disposeInternal()
RocksObject.dispose()
which all subclasses of
RocksObject
must implement to release their associated C++
resource.disposeInternal
in class RocksObject