Skip to content

Commit

Permalink
Support Non-Blocking Manual Compactions (CompactRange) (#597) (#656)
Browse files Browse the repository at this point in the history
Add a new option to CompactRangeOptions, a callback object. By default,
the callback is empty so CompactRange() will be blocking (as it is now).
If the callback is set, the callback object's callback method will be
called upon completion with the completion status.
  • Loading branch information
udi-speedb committed Dec 6, 2023
1 parent 4650348 commit 5709b4b
Show file tree
Hide file tree
Showing 34 changed files with 1,683 additions and 239 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,7 @@ set(SOURCES
db/db_impl/db_impl_experimental.cc
db/db_impl/db_impl_readonly.cc
db/db_impl/db_impl_secondary.cc
db/db_impl/compact_range_threads_mngr.cc
db/db_info_dumper.cc
db/db_iter.cc
db/dbformat.cc
Expand Down
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Fix RepeatableThread to work properly with on thread start callback feature (https://github.com/speedb-io/speedb/pull/667).

### New Features
* Non-Blocking Manual Compaction (CompactRange()) - Support non-blocking manual compactions by setting a new CompactRangeOptions option (async_completion_cb). When set, the CompactRange() call will return control to the caller immediately. The manual compaction iteslf will be performed in an internally created thread. The manual compaction will ALWAYS call the specified callback upon completion and provide the completion status (#597).

### Enhancements

Expand Down
1 change: 1 addition & 0 deletions TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ cpp_library_wrapper(name="rocksdb_lib", srcs=[
"db/compaction/subcompaction_state.cc",
"db/convenience.cc",
"db/db_filesnapshot.cc",
"db/db_impl/compact_range_threads_mngr.cc",
"db/db_impl/compacted_db_impl.cc",
"db/db_impl/db_impl.cc",
"db/db_impl/db_impl_compaction_flush.cc",
Expand Down
3 changes: 2 additions & 1 deletion build_tools/check-sources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ git grep -n 'using namespace' -- ':!build_tools' ':!docs' \
':!third-party/gtest-1.8.1/fused-src/gtest/gtest.h' \
':!examples/speedb_with_ttl_example.cc' \
':!examples/enable_speedb_features_example.cc' \
':!examples/on_thread_start_callback_example.cc'
':!examples/on_thread_start_callback_example.cc' \
':!examples/speedb_non_blocking_compact_range_example.cc'
if [ "$?" != "1" ]; then
echo '^^^^ Do not use "using namespace"'
BAD=1
Expand Down
Loading

0 comments on commit 5709b4b

Please sign in to comment.