public abstract class AbstractComparator<T extends org.rocksdb.AbstractSlice<?>> extends RocksObject
Comparator,
DirectComparatornativeHandle_| Constructor and Description |
|---|
AbstractComparator() |
| Modifier and Type | Method and Description |
|---|---|
abstract int |
compare(T a,
T b)
Three-way key comparison
|
protected void |
disposeInternal()
Deletes underlying C++ comparator pointer.
|
java.lang.String |
findShortestSeparator(java.lang.String start,
T 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.
|
abstract java.lang.String |
name()
The name of the comparator.
|
disOwnNativeHandle, dispose, finalize, isInitialized, isOwningNativeHandlepublic abstract java.lang.String name()
public abstract int compare(T a, T b)
a - Slice access to first keyb - Slice access to second keypublic java.lang.String findShortestSeparator(java.lang.String start,
T limit)
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.
start - Stringlimit - of type Tpublic java.lang.String findShortSuccessor(java.lang.String key)
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.
key - Stringprotected void disposeInternal()
disposeInternal in class RocksObject