rocksdb/java/rocksjni/table_properties_collector_factory.cc
akankshamahajan 7b24dec25d Fix header files to meet Open source requirements (#12164)
Summary:
Same as title

Pull Request resolved: https://github.com/facebook/rocksdb/pull/12164

Reviewed By: hx235

Differential Revision: D52302234

Pulled By: akankshamahajan15

fbshipit-source-id: d4724fc944c773242788f5a47d1c7eadbbc5a522
2023-12-19 13:43:17 -08:00

40 lines
1.5 KiB
C++

// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// 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).
#include "java/rocksjni/table_properties_collector_factory.h"
#include "java/include/org_rocksdb_TablePropertiesCollectorFactory.h"
#include "java/rocksjni/cplusplus_to_java_convert.h"
#include "rocksdb/db.h"
#include "rocksdb/utilities/table_properties_collectors.h"
/*
* Class: org_rocksdb_TablePropertiesCollectorFactory
* Method: newCompactOnDeletionCollectorFactory
* Signature: (JJD)J
*/
jlong Java_org_rocksdb_TablePropertiesCollectorFactory_newCompactOnDeletionCollectorFactory(
JNIEnv *, jclass, jlong sliding_window_size, jlong deletion_trigger,
jdouble deletion_ratio) {
auto *wrapper = new TablePropertiesCollectorFactoriesJniWrapper();
wrapper->table_properties_collector_factories =
ROCKSDB_NAMESPACE::NewCompactOnDeletionCollectorFactory(
sliding_window_size, deletion_trigger, deletion_ratio);
return GET_CPLUSPLUS_POINTER(wrapper);
}
/*
* Class: org_rocksdb_TablePropertiesCollectorFactory
* Method: deleteCompactOnDeletionCollectorFactory
* Signature: (J)J
*/
void Java_org_rocksdb_TablePropertiesCollectorFactory_deleteCompactOnDeletionCollectorFactory(
JNIEnv *, jclass, jlong jhandle) {
auto instance =
reinterpret_cast<TablePropertiesCollectorFactoriesJniWrapper *>(jhandle);
delete instance;
}