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 callback "bridge" between Java and C++ for
7 // ROCKSDB_NAMESPACE::TableFilter.
8 
9 #ifndef JAVA_ROCKSJNI_TABLE_FILTER_JNICALLBACK_H_
10 #define JAVA_ROCKSJNI_TABLE_FILTER_JNICALLBACK_H_
11 
12 #include <jni.h>
13 #include <functional>
14 #include <memory>
15 
16 #include "rocksdb/table_properties.h"
17 #include "rocksjni/jnicallback.h"
18 
19 namespace ROCKSDB_NAMESPACE {
20 
21 class TableFilterJniCallback : public JniCallback {
22  public:
23     TableFilterJniCallback(
24         JNIEnv* env, jobject jtable_filter);
25     std::function<bool(const ROCKSDB_NAMESPACE::TableProperties&)>
26     GetTableFilterFunction();
27 
28    private:
29     jmethodID m_jfilter_methodid;
30     std::function<bool(const ROCKSDB_NAMESPACE::TableProperties&)>
31         m_table_filter_function;
32 };
33 
34 }  // namespace ROCKSDB_NAMESPACE
35 
36 #endif  // JAVA_ROCKSJNI_TABLE_FILTER_JNICALLBACK_H_
37