]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/java/rocksjni/restorejni.cc
bump version to 18.2.4-pve3
[ceph.git] / ceph / src / rocksdb / java / rocksjni / restorejni.cc
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 // This file implements the "bridge" between Java and C++ and enables
7 // calling C++ ROCKSDB_NAMESPACE::RestoreOptions methods
8 // from Java side.
9
10 #include <jni.h>
11 #include <stdio.h>
12 #include <stdlib.h>
13
14 #include <string>
15
16 #include "include/org_rocksdb_RestoreOptions.h"
17 #include "rocksdb/utilities/backup_engine.h"
18 #include "rocksjni/cplusplus_to_java_convert.h"
19 #include "rocksjni/portal.h"
20 /*
21 * Class: org_rocksdb_RestoreOptions
22 * Method: newRestoreOptions
23 * Signature: (Z)J
24 */
25 jlong Java_org_rocksdb_RestoreOptions_newRestoreOptions(
26 JNIEnv* /*env*/, jclass /*jcls*/, jboolean keep_log_files) {
27 auto* ropt = new ROCKSDB_NAMESPACE::RestoreOptions(keep_log_files);
28 return GET_CPLUSPLUS_POINTER(ropt);
29 }
30
31 /*
32 * Class: org_rocksdb_RestoreOptions
33 * Method: disposeInternal
34 * Signature: (J)V
35 */
36 void Java_org_rocksdb_RestoreOptions_disposeInternal(JNIEnv* /*env*/,
37 jobject /*jobj*/,
38 jlong jhandle) {
39 auto* ropt = reinterpret_cast<ROCKSDB_NAMESPACE::RestoreOptions*>(jhandle);
40 assert(ropt);
41 delete ropt;
42 }