]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/java/src/main/java/org/rocksdb/ComparatorOptions.java
4 * This class controls the behaviour
5 * of Java implementations of
8 * Note that dispose() must be called before a ComparatorOptions
9 * instance becomes out-of-scope to release the allocated memory in C++.
11 public class ComparatorOptions
extends RocksObject
{
12 public ComparatorOptions() {
13 super(newComparatorOptions());
17 * Use adaptive mutex, which spins in the user space before resorting
18 * to kernel. This could reduce context switch when the mutex is not
19 * heavily contended. However, if the mutex is hot, we could end up
23 * @return true if adaptive mutex is used.
25 public boolean useAdaptiveMutex() {
26 assert(isOwningHandle());
27 return useAdaptiveMutex(nativeHandle_
);
31 * Use adaptive mutex, which spins in the user space before resorting
32 * to kernel. This could reduce context switch when the mutex is not
33 * heavily contended. However, if the mutex is hot, we could end up
37 * @param useAdaptiveMutex true if adaptive mutex is used.
38 * @return the reference to the current comparator options.
40 public ComparatorOptions
setUseAdaptiveMutex(final boolean useAdaptiveMutex
) {
41 assert (isOwningHandle());
42 setUseAdaptiveMutex(nativeHandle_
, useAdaptiveMutex
);
46 private native static long newComparatorOptions();
47 private native boolean useAdaptiveMutex(final long handle
);
48 private native void setUseAdaptiveMutex(final long handle
,
49 final boolean useAdaptiveMutex
);
50 @Override protected final native void disposeInternal(final long handle
);