From f1626a0aa11dc5aff74707f44f0f9d460e0396ba Mon Sep 17 00:00:00 2001 From: yangyazhou Date: Tue, 21 May 2024 16:29:43 +0800 Subject: [PATCH] add iterator refresh interface --- db/c.cc | 4 ++++ include/rocksdb/c.h | 1 + 2 files changed, 5 insertions(+) diff --git a/db/c.cc b/db/c.cc index 72c94ff377a..59cdecc6646 100644 --- a/db/c.cc +++ b/db/c.cc @@ -2122,6 +2122,10 @@ unsigned char rocksdb_iter_valid(const rocksdb_iterator_t* iter) { return iter->rep->Valid(); } +void rocksdb_iter_refresh(rocksdb_iterator_t* iter) { + iter->rep->Refresh(); +} + void rocksdb_iter_seek_to_first(rocksdb_iterator_t* iter) { iter->rep->SeekToFirst(); } diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index 61b50eebb7a..076bd5414ec 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -738,6 +738,7 @@ extern ROCKSDB_LIBRARY_API void rocksdb_repair_db( extern ROCKSDB_LIBRARY_API void rocksdb_iter_destroy(rocksdb_iterator_t*); extern ROCKSDB_LIBRARY_API unsigned char rocksdb_iter_valid( const rocksdb_iterator_t*); +extern ROCKSDB_LIBRARY_API void rocksdb_iter_refresh(rocksdb_iterator_t* iter); extern ROCKSDB_LIBRARY_API void rocksdb_iter_seek_to_first(rocksdb_iterator_t*); extern ROCKSDB_LIBRARY_API void rocksdb_iter_seek_to_last(rocksdb_iterator_t*); extern ROCKSDB_LIBRARY_API void rocksdb_iter_seek(rocksdb_iterator_t*,