]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/java/src/main/java/org/rocksdb/DirectComparator.java
add subtree-ish sources for 12.0.3
[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 the BSD-style license found in the
3 // LICENSE file in the root directory of this source tree. An additional grant
4 // of patent rights can be found in the PATENTS file in the same 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 private final long nativeHandle_;
20
21 public DirectComparator(final ComparatorOptions copt) {
22 super();
23 this.nativeHandle_ = createNewDirectComparator0(copt.nativeHandle_);
24 }
25
26 @Override
27 protected final long getNativeHandle() {
28 return nativeHandle_;
29 }
30
31 private native long createNewDirectComparator0(
32 final long comparatorOptionsHandle);
33 }