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).
6 // This file implements the callback "bridge" between Java and C++ for
7 // ROCKSDB_NAMESPACE::WalFilter.
9 #ifndef JAVA_ROCKSJNI_WAL_FILTER_JNICALLBACK_H_
10 #define JAVA_ROCKSJNI_WAL_FILTER_JNICALLBACK_H_
17 #include "rocksdb/wal_filter.h"
18 #include "rocksjni/jnicallback.h"
20 namespace ROCKSDB_NAMESPACE
{
22 class WalFilterJniCallback
: public JniCallback
, public WalFilter
{
25 JNIEnv
* env
, jobject jwal_filter
);
26 virtual void ColumnFamilyLogNumberMap(
27 const std::map
<uint32_t, uint64_t>& cf_lognumber_map
,
28 const std::map
<std::string
, uint32_t>& cf_name_id_map
);
29 virtual WalFilter::WalProcessingOption
LogRecordFound(
30 unsigned long long log_number
, const std::string
& log_file_name
,
31 const WriteBatch
& batch
, WriteBatch
* new_batch
, bool* batch_changed
);
32 virtual const char* Name() const;
35 std::unique_ptr
<const char[]> m_name
;
36 jmethodID m_column_family_log_number_map_mid
;
37 jmethodID m_log_record_found_proxy_mid
;
40 } // namespace ROCKSDB_NAMESPACE
42 #endif // JAVA_ROCKSJNI_WAL_FILTER_JNICALLBACK_H_