public abstract class NativeComparatorWrapper extends AbstractComparator<Slice>
nativeHandle_
owningHandle_
Constructor and Description |
---|
NativeComparatorWrapper() |
Modifier and Type | Method and Description |
---|---|
int |
compare(Slice s1,
Slice s2)
Three-way key comparison
|
protected void |
disposeInternal()
We override
RocksCallbackObject.disposeInternal()
as disposing of a native rocksd::Comparator extension requires
a slightly different approach as it is not really a RocksCallbackObject |
java.lang.String |
findShortestSeparator(java.lang.String start,
Slice limit)
Used to reduce the space requirements
for internal data structures like index blocks.
|
java.lang.String |
findShortSuccessor(java.lang.String key)
Used to reduce the space requirements
for internal data structures like index blocks.
|
java.lang.String |
name()
The name of the comparator.
|
initializeNative
close, disOwnNativeHandle, isOwningHandle
dispose, finalize
public final java.lang.String name()
AbstractComparator
name
in class AbstractComparator<Slice>
public final int compare(Slice s1, Slice s2)
AbstractComparator
compare
in class AbstractComparator<Slice>
s1
- Slice access to first keys2
- Slice access to second keypublic final java.lang.String findShortestSeparator(java.lang.String start, Slice limit)
AbstractComparator
Used to reduce the space requirements for internal data structures like index blocks.
If start < limit, you may return a new start which is a shorter string in [start, limit).
Simple comparator implementations may return null if they wish to use start unchanged. i.e., an implementation of this method that does nothing is correct.
findShortestSeparator
in class AbstractComparator<Slice>
start
- Stringlimit
- of type Tpublic final java.lang.String findShortSuccessor(java.lang.String key)
AbstractComparator
Used to reduce the space requirements for internal data structures like index blocks.
You may return a new short key (key1) where key1 ≥ key.
Simple comparator implementations may return null if they wish to leave the key unchanged. i.e., an implementation of this method that does nothing is correct.
findShortSuccessor
in class AbstractComparator<Slice>
key
- Stringprotected void disposeInternal()
RocksCallbackObject.disposeInternal()
as disposing of a native rocksd::Comparator extension requires
a slightly different approach as it is not really a RocksCallbackObjectdisposeInternal
in class RocksCallbackObject