]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
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 | |
f67539c2 | 7 | // ROCKSDB_NAMESPACE::CompactionFilterFactory. |
11fdf7f2 TL |
8 | |
9 | #ifndef JAVA_ROCKSJNI_COMPACTION_FILTER_FACTORY_JNICALLBACK_H_ | |
10 | #define JAVA_ROCKSJNI_COMPACTION_FILTER_FACTORY_JNICALLBACK_H_ | |
11 | ||
12 | #include <jni.h> | |
1e59de90 | 13 | |
11fdf7f2 TL |
14 | #include <memory> |
15 | ||
16 | #include "rocksdb/compaction_filter.h" | |
17 | #include "rocksjni/jnicallback.h" | |
18 | ||
f67539c2 | 19 | namespace ROCKSDB_NAMESPACE { |
11fdf7f2 | 20 | |
1e59de90 TL |
21 | class CompactionFilterFactoryJniCallback : public JniCallback, |
22 | public CompactionFilterFactory { | |
11fdf7f2 | 23 | public: |
1e59de90 TL |
24 | CompactionFilterFactoryJniCallback(JNIEnv* env, |
25 | jobject jcompaction_filter_factory); | |
26 | virtual std::unique_ptr<CompactionFilter> CreateCompactionFilter( | |
11fdf7f2 | 27 | const CompactionFilter::Context& context); |
1e59de90 | 28 | virtual const char* Name() const; |
11fdf7f2 TL |
29 | |
30 | private: | |
1e59de90 TL |
31 | std::unique_ptr<const char[]> m_name; |
32 | jmethodID m_jcreate_compaction_filter_methodid; | |
11fdf7f2 TL |
33 | }; |
34 | ||
f67539c2 | 35 | } // namespace ROCKSDB_NAMESPACE |
11fdf7f2 TL |
36 | |
37 | #endif // JAVA_ROCKSJNI_COMPACTION_FILTER_FACTORY_JNICALLBACK_H_ |