]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/java/src/main/java/org/rocksdb/DirectComparator.java
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / rocksdb / java / src / main / java / org / rocksdb / DirectComparator.java
1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2 // This source code is licensed under both the GPLv2 (found in the
3 // COPYING file in the root directory) and Apache 2.0 License
4 // (found in the LICENSE.Apache file in the root directory).
5
6 package org.rocksdb;
7
8 /**
9 * Base class for comparators which will receive
10 * ByteBuffer based access via org.rocksdb.DirectSlice
11 * in their compare method implementation.
12 *
13 * ByteBuffer based slices perform better when large keys
14 * are involved. When using smaller keys consider
15 * using @see org.rocksdb.Comparator
16 */
17 public abstract class DirectComparator extends AbstractComparator<DirectSlice> {
18
19 public DirectComparator(final ComparatorOptions copt) {
20 super(copt);
21 }
22
23 @Override
24 protected long initializeNative(final long... nativeParameterHandles) {
25 return createNewDirectComparator0(nativeParameterHandles[0]);
26 }
27
28 @Override
29 final ComparatorType getComparatorType() {
30 return ComparatorType.JAVA_DIRECT_COMPARATOR;
31 }
32
33 private native long createNewDirectComparator0(
34 final long comparatorOptionsHandle);
35 }