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::TraceWriter.
9 #ifndef JAVA_ROCKSJNI_TRACE_WRITER_JNICALLBACK_H_
10 #define JAVA_ROCKSJNI_TRACE_WRITER_JNICALLBACK_H_
15 #include "rocksdb/trace_reader_writer.h"
16 #include "rocksjni/jnicallback.h"
20 class TraceWriterJniCallback
: public JniCallback
, public TraceWriter
{
22 TraceWriterJniCallback(
23 JNIEnv
* env
, jobject jtrace_writer
);
24 virtual Status
Write(const Slice
& data
);
25 virtual Status
Close();
26 virtual uint64_t GetFileSize();
29 jmethodID m_jwrite_proxy_methodid
;
30 jmethodID m_jclose_writer_proxy_methodid
;
31 jmethodID m_jget_file_size_methodid
;
36 #endif // JAVA_ROCKSJNI_TRACE_WRITER_JNICALLBACK_H_