Skip to content

Commit

Permalink
Merge branch 'arbogdanov:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
yoori authored Dec 23, 2024
2 parents 209b97e + bca80c8 commit a2f37c7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif(CCACHE_FOUND)

option(WHITH_CACH "build with cach" ON)
option(WITH_JEMALLOC "build with JeMalloc" OFF)
option(WITH_LIBURING "build with liburing" ON)
option(WITH_SNAPPY "build with SNAPPY" OFF)
Expand Down Expand Up @@ -1012,11 +1013,17 @@ endif()
add_library(${ROCKSDB_STATIC_LIB} STATIC ${SOURCES} ${BUILD_VERSION_CC})
target_link_libraries(${ROCKSDB_STATIC_LIB} PRIVATE
${THIRDPARTY_LIBS} ${SYSTEM_LIBS})
if (WHITH_CACH)
target_compile_definitions(${ROCKSDB_STATIC_LIB} PRIVATE ROCKSDB_CACH_ENABLE=1)
endif()

if(ROCKSDB_BUILD_SHARED)
add_library(${ROCKSDB_SHARED_LIB} SHARED ${SOURCES} ${BUILD_VERSION_CC})
target_link_libraries(${ROCKSDB_SHARED_LIB} PRIVATE
${THIRDPARTY_LIBS} ${SYSTEM_LIBS})
if (WHITH_CACH)
target_compile_definitions(${ROCKSDB_SHARED_LIB} PRIVATE ROCKSDB_CACH_ENABLE=1)
endif()

if(WIN32)
set_target_properties(${ROCKSDB_SHARED_LIB} PROPERTIES
Expand Down
4 changes: 4 additions & 0 deletions db/version_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2315,13 +2315,17 @@ async_result Version::AsyncGet(const ReadOptions& read_options,
if (LIKELY(value != nullptr)) {
value->PinSelf();
}
co_return Status::OK();
} else {
if (key_exists != nullptr) {
*key_exists = false;
}
*status = Status::NotFound(); // Use an empty error message for speed
co_return Status::NotFound();
}

*status = Status::OK();
co_return Status::OK();
}

void Version::MultiGet(const ReadOptions& read_options, MultiGetRange* range,
Expand Down
4 changes: 4 additions & 0 deletions include/rocksdb/async_result.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ struct async_result {

void unhandled_exception() { std::exit(1); }

void return_value(std::nullptr_t)
{
}

void return_value(Status result) {
ret_back_promise->result_ = result;
ret_back_promise->result_set_ = true;
Expand Down
6 changes: 5 additions & 1 deletion table/block_based/block_based_table_reader_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,15 @@ async_result BlockBasedTable::AsyncNewDataBlockIterator(
? *uncompression_dict.GetValue()
: UncompressionDict::GetEmptyDict();

bool use_cache = false;
#ifdef ROCKSDB_CACH_ENABLE
use_cache = true;
#endif
CachableEntry<Block> block;
auto result =
AsyncRetrieveBlock(prefetch_buffer, ro, handle, dict, &block, block_type,
get_context, lookup_context, for_compaction,
/* use_cache */ true, /* wait_for_cache */ true);
use_cache, /* wait_for_cache */ true);
co_await result;
s = result.result();

Expand Down

0 comments on commit a2f37c7

Please sign in to comment.