From 89b37081a1b348a8a10f92513e0dd90fd82f7308 Mon Sep 17 00:00:00 2001 From: straw Date: Fri, 1 Jun 2018 09:33:10 -0700 Subject: [PATCH] add c api rocksdb_sstfilewriter_file_size Summary: Closes https://github.com/facebook/rocksdb/pull/3922 Differential Revision: D8208528 Pulled By: ajkr fbshipit-source-id: d384fe53cf526f2aadc7b79a423ce36dbd3ff224 --- db/c.cc | 5 +++++ include/rocksdb/c.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/db/c.cc b/db/c.cc index 27a324fa1..b1c7cb21d 100644 --- a/db/c.cc +++ b/db/c.cc @@ -3264,6 +3264,11 @@ void rocksdb_sstfilewriter_finish(rocksdb_sstfilewriter_t* writer, SaveError(errptr, writer->rep->Finish(nullptr)); } +void rocksdb_sstfilewriter_file_size(rocksdb_sstfilewriter_t* writer, + uint64_t* file_size) { + *file_size = writer->rep->FileSize(); +} + void rocksdb_sstfilewriter_destroy(rocksdb_sstfilewriter_t* writer) { delete writer->rep; delete writer; diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index 08e6617f9..f89f66898 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -1310,6 +1310,8 @@ extern ROCKSDB_LIBRARY_API void rocksdb_sstfilewriter_delete( char** errptr); extern ROCKSDB_LIBRARY_API void rocksdb_sstfilewriter_finish( rocksdb_sstfilewriter_t* writer, char** errptr); +extern ROCKSDB_LIBRARY_API void rocksdb_sstfilewriter_file_size( + rocksdb_sstfilewriter_t* writer, uint64_t* file_size); extern ROCKSDB_LIBRARY_API void rocksdb_sstfilewriter_destroy( rocksdb_sstfilewriter_t* writer);