2016-02-09 23:12:00 +00:00
|
|
|
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
|
2017-07-15 23:03:42 +00:00
|
|
|
// This source code is licensed under both the GPLv2 (found in the
|
|
|
|
// COPYING file in the root directory) and Apache 2.0 License
|
|
|
|
// (found in the LICENSE.Apache file in the root directory).
|
2014-05-14 05:20:58 +00:00
|
|
|
//
|
|
|
|
// This file implements the "bridge" between Java and C++ and enables
|
2020-02-20 20:07:53 +00:00
|
|
|
// calling C++ ROCKSDB_NAMESPACE::RestoreOptions methods
|
2014-05-14 05:20:58 +00:00
|
|
|
// from Java side.
|
|
|
|
|
2018-04-13 00:55:14 +00:00
|
|
|
#include <jni.h>
|
2014-05-14 05:20:58 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2022-01-27 23:44:23 +00:00
|
|
|
|
2014-05-14 05:20:58 +00:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "include/org_rocksdb_RestoreOptions.h"
|
2022-01-27 23:44:23 +00:00
|
|
|
#include "rocksdb/utilities/backup_engine.h"
|
2022-03-01 17:02:15 +00:00
|
|
|
#include "rocksjni/cplusplus_to_java_convert.h"
|
2018-04-13 00:55:14 +00:00
|
|
|
#include "rocksjni/portal.h"
|
2014-05-14 05:20:58 +00:00
|
|
|
/*
|
|
|
|
* Class: org_rocksdb_RestoreOptions
|
|
|
|
* Method: newRestoreOptions
|
2014-05-19 05:40:48 +00:00
|
|
|
* Signature: (Z)J
|
2014-05-14 05:20:58 +00:00
|
|
|
*/
|
2018-04-13 00:55:14 +00:00
|
|
|
jlong Java_org_rocksdb_RestoreOptions_newRestoreOptions(
|
|
|
|
JNIEnv* /*env*/, jclass /*jcls*/, jboolean keep_log_files) {
|
2020-02-20 20:07:53 +00:00
|
|
|
auto* ropt = new ROCKSDB_NAMESPACE::RestoreOptions(keep_log_files);
|
2022-03-01 17:02:15 +00:00
|
|
|
return GET_CPLUSPLUS_POINTER(ropt);
|
2014-05-14 05:20:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Class: org_rocksdb_RestoreOptions
|
2016-01-20 17:05:41 +00:00
|
|
|
* Method: disposeInternal
|
2014-05-14 05:20:58 +00:00
|
|
|
* Signature: (J)V
|
|
|
|
*/
|
2018-04-13 00:55:14 +00:00
|
|
|
void Java_org_rocksdb_RestoreOptions_disposeInternal(JNIEnv* /*env*/,
|
|
|
|
jobject /*jobj*/,
|
|
|
|
jlong jhandle) {
|
2020-02-20 20:07:53 +00:00
|
|
|
auto* ropt = reinterpret_cast<ROCKSDB_NAMESPACE::RestoreOptions*>(jhandle);
|
2014-05-14 05:20:58 +00:00
|
|
|
assert(ropt);
|
|
|
|
delete ropt;
|
|
|
|
}
|