public abstract class NativeComparatorWrapper extends AbstractComparator
nativeHandle_owningHandle_| Constructor and Description |
|---|
NativeComparatorWrapper() |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(ByteBuffer s1,
ByteBuffer s2)
Three-way key comparison.
|
protected void |
disposeInternal()
We override
RocksCallbackObject.disposeInternal()
as disposing of a native rocksdb::Comparator extension requires
a slightly different approach as it is not really a RocksCallbackObject |
void |
findShortestSeparator(ByteBuffer start,
ByteBuffer limit)
Used to reduce the space requirements
for internal data structures like index blocks.
|
void |
findShortSuccessor(ByteBuffer key)
Used to reduce the space requirements
for internal data structures like index blocks.
|
String |
name()
The name of the comparator.
|
initializeNative, usingDirectBuffersclose, disOwnNativeHandle, isOwningHandlepublic final String name()
AbstractComparatorname in class AbstractComparatorpublic final int compare(ByteBuffer s1, ByteBuffer s2)
AbstractComparatorByteBuffers passed in, though
it would be unconventional to modify the "limit" or any of the
underlying bytes. As a callback, RocksJava will ensure that a
is a different instance from b.compare in class AbstractComparators1 - buffer containing the first key in its "remaining" elementss2 - buffer containing the second key in its "remaining" elementspublic final void findShortestSeparator(ByteBuffer start, ByteBuffer limit)
AbstractComparatorUsed to reduce the space requirements for internal data structures like index blocks.
If start < limit, you may modify start which is a shorter string in [start, limit).
If you modify start, it is expected that you set the byte buffer so that a subsequent read of start.remaining() bytes from start.position() to start.limit() will obtain the new start value.Simple comparator implementations may return with start unchanged. i.e., an implementation of this method that does nothing is correct.
findShortestSeparator in class AbstractComparatorstart - the startlimit - the limitpublic final void findShortSuccessor(ByteBuffer key)
AbstractComparatorUsed to reduce the space requirements for internal data structures like index blocks.
You may change key to a shorter key (key1) where key1 ≥ key.
Simple comparator implementations may return the key unchanged. i.e., an implementation of this method that does nothing is correct.
findShortSuccessor in class AbstractComparatorkey - the keyprotected void disposeInternal()
RocksCallbackObject.disposeInternal()
as disposing of a native rocksdb::Comparator extension requires
a slightly different approach as it is not really a RocksCallbackObjectdisposeInternal in class RocksCallbackObjectCopyright © 2022. All rights reserved.