public abstract class Env extends RocksObject
nativeHandle_owningHandle_| Modifier and Type | Method and Description |
|---|---|
int |
getBackgroundThreads(Priority priority)
Gets the number of background worker threads of the pool
for this environment.
|
static Env |
getDefault()
Returns the default environment suitable for the current operating
system.
|
List<ThreadStatus> |
getThreadList()
Returns the status of all threads that belong to the current Env.
|
int |
getThreadPoolQueueLen(Priority priority)
Returns the length of the queue associated with the specified
thread pool.
|
Env |
incBackgroundThreadsIfNeeded(int number,
Priority priority)
Enlarge number of background worker threads of a specific thread pool
for this environment if it is smaller than specified.
|
Env |
lowerThreadPoolCPUPriority(Priority priority)
Lower CPU priority for threads from the specified pool.
|
Env |
lowerThreadPoolIOPriority(Priority priority)
Lower IO priority for threads from the specified pool.
|
Env |
setBackgroundThreads(int number)
Sets the number of background worker threads of the flush pool
for this environment.
|
Env |
setBackgroundThreads(int number,
Priority priority)
Sets the number of background worker threads of the specified thread
pool for this environment.
|
disposeInternal, disposeInternal, getNativeHandleclose, disOwnNativeHandle, isOwningHandledispose, finalizepublic static Env 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()/close()
will be no-op.
RocksEnv instance.public Env setBackgroundThreads(int number)
Sets the number of background worker threads of the flush pool for this environment.
Default number: 1
number - the number of threadsRocksEnv instance.public int getBackgroundThreads(Priority priority)
Gets the number of background worker threads of the pool for this environment.
priority - the priority id of a specified thread pool.public Env setBackgroundThreads(int number, Priority priority)
Sets the number of background worker threads of the specified thread pool for this environment.
number - the number of threadspriority - the priority id of a specified thread pool.
Default number: 1
RocksEnv instance.public int getThreadPoolQueueLen(Priority priority)
Returns the length of the queue associated with the specified thread pool.
priority - the priority id of a specified thread pool.public Env incBackgroundThreadsIfNeeded(int number, Priority priority)
number - the number of threads.priority - the priority id of a specified thread pool.RocksEnv instance.public Env lowerThreadPoolIOPriority(Priority priority)
priority - the priority id of a specified thread pool.RocksEnv instance.public Env lowerThreadPoolCPUPriority(Priority priority)
priority - the priority id of a specified thread pool.RocksEnv instance.public List<ThreadStatus> getThreadList() throws RocksDBException
RocksDBException - if the thread list cannot be acquired.Copyright © 2021. All rights reserved.