]>
Commit | Line | Data |
---|---|---|
7c673cae | 1 | // Copyright (c) 2011-present, Facebook, Inc. All rights reserved. |
11fdf7f2 TL |
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). | |
7c673cae FG |
5 | // |
6 | // This file implements the "bridge" between Java and C++ and enables | |
f67539c2 | 7 | // calling C++ ROCKSDB_NAMESPACE::RestoreOptions methods |
7c673cae FG |
8 | // from Java side. |
9 | ||
11fdf7f2 | 10 | #include <jni.h> |
7c673cae FG |
11 | #include <stdio.h> |
12 | #include <stdlib.h> | |
7c673cae FG |
13 | #include <string> |
14 | ||
15 | #include "include/org_rocksdb_RestoreOptions.h" | |
7c673cae | 16 | #include "rocksdb/utilities/backupable_db.h" |
11fdf7f2 | 17 | #include "rocksjni/portal.h" |
7c673cae FG |
18 | /* |
19 | * Class: org_rocksdb_RestoreOptions | |
20 | * Method: newRestoreOptions | |
21 | * Signature: (Z)J | |
22 | */ | |
11fdf7f2 TL |
23 | jlong Java_org_rocksdb_RestoreOptions_newRestoreOptions( |
24 | JNIEnv* /*env*/, jclass /*jcls*/, jboolean keep_log_files) { | |
f67539c2 | 25 | auto* ropt = new ROCKSDB_NAMESPACE::RestoreOptions(keep_log_files); |
7c673cae FG |
26 | return reinterpret_cast<jlong>(ropt); |
27 | } | |
28 | ||
29 | /* | |
30 | * Class: org_rocksdb_RestoreOptions | |
31 | * Method: disposeInternal | |
32 | * Signature: (J)V | |
33 | */ | |
11fdf7f2 TL |
34 | void Java_org_rocksdb_RestoreOptions_disposeInternal(JNIEnv* /*env*/, |
35 | jobject /*jobj*/, | |
36 | jlong jhandle) { | |
f67539c2 | 37 | auto* ropt = reinterpret_cast<ROCKSDB_NAMESPACE::RestoreOptions*>(jhandle); |
7c673cae FG |
38 | assert(ropt); |
39 | delete ropt; | |
40 | } |