Skip to content

Expose log_data blobs in WriteBatchIterator and WriteBatchIteratorCf#234

Open
lucasvuillier wants to merge 1 commit into
zaidoon1:masterfrom
lucasvuillier:add-log-data
Open

Expose log_data blobs in WriteBatchIterator and WriteBatchIteratorCf#234
lucasvuillier wants to merge 1 commit into
zaidoon1:masterfrom
lucasvuillier:add-log-data

Conversation

@lucasvuillier

@lucasvuillier lucasvuillier commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add optional log_data(&mut self, blob: &[u8]) method (default: no-op) to both WriteBatchIterator and WriteBatchIteratorCf
  • add rust_rocksdb_writebatch_iterate and rust_rocksdb_writebatch_iterate_cf to c-api-extensions: thin C++ wrappers over WriteBatch::Handler that expose the LogData callback
    the upstream rocksdb_writebatch_iterate / rocksdb_writebatch_iterate_cf don't forward
  • wire up the corresponding FFI callbacks in iterate() and iterate_cf() so blobs written via put_log_data are forwarded to the Rust layer instead of being silently dropped
  • existing implementations of both traits require no changes (provided method with default no-op)

Testing

  • new test_write_batch_iterate_log_data — verifies WriteBatchIterator::log_data is called for each put_log_data entry in order
  • new test_write_batch_cf_iterate_log_data — same for WriteBatchIteratorCf
  • new writebatch_log_data phase in librocksdb-sys/tests/ffi.rs — calls rust_rocksdb_writebatch_iterate with a CheckLogData callback that asserts content and call order

@lucasvuillier lucasvuillier force-pushed the add-log-data branch 2 times, most recently from 2e771b8 to c0ae076 Compare June 3, 2026 10:23
@lucasvuillier lucasvuillier marked this pull request as ready for review June 3, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant