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.
|
java.util.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
close, disOwnNativeHandle, isOwningHandle
dispose, finalize
public 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.
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.RocksEnv
instance.public Env lowerThreadPoolIOPriority(Priority priority)
priority
- the priority id of a specified thread pool.public Env lowerThreadPoolCPUPriority(Priority priority)
priority
- the priority id of a specified thread pool.public java.util.List<ThreadStatus> getThreadList() throws RocksDBException
RocksDBException