diff --git a/bindings/c/CMakeLists.txt b/bindings/c/CMakeLists.txt index 3cf4f92f0f2..7f71a0f44ba 100644 --- a/bindings/c/CMakeLists.txt +++ b/bindings/c/CMakeLists.txt @@ -137,7 +137,6 @@ if(NOT WIN32) test/apitester/TesterUtil.h test/apitester/TesterWorkload.cpp test/apitester/TesterWorkload.h - ../../flow/SimpleOpt.h ) if(OPEN_FOR_IDE) @@ -193,7 +192,8 @@ if(NOT WIN32) else() target_link_libraries(fdb_c_api_tester PRIVATE fdb_c fdb_cpp toml11_target Threads::Threads fmt::fmt boost_target) endif() - target_include_directories(fdb_c_api_tester PRIVATE "${CMAKE_BINARY_DIR}/flow/include") + target_include_directories(fdb_c_api_tester PRIVATE "${CMAKE_SOURCE_DIR}/flow/include" "${CMAKE_BINARY_DIR}/flow/include") + target_link_libraries(fdb_c_api_tester PRIVATE SimpleOpt) # do not set RPATH for mako set_property(TARGET mako PROPERTY SKIP_BUILD_RPATH TRUE) diff --git a/bindings/c/test/apitester/fdb_c_api_tester.cpp b/bindings/c/test/apitester/fdb_c_api_tester.cpp index 879b65ab987..eb6aa920bb7 100644 --- a/bindings/c/test/apitester/fdb_c_api_tester.cpp +++ b/bindings/c/test/apitester/fdb_c_api_tester.cpp @@ -24,7 +24,7 @@ #include "TesterTransactionExecutor.h" #include "TesterTestSpec.h" #include "TesterUtil.h" -#include "flow/SimpleOpt.h" +#include "SimpleOpt/SimpleOpt.h" #include "test/fdb_api.hpp" #include diff --git a/bindings/flow/CMakeLists.txt b/bindings/flow/CMakeLists.txt index de03a7b4ae1..fa92d520ce0 100644 --- a/bindings/flow/CMakeLists.txt +++ b/bindings/flow/CMakeLists.txt @@ -16,7 +16,7 @@ set(SRCS fdb_flow.actor.cpp fdb_flow.h) -add_flow_target(STATIC_LIBRARY NAME fdb_flow SRCS ${SRCS} NO_COPY_HDR) +add_flow_target(STATIC_LIBRARY NAME fdb_flow SRCS ${SRCS}) target_link_libraries(fdb_flow PUBLIC fdb_c) target_link_libraries(fdb_flow PUBLIC fdbclient) target_include_directories(fdb_flow PUBLIC diff --git a/cmake/FlowCommands.cmake b/cmake/FlowCommands.cmake index ea94c7db7ea..f8dfe666531 100644 --- a/cmake/FlowCommands.cmake +++ b/cmake/FlowCommands.cmake @@ -64,9 +64,8 @@ function(generate_coverage_xml) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Generate coverage xml") endif() - add_custom_target(coverage_${target_name} DEPENDS ${target_file}) + add_custom_target(coverage_${target_name} ALL DEPENDS ${target_file}) add_dependencies(coverage_${target_name} coveragetool) - add_dependencies(${target_name} coverage_${target_name}) endfunction() # This function asserts that `versions.h` does not exist in the source @@ -190,7 +189,7 @@ endfunction() function(add_flow_target) set(options EXECUTABLE STATIC_LIBRARY - DYNAMIC_LIBRARY NO_COPY_HDR) + DYNAMIC_LIBRARY) set(oneValueArgs NAME) set(multiValueArgs SRCS COVERAGE_FILTER_OUT DISABLE_ACTOR_DIAGNOSTICS ADDL_SRCS) cmake_parse_arguments(AFT "${options}" "${oneValueArgs}" "${multiValueArgs}" "${ARGN}") @@ -200,9 +199,6 @@ function(add_flow_target) if(NOT AFT_SRCS) message(FATAL_ERROR "No sources provided") endif() - if(NOT AFT_NO_COPY_HDR) - copy_headers(NAME ${AFT_NAME} SRCS "${AFT_SRCS};${AFT_DISABLE_ACTOR_DIAGNOSTICS}" OUT_DIR incl_dir INC_DIR include_dir) - endif() #foreach(src IN LISTS AFT_SRCS) # is_header(h "${src}") # if(NOT h) @@ -214,6 +210,7 @@ function(add_flow_target) set(sources ${AFT_SRCS} ${AFT_ADDL_SRCS}) add_library(${AFT_NAME} OBJECT ${sources}) else() + create_build_dirs(${AFT_SRCS} ${AFT_DISABLE_ACTOR_DIAGNOSTICS}) foreach(src IN LISTS AFT_SRCS AFT_DISABLE_ACTOR_DIAGNOSTICS) is_header(hdr ${src}) set(in_filename "${src}") @@ -229,26 +226,11 @@ function(add_flow_target) set(out_filename "${src}") endif() - if(hdr AND NOT AFT_NO_COPY_HDR) - set(in_file "${incl_dir}/${in_filename}") - set(out_file "${incl_dir}/${out_filename}") + set(in_file "${CMAKE_CURRENT_SOURCE_DIR}/${in_filename}") + if(is_actor_file) + set(out_file "${CMAKE_CURRENT_BINARY_DIR}/${out_filename}") else() - set(in_file "${CMAKE_CURRENT_SOURCE_DIR}/${in_filename}") - if(is_actor_file) - set(out_file "${CMAKE_CURRENT_BINARY_DIR}/${out_filename}") - else() - set(out_file "${in_file}") - endif() - endif() - - is_prefix(in_src_dir "${CMAKE_CURRENT_SOURCE_DIR}" ${src}) - is_prefix(in_bin_dir "${CMAKE_CURRENT_BINARY_DIR}" ${src}) - if(NOT AFT_NO_COPY_HDR) - is_prefix(in_incl_dir "${incl_dir}" ${src}) - endif() - if(in_src_dir OR in_bin_dir) - set(in_file "${src}") - set(out_file "${src}") + set(out_file "${in_file}") endif() list(APPEND sources ${out_file}) @@ -307,10 +289,6 @@ function(add_flow_target) set_property(TARGET ${AFT_NAME} PROPERTY COVERAGE_FILTERS ${AFT_SRCS}) add_custom_target(${AFT_NAME}_actors DEPENDS ${generated_files}) - if(NOT AFT_NO_COPY_HDR) - target_include_directories("${AFT_NAME}" PUBLIC "${include_dir}") - add_dependencies(${AFT_NAME}_actors actorcompiler "${AFT_NAME}_incl") - endif() add_dependencies(${AFT_NAME} ${AFT_NAME}_actors) if(NOT WIN32) assert_no_version_h(${AFT_NAME}_actors) diff --git a/cmake/utils.cmake b/cmake/utils.cmake index cd45d2ea6c0..9e09e51f164 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -29,3 +29,40 @@ function(is_prefix out prefix str) endif() set(${out} ${res} PARENT_SCOPE) endfunction() + +function(create_build_dirs) + foreach(src IN LISTS ARGV) + get_filename_component(d "${src}" DIRECTORY) + if(IS_ABSOLUTE "${d}") + file(RELATIVE_PATH d "${CMAKE_CURRENT_SOURCE_DIR}" "${src}") + endif() + list(APPEND dirs "${d}") + endforeach() + list(REMOVE_DUPLICATES dirs) + foreach(dir IN LISTS dirs) + make_directory("${CMAKE_CURRENT_BINARY_DIR}/${dir}") + endforeach() +endfunction() + +function(fdb_find_sources out) + file(GLOB res + LIST_DIRECTORIES false + RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" + CONFIGURE_DEPENDS "*.cpp" "*.c" "*.h" "*.hpp") + file(GLOB_RECURSE res_includes + LIST_DIRECTORIES false + RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/include" + CONFIGURE_DEPENDS "include/*.cpp" "include/*.c" "include/*.h" "include/*.hpp") + file(GLOB_RECURSE res_workloads + LIST_DIRECTORIES false + RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/workloads" + CONFIGURE_DEPENDS "workloads/*.cpp" "workloads/*.c" "workloads/*.h" "workloads/*.hpp") + + foreach(f IN LISTS res_includes) + list(APPEND res "include/${f}") + endforeach() + foreach(f IN LISTS res_workloads) + list(APPEND res "workloads/${f}") + endforeach() + set(${out} "${res}" PARENT_SCOPE) +endfunction() diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index 3e6326ab6eb..b66780d09a8 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -1,8 +1,14 @@ add_library(rapidjson INTERFACE) target_include_directories(rapidjson INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/rapidjson) +add_subdirectory(crc32) +add_subdirectory(stacktrace) +add_subdirectory(folly_memcpy) +add_subdirectory(sqlite) +add_subdirectory(SimpleOpt) add_subdirectory(fmt-8.1.1) if(NOT WIN32) + add_subdirectory(linenoise) add_subdirectory(debug_determinism) add_subdirectory(monitoring) add_subdirectory(TraceLogHelper) diff --git a/contrib/SimpleOpt/CMakeLists.txt b/contrib/SimpleOpt/CMakeLists.txt new file mode 100644 index 00000000000..449e1bcd768 --- /dev/null +++ b/contrib/SimpleOpt/CMakeLists.txt @@ -0,0 +1,2 @@ +add_library(SimpleOpt INTERFACE) +target_include_directories(SimpleOpt INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") diff --git a/flow/SimpleOpt.h b/contrib/SimpleOpt/include/SimpleOpt/SimpleOpt.h similarity index 99% rename from flow/SimpleOpt.h rename to contrib/SimpleOpt/include/SimpleOpt/SimpleOpt.h index 96989fbe5b8..0b7030729b8 100644 --- a/flow/SimpleOpt.h +++ b/contrib/SimpleOpt/include/SimpleOpt/SimpleOpt.h @@ -78,7 +78,7 @@
  • Include the SimpleOpt.h header file
    -        \#include "flow/SimpleOpt.h"
    +        \#include "SimpleOpt/SimpleOpt.h"
             
  • Define an array of valid options for your program. diff --git a/contrib/crc32/CMakeLists.txt b/contrib/crc32/CMakeLists.txt new file mode 100644 index 00000000000..f93697c1a9e --- /dev/null +++ b/contrib/crc32/CMakeLists.txt @@ -0,0 +1,2 @@ +add_library(crc32 STATIC crc32.S crc32_wrapper.c crc32c.cpp) +target_include_directories(crc32 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") diff --git a/flow/crc32.S b/contrib/crc32/crc32.S similarity index 99% rename from flow/crc32.S rename to contrib/crc32/crc32.S index 3c7f2efa58d..3cfc2d10544 100644 --- a/flow/crc32.S +++ b/contrib/crc32/crc32.S @@ -58,7 +58,7 @@ #ifdef CRC32_CONSTANTS_HEADER #include CRC32_CONSTANTS_HEADER #else -#include "crc32_constants.h" +#include "crc32/crc32_constants.h" #endif .text diff --git a/flow/crc32_wrapper.c b/contrib/crc32/crc32_wrapper.c similarity index 98% rename from flow/crc32_wrapper.c rename to contrib/crc32/crc32_wrapper.c index fb08c9d007f..2edfd7778d4 100644 --- a/flow/crc32_wrapper.c +++ b/contrib/crc32/crc32_wrapper.c @@ -15,7 +15,7 @@ #ifdef CRC32_CONSTANTS_HEADER #include CRC32_CONSTANTS_HEADER #else -#include "crc32_constants.h" +#include "crc32/crc32_constants.h" #endif #define VMX_ALIGN 16 diff --git a/flow/crc32c-generated-constants.cpp b/contrib/crc32/crc32c-generated-constants.cpp similarity index 100% rename from flow/crc32c-generated-constants.cpp rename to contrib/crc32/crc32c-generated-constants.cpp diff --git a/flow/crc32c.cpp b/contrib/crc32/crc32c.cpp similarity index 86% rename from flow/crc32c.cpp rename to contrib/crc32/crc32c.cpp index 776e61b6987..79951280ad7 100644 --- a/flow/crc32c.cpp +++ b/contrib/crc32/crc32c.cpp @@ -25,7 +25,17 @@ #define _CRT_SECURE_NO_WARNINGS #endif -#include "flow/crc32c.h" +#if (defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)) +#define __unixish__ 1 +#endif + +#ifdef __unixish__ +#if !defined(__aarch64__) && !defined(__powerpc64__) +#include +#endif +#endif + +#include "crc32/crc32c.h" #if !defined(__aarch64__) && !defined(__powerpc64__) #include @@ -34,9 +44,40 @@ #include #include #include -#include "flow/Platform.h" #include "crc32c-generated-constants.cpp" +// CRC32C +#ifdef __aarch64__ +// aarch64 +#include +static inline uint32_t hwCrc32cU8(unsigned int crc, unsigned char v) { + uint32_t ret; + asm volatile("crc32cb %w[r], %w[c], %w[v]" : [r] "=r"(ret) : [c] "r"(crc), [v] "r"(v)); + return ret; +} +static inline uint32_t hwCrc32cU32(unsigned int crc, unsigned int v) { + uint32_t ret; + asm volatile("crc32cw %w[r], %w[c], %w[v]" : [r] "=r"(ret) : [c] "r"(crc), [v] "r"(v)); + return ret; +} +#ifdef _M_X64 +static inline uint64_t hwCrc32cU64(uint64_t crc, uint64_t v) { + uint64_t ret; + asm volatile("crc32cx %w[r], %w[c], %x[v]" : [r] "=r"(ret) : [c] "r"(crc), [v] "r"(v)); + return ret; +} +#endif +#else +#ifndef __powerpc64__ +// Intel +#define hwCrc32cU8(c, v) _mm_crc32_u8(c, v) +#define hwCrc32cU32(c, v) _mm_crc32_u32(c, v) +#ifdef _M_X64 +#define hwCrc32cU64(c, v) _mm_crc32_u64(c, v) +#endif +#endif +#endif + [[maybe_unused]] static uint32_t append_trivial(uint32_t crc, const uint8_t* input, size_t length) { for (size_t i = 0; i < length; ++i) { crc = crc ^ input[i]; @@ -278,7 +319,25 @@ uint32_t ppc_hw(uint32_t crc, const uint8_t* input, size_t length) { } #endif -static bool hw_available = platform::isHwCrcSupported(); +bool isHwCrcSupported() { +#if defined(_WIN32) + int info[4]; + __cpuid(info, 1); + return (info[2] & (1 << 20)) != 0; +#elif defined(__aarch64__) + return true; /* force to use crc instructions */ +#elif defined(__powerpc64__) + return false; /* force not to use crc instructions */ +#elif defined(__unixish__) + uint32_t eax, ebx, ecx, edx, level = 1, count = 0; + __cpuid_count(level, count, eax, ebx, ecx, edx); + return ((ecx >> 20) & 1) != 0; +#else +#error Port me! +#endif +} + +static bool hw_available = isHwCrcSupported(); extern "C" uint32_t crc32c_append(uint32_t crc, const uint8_t* input, size_t length) { if (hw_available) { diff --git a/flow/crc32_constants.h b/contrib/crc32/include/crc32/crc32_constants.h similarity index 100% rename from flow/crc32_constants.h rename to contrib/crc32/include/crc32/crc32_constants.h diff --git a/flow/crc32_wrapper.h b/contrib/crc32/include/crc32/crc32_wrapper.h similarity index 100% rename from flow/crc32_wrapper.h rename to contrib/crc32/include/crc32/crc32_wrapper.h diff --git a/flow/crc32c.h b/contrib/crc32/include/crc32/crc32c.h similarity index 100% rename from flow/crc32c.h rename to contrib/crc32/include/crc32/crc32c.h diff --git a/contrib/folly_memcpy/CMakeLists.txt b/contrib/folly_memcpy/CMakeLists.txt new file mode 100644 index 00000000000..d7b8b4f84e1 --- /dev/null +++ b/contrib/folly_memcpy/CMakeLists.txt @@ -0,0 +1,4 @@ +if(UNIX AND NOT APPLE) + add_library(folly_memcpy STATIC folly_memcpy.S) + target_include_directories(folly_memcpy PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") +endif() diff --git a/flow/folly_memcpy.S b/contrib/folly_memcpy/folly_memcpy.S similarity index 100% rename from flow/folly_memcpy.S rename to contrib/folly_memcpy/folly_memcpy.S diff --git a/flow/folly_memcpy.h b/contrib/folly_memcpy/folly_memcpy.h similarity index 100% rename from flow/folly_memcpy.h rename to contrib/folly_memcpy/folly_memcpy.h diff --git a/contrib/linenoise/CMakeLists.txt b/contrib/linenoise/CMakeLists.txt new file mode 100644 index 00000000000..52487a6f228 --- /dev/null +++ b/contrib/linenoise/CMakeLists.txt @@ -0,0 +1,2 @@ +add_library(linenoise STATIC linenoise.c) +target_include_directories(linenoise PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") diff --git a/fdbcli/linenoise/linenoise.h b/contrib/linenoise/include/linenoise/linenoise.h similarity index 100% rename from fdbcli/linenoise/linenoise.h rename to contrib/linenoise/include/linenoise/linenoise.h diff --git a/fdbcli/linenoise/linenoise.c b/contrib/linenoise/linenoise.c similarity index 99% rename from fdbcli/linenoise/linenoise.c rename to contrib/linenoise/linenoise.c index df0bcb10c73..df2b3b0e728 100644 --- a/fdbcli/linenoise/linenoise.c +++ b/contrib/linenoise/linenoise.c @@ -115,7 +115,7 @@ #include #include #include -#include "linenoise.h" +#include "linenoise/linenoise.h" #define LINENOISE_DEFAULT_HISTORY_MAX_LEN 100 #define LINENOISE_MAX_LINE 4096 diff --git a/contrib/sqlite/CMakeLists.txt b/contrib/sqlite/CMakeLists.txt new file mode 100644 index 00000000000..b133664b5a1 --- /dev/null +++ b/contrib/sqlite/CMakeLists.txt @@ -0,0 +1,16 @@ +add_library(sqlite STATIC + btree.h + hash.h + sqlite3.h + sqlite3ext.h + sqliteInt.h + sqliteLimit.h + sqlite3.amalgamation.c) + + +target_include_directories(sqlite PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +# Suppress warnings in sqlite since it's third party +if(NOT WIN32) + target_compile_definitions(sqlite PRIVATE $<$:NDEBUG>) + target_compile_options(sqlite BEFORE PRIVATE -w) # disable warnings for third party +endif() diff --git a/fdbserver/sqlite/btree.c b/contrib/sqlite/btree.c similarity index 100% rename from fdbserver/sqlite/btree.c rename to contrib/sqlite/btree.c diff --git a/fdbserver/sqlite/btree.h b/contrib/sqlite/btree.h similarity index 100% rename from fdbserver/sqlite/btree.h rename to contrib/sqlite/btree.h diff --git a/fdbserver/sqlite/hash.h b/contrib/sqlite/hash.h similarity index 100% rename from fdbserver/sqlite/hash.h rename to contrib/sqlite/hash.h diff --git a/fdbserver/sqlite/shell.c b/contrib/sqlite/shell.c similarity index 100% rename from fdbserver/sqlite/shell.c rename to contrib/sqlite/shell.c diff --git a/fdbserver/sqlite/sqlite3.amalgamation.c b/contrib/sqlite/sqlite3.amalgamation.c similarity index 100% rename from fdbserver/sqlite/sqlite3.amalgamation.c rename to contrib/sqlite/sqlite3.amalgamation.c diff --git a/fdbserver/sqlite/sqlite3.h b/contrib/sqlite/sqlite3.h similarity index 100% rename from fdbserver/sqlite/sqlite3.h rename to contrib/sqlite/sqlite3.h diff --git a/fdbserver/sqlite/sqlite3ext.h b/contrib/sqlite/sqlite3ext.h similarity index 100% rename from fdbserver/sqlite/sqlite3ext.h rename to contrib/sqlite/sqlite3ext.h diff --git a/fdbserver/sqlite/sqliteInt.h b/contrib/sqlite/sqliteInt.h similarity index 100% rename from fdbserver/sqlite/sqliteInt.h rename to contrib/sqlite/sqliteInt.h diff --git a/fdbserver/sqlite/sqliteLimit.h b/contrib/sqlite/sqliteLimit.h similarity index 100% rename from fdbserver/sqlite/sqliteLimit.h rename to contrib/sqlite/sqliteLimit.h diff --git a/contrib/stacktrace/CMakeLists.txt b/contrib/stacktrace/CMakeLists.txt new file mode 100644 index 00000000000..f82b4b6a6c3 --- /dev/null +++ b/contrib/stacktrace/CMakeLists.txt @@ -0,0 +1,11 @@ +add_library(stacktrace STATIC stacktrace.amalgamation.cpp) +target_include_directories(stacktrace PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") +if (USE_ASAN) + target_compile_definitions(stacktrace PRIVATE ADDRESS_SANITIZER) +elseif(USE_MSAN) + target_compile_definitions(stacktrace PRIVATE MEMORY_SANITIZER) +elseif(USE_UBSAN) + target_compile_definitions(stacktrace PRIVATE UNDEFINED_BEHAVIOR_SANITIZER) +elseif(USE_TSAN) + target_compile_definitions(stacktrace PRIVATE THREAD_SANITIZER DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1) +endif() diff --git a/flow/stacktrace.h b/contrib/stacktrace/include/stacktrace/stacktrace.h similarity index 100% rename from flow/stacktrace.h rename to contrib/stacktrace/include/stacktrace/stacktrace.h diff --git a/flow/stacktrace.amalgamation.cpp b/contrib/stacktrace/stacktrace.amalgamation.cpp similarity index 100% rename from flow/stacktrace.amalgamation.cpp rename to contrib/stacktrace/stacktrace.amalgamation.cpp diff --git a/flow/stacktrace_internal/stacktrace_aarch64-inl.inc b/contrib/stacktrace/stacktrace_internal/stacktrace_aarch64-inl.inc similarity index 100% rename from flow/stacktrace_internal/stacktrace_aarch64-inl.inc rename to contrib/stacktrace/stacktrace_internal/stacktrace_aarch64-inl.inc diff --git a/flow/stacktrace_internal/stacktrace_arm-inl.inc b/contrib/stacktrace/stacktrace_internal/stacktrace_arm-inl.inc similarity index 100% rename from flow/stacktrace_internal/stacktrace_arm-inl.inc rename to contrib/stacktrace/stacktrace_internal/stacktrace_arm-inl.inc diff --git a/flow/stacktrace_internal/stacktrace_generic-inl.inc b/contrib/stacktrace/stacktrace_internal/stacktrace_generic-inl.inc similarity index 100% rename from flow/stacktrace_internal/stacktrace_generic-inl.inc rename to contrib/stacktrace/stacktrace_internal/stacktrace_generic-inl.inc diff --git a/flow/stacktrace_internal/stacktrace_powerpc-inl.inc b/contrib/stacktrace/stacktrace_internal/stacktrace_powerpc-inl.inc similarity index 100% rename from flow/stacktrace_internal/stacktrace_powerpc-inl.inc rename to contrib/stacktrace/stacktrace_internal/stacktrace_powerpc-inl.inc diff --git a/flow/stacktrace_internal/stacktrace_unimplemented-inl.inc b/contrib/stacktrace/stacktrace_internal/stacktrace_unimplemented-inl.inc similarity index 100% rename from flow/stacktrace_internal/stacktrace_unimplemented-inl.inc rename to contrib/stacktrace/stacktrace_internal/stacktrace_unimplemented-inl.inc diff --git a/flow/stacktrace_internal/stacktrace_win32-inl.inc b/contrib/stacktrace/stacktrace_internal/stacktrace_win32-inl.inc similarity index 100% rename from flow/stacktrace_internal/stacktrace_win32-inl.inc rename to contrib/stacktrace/stacktrace_internal/stacktrace_win32-inl.inc diff --git a/flow/stacktrace_internal/stacktrace_x86-inl.inc b/contrib/stacktrace/stacktrace_internal/stacktrace_x86-inl.inc similarity index 100% rename from flow/stacktrace_internal/stacktrace_x86-inl.inc rename to contrib/stacktrace/stacktrace_internal/stacktrace_x86-inl.inc diff --git a/fdbbackup/CMakeLists.txt b/fdbbackup/CMakeLists.txt index da2457b8500..c783afd7c07 100644 --- a/fdbbackup/CMakeLists.txt +++ b/fdbbackup/CMakeLists.txt @@ -1,23 +1,22 @@ set(FDBBACKUP_SRCS - BackupTLSConfig.h BackupTLSConfig.cpp backup.actor.cpp) add_flow_target(EXECUTABLE NAME fdbbackup SRCS ${FDBBACKUP_SRCS}) +target_include_directories(fdbbackup PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}/include") target_link_libraries(fdbbackup PRIVATE fdbclient) set(FDBCONVERT_SRCS - FileConverter.actor.cpp - FileConverter.h) + FileConverter.actor.cpp) add_flow_target(EXECUTABLE NAME fdbconvert SRCS ${FDBCONVERT_SRCS}) +target_include_directories(fdbconvert PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}/include") target_link_libraries(fdbconvert PRIVATE fdbclient) set(FDBDECODE_SRCS - BackupTLSConfig.h BackupTLSConfig.cpp - FileDecoder.actor.cpp - FileConverter.h) + FileDecoder.actor.cpp) add_flow_target(EXECUTABLE NAME fdbdecode SRCS ${FDBDECODE_SRCS}) +target_include_directories(fdbdecode PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}/include") target_link_libraries(fdbdecode PRIVATE fdbclient) if(NOT OPEN_FOR_IDE) diff --git a/fdbbackup/backup.actor.cpp b/fdbbackup/backup.actor.cpp index 96b6aded34a..42c857f835e 100644 --- a/fdbbackup/backup.actor.cpp +++ b/fdbbackup/backup.actor.cpp @@ -74,7 +74,7 @@ #include "fdbclient/versions.h" #include "fdbclient/BuildFlags.h" -#include "flow/SimpleOpt.h" +#include "SimpleOpt/SimpleOpt.h" #include "flow/actorcompiler.h" // This must be the last #include. // Type of program being executed diff --git a/fdbbackup/BackupTLSConfig.h b/fdbbackup/include/fdbbackup/BackupTLSConfig.h similarity index 100% rename from fdbbackup/BackupTLSConfig.h rename to fdbbackup/include/fdbbackup/BackupTLSConfig.h diff --git a/fdbbackup/FileConverter.h b/fdbbackup/include/fdbbackup/FileConverter.h similarity index 99% rename from fdbbackup/FileConverter.h rename to fdbbackup/include/fdbbackup/FileConverter.h index 37a5c3f7611..730df0f7d34 100644 --- a/fdbbackup/FileConverter.h +++ b/fdbbackup/include/fdbbackup/FileConverter.h @@ -23,7 +23,7 @@ #pragma once #include -#include "flow/SimpleOpt.h" +#include "SimpleOpt/SimpleOpt.h" #include "flow/TLSConfig.actor.h" namespace file_converter { diff --git a/fdbcli/CMakeLists.txt b/fdbcli/CMakeLists.txt index 00d37067e01..aff53b1f639 100644 --- a/fdbcli/CMakeLists.txt +++ b/fdbcli/CMakeLists.txt @@ -1,44 +1,13 @@ -set(FDBCLI_SRCS - fdbcli.actor.cpp - fdbcli.actor.h - AdvanceVersionCommand.actor.cpp - BlobRangeCommand.actor.cpp - CacheRangeCommand.actor.cpp - ConfigureCommand.actor.cpp - ConsistencyCheckCommand.actor.cpp - CoordinatorsCommand.actor.cpp - DataDistributionCommand.actor.cpp - ExcludeCommand.actor.cpp - ExpensiveDataCheckCommand.actor.cpp - FileConfigureCommand.actor.cpp - FlowLineNoise.actor.cpp - FlowLineNoise.h - ForceRecoveryWithDataLossCommand.actor.cpp - IncludeCommand.actor.cpp - KillCommand.actor.cpp - LockCommand.actor.cpp - ChangeFeedCommand.actor.cpp - MaintenanceCommand.actor.cpp - ProfileCommand.actor.cpp - SetClassCommand.actor.cpp - SnapshotCommand.actor.cpp - StatusCommand.actor.cpp - SuspendCommand.actor.cpp - TenantCommands.actor.cpp - ThrottleCommand.actor.cpp - TriggerDDTeamInfoLogCommand.actor.cpp - TssqCommand.actor.cpp - Util.actor.cpp - VersionEpochCommand.actor.cpp - linenoise/linenoise.h) +fdb_find_sources(FDBCLI_SRCS) + +add_flow_target(EXECUTABLE NAME fdbcli SRCS ${FDBCLI_SRCS}) +target_include_directories(fdbcli PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}/include") +target_link_libraries(fdbcli PRIVATE fdbclient SimpleOpt) if(NOT WIN32) - list(APPEND FDBCLI_SRCS linenoise/linenoise.c) + target_link_libraries(fdbcli PRIVATE linenoise) endif() -add_flow_target(EXECUTABLE NAME fdbcli SRCS ${FDBCLI_SRCS}) -target_link_libraries(fdbcli PRIVATE fdbclient) - if(NOT OPEN_FOR_IDE) if(GENERATE_DEBUG_PACKAGES) fdb_install(TARGETS fdbcli DESTINATION bin COMPONENT clients) diff --git a/fdbcli/FlowLineNoise.actor.cpp b/fdbcli/FlowLineNoise.actor.cpp index 1029de30b44..7d4dd9d1e9a 100644 --- a/fdbcli/FlowLineNoise.actor.cpp +++ b/fdbcli/FlowLineNoise.actor.cpp @@ -30,7 +30,7 @@ #if __unixish__ #define HAVE_LINENOISE 1 -#include "fdbcli/linenoise/linenoise.h" +#include "linenoise/linenoise.h" #else #define HAVE_LINENOISE 0 #endif diff --git a/fdbcli/fdbcli.actor.cpp b/fdbcli/fdbcli.actor.cpp index 7b439e3e298..4191f39fa79 100644 --- a/fdbcli/fdbcli.actor.cpp +++ b/fdbcli/fdbcli.actor.cpp @@ -52,7 +52,7 @@ #include "flow/TLSConfig.actor.h" #include "flow/ThreadHelper.actor.h" -#include "flow/SimpleOpt.h" +#include "SimpleOpt/SimpleOpt.h" #include "fdbcli/FlowLineNoise.h" #include "fdbcli/fdbcli.actor.h" @@ -64,7 +64,7 @@ #ifdef __unixish__ #include -#include "fdbcli/linenoise/linenoise.h" +#include "linenoise/linenoise.h" #endif #include "fdbclient/versions.h" diff --git a/fdbcli/FlowLineNoise.h b/fdbcli/include/fdbcli/FlowLineNoise.h similarity index 100% rename from fdbcli/FlowLineNoise.h rename to fdbcli/include/fdbcli/FlowLineNoise.h diff --git a/fdbcli/fdbcli.actor.h b/fdbcli/include/fdbcli/fdbcli.actor.h similarity index 100% rename from fdbcli/fdbcli.actor.h rename to fdbcli/include/fdbcli/fdbcli.actor.h diff --git a/fdbclient/CMakeLists.txt b/fdbclient/CMakeLists.txt index 79a06515e5c..37906fc3008 100644 --- a/fdbclient/CMakeLists.txt +++ b/fdbclient/CMakeLists.txt @@ -1,200 +1,8 @@ -set(FDBCLIENT_SRCS - ActorLineageProfiler.h - ActorLineageProfiler.cpp - AnnotateActor.h - AnnotateActor.cpp - AsyncFileS3BlobStore.actor.cpp - AsyncFileS3BlobStore.actor.h - AsyncTaskThread.actor.cpp - AsyncTaskThread.h - Atomic.h - AutoPublicAddress.cpp - BackupAgent.actor.h - BackupAgentBase.actor.cpp - BackupContainer.actor.cpp - BackupContainer.h - BackupContainerFileSystem.actor.cpp - BackupContainerFileSystem.h - BackupContainerLocalDirectory.actor.cpp - BackupContainerLocalDirectory.h - BackupContainerS3BlobStore.actor.cpp - BackupContainerS3BlobStore.h - BlobConnectionProvider.h - BlobConnectionProvider.cpp - BlobWorkerInterface.h - BlobGranuleReader.actor.cpp - BlobGranuleReader.actor.h - BlobGranuleCommon.h - BlobGranuleFiles.cpp - BlobGranuleFiles.h - BlobMetadataUtils.h - BlobWorkerCommon.h - ClientBooleanParams.cpp - ClientBooleanParams.h - ClientKnobCollection.cpp - ClientKnobCollection.h - ClientKnobs.cpp - ClientKnobs.h - ClientLogEvents.h - ClientVersion.h - ClientWorkerInterface.h - ClusterConnectionFile.actor.cpp - ClusterConnectionFile.h - ClusterConnectionKey.actor.cpp - ClusterConnectionKey.actor.h - ClusterConnectionMemoryRecord.actor.cpp - ClusterConnectionMemoryRecord.h - ClusterInterface.h - CommitProxyInterface.h - CommitTransaction.h - ConfigKnobs.cpp - ConfigKnobs.h - ConfigTransactionInterface.cpp - ConfigTransactionInterface.h - ConvertUTF.h - CoordinationInterface.h - DatabaseBackupAgent.actor.cpp - DatabaseConfiguration.cpp - DatabaseConfiguration.h - DatabaseContext.h - EventTypes.actor.h - FDBOptions.h - FDBTypes.cpp - FDBTypes.h - FluentDSampleIngestor.cpp - FileBackupAgent.actor.cpp - GenericManagementAPI.actor.h - GenericTransactionHelper.h - GlobalConfig.h - GlobalConfig.actor.h - GlobalConfig.actor.cpp - GrvProxyInterface.h - HTTP.h - HTTP.actor.cpp - HighContentionPrefixAllocator.actor.h - IClientApi.h - IConfigTransaction.cpp - IConfigTransaction.h - ISingleThreadTransaction.cpp - ISingleThreadTransaction.h - JSONDoc.h - JsonBuilder.cpp - JsonBuilder.h - KeyBackedTypes.h - KeyRangeMap.actor.cpp - KeyRangeMap.h - Knobs.h - IKnobCollection.cpp - IKnobCollection.h - LocalClientAPI.cpp - LocalClientAPI.h - ManagementAPI.actor.cpp - ManagementAPI.actor.h - MonitorLeader.actor.cpp - MonitorLeader.h - MultiVersionAssignmentVars.h - MultiVersionTransaction.actor.cpp - MultiVersionTransaction.h - MutationList.h - MutationLogReader.actor.cpp - MutationLogReader.actor.h - NameLineage.h - NameLineage.cpp - NativeAPI.actor.cpp - NativeAPI.actor.h - Notified.h - ParallelStream.actor.cpp - ParallelStream.actor.h - PaxosConfigTransaction.actor.cpp - PaxosConfigTransaction.h - PImpl.h - ProcessInterface.h - SimpleConfigTransaction.actor.cpp - SpecialKeySpace.actor.cpp - SpecialKeySpace.actor.h - RESTClient.h - RESTClient.actor.cpp - RESTUtils.h - RESTUtils.actor.cpp - ReadYourWrites.actor.cpp - ReadYourWrites.h - RestoreInterface.cpp - RestoreInterface.h - RunTransaction.actor.h - RYWIterator.cpp - RYWIterator.h - S3BlobStore.h - S3BlobStore.actor.cpp - Schemas.cpp - Schemas.h - ServerKnobCollection.cpp - ServerKnobCollection.h - ServerKnobs.cpp - ServerKnobs.h - SimpleConfigTransaction.h - SimpleIni.h - SnapshotCache.h - SpecialKeySpace.actor.cpp - SpecialKeySpace.actor.h - Status.h - StatusClient.actor.cpp - StatusClient.h - StorageServerInterface.cpp - StorageServerInterface.h - StorageCheckpoint.h - Subspace.cpp - Subspace.h - StackLineage.h - StackLineage.cpp - SystemData.cpp - SystemData.h - TagThrottle.actor.cpp - TagThrottle.actor.h - TaskBucket.actor.cpp - TaskBucket.h - Tenant.cpp - Tenant.h - TenantManagement.actor.h - TenantSpecialKeys.actor.cpp - TestKnobCollection.cpp - TestKnobCollection.h - ThreadSafeTransaction.cpp - ThreadSafeTransaction.h - Tracing.h - Tracing.actor.cpp - TransactionLineage.h - Tuple.cpp - Tuple.h - VersionedMap.actor.h - VersionedMap.h - VersionedMap.cpp - Versionstamp.cpp - Versionstamp.h - VersionVector.h - VersionVector.cpp - WriteMap.h - WriteMap.cpp - json_spirit/json_spirit_error_position.h - json_spirit/json_spirit_reader_template.h - json_spirit/json_spirit_value.h - json_spirit/json_spirit_writer_options.h - json_spirit/json_spirit_writer_template.h - libb64/encode.h - libb64/decode.h - libb64/cdecode.h - libb64/cdecode.c - libb64/cencode.h - libb64/cencode.c - md5/md5.h - md5/md5.c - rapidxml/rapidxml.hpp - rapidxml/rapidxml_iterators.hpp - rapidxml/rapidxml_print.hpp - rapidxml/rapidxml_utils.hpp - sha1/SHA1.h +fdb_find_sources(FDBCLIENT_SRCS) +list(APPEND FDBCLIENT_SRCS sha1/SHA1.cpp - zipf.c - zipf.h) + libb64/cdecode.c + libb64/cencode.c) message(STATUS "FDB version is ${FDB_VERSION}") message(STATUS "FDB package name is ${FDB_PACKAGE_NAME}") @@ -227,8 +35,7 @@ if(BUILD_AZURE_BACKUP) add_compile_definitions(BUILD_AZURE_BACKUP) set(FDBCLIENT_SRCS ${FDBCLIENT_SRCS} - BackupContainerAzureBlobStore.actor.cpp - BackupContainerAzureBlobStore.h) + azure_backup/BackupContainerAzureBlobStore.actor.cpp) configure_file(azurestorage.cmake azurestorage-download/CMakeLists.txt) @@ -270,6 +77,7 @@ if(WITH_AWS_BACKUP) endif() add_flow_target(STATIC_LIBRARY NAME fdbclient SRCS ${FDBCLIENT_SRCS} ADDL_SRCS ${options_srcs}) +target_include_directories(fdbclient PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}/include") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/versions.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/include/fdbclient/versions.h) add_dependencies(fdbclient fdboptions) target_link_libraries(fdbclient PUBLIC fdbrpc msgpack) @@ -278,6 +86,7 @@ target_link_libraries(fdbclient PUBLIC fdbrpc msgpack) # fdbserver retain sampling functionality in client code while disabling # sampling for pure clients. add_flow_target(STATIC_LIBRARY NAME fdbclient_sampling SRCS ${FDBCLIENT_SRCS} ADDL_SRCS ${options_srcs}) +target_include_directories(fdbclient_sampling PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}/include") add_dependencies(fdbclient_sampling fdboptions) target_link_libraries(fdbclient_sampling PUBLIC fdbrpc_sampling msgpack) target_compile_definitions(fdbclient_sampling PRIVATE -DENABLE_SAMPLING) diff --git a/fdbclient/StorageServerInterface.cpp b/fdbclient/StorageServerInterface.cpp index b7efbfbc836..8a9b6183a46 100644 --- a/fdbclient/StorageServerInterface.cpp +++ b/fdbclient/StorageServerInterface.cpp @@ -21,7 +21,7 @@ // TODO this should really be renamed "TSSComparison.cpp" #include "fdbclient/StorageServerInterface.h" #include "fdbclient/BlobWorkerInterface.h" -#include "flow/crc32c.h" // for crc32c_append, to checksum values in tss trace events +#include "crc32/crc32c.h" // for crc32c_append, to checksum values in tss trace events // Includes template specializations for all tss operations on storage server types. // New StorageServerInterface reply types must be added here or it won't compile. diff --git a/fdbclient/BackupContainerAzureBlobStore.actor.cpp b/fdbclient/azure_backup/BackupContainerAzureBlobStore.actor.cpp similarity index 100% rename from fdbclient/BackupContainerAzureBlobStore.actor.cpp rename to fdbclient/azure_backup/BackupContainerAzureBlobStore.actor.cpp diff --git a/fdbclient/ActorLineageProfiler.h b/fdbclient/include/fdbclient/ActorLineageProfiler.h similarity index 100% rename from fdbclient/ActorLineageProfiler.h rename to fdbclient/include/fdbclient/ActorLineageProfiler.h diff --git a/fdbclient/AnnotateActor.h b/fdbclient/include/fdbclient/AnnotateActor.h similarity index 100% rename from fdbclient/AnnotateActor.h rename to fdbclient/include/fdbclient/AnnotateActor.h diff --git a/fdbclient/AsyncFileS3BlobStore.actor.h b/fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h similarity index 100% rename from fdbclient/AsyncFileS3BlobStore.actor.h rename to fdbclient/include/fdbclient/AsyncFileS3BlobStore.actor.h diff --git a/fdbclient/AsyncTaskThread.h b/fdbclient/include/fdbclient/AsyncTaskThread.h similarity index 100% rename from fdbclient/AsyncTaskThread.h rename to fdbclient/include/fdbclient/AsyncTaskThread.h diff --git a/fdbclient/Atomic.h b/fdbclient/include/fdbclient/Atomic.h similarity index 100% rename from fdbclient/Atomic.h rename to fdbclient/include/fdbclient/Atomic.h diff --git a/fdbclient/BackupAgent.actor.h b/fdbclient/include/fdbclient/BackupAgent.actor.h similarity index 100% rename from fdbclient/BackupAgent.actor.h rename to fdbclient/include/fdbclient/BackupAgent.actor.h diff --git a/fdbclient/BackupContainer.h b/fdbclient/include/fdbclient/BackupContainer.h similarity index 100% rename from fdbclient/BackupContainer.h rename to fdbclient/include/fdbclient/BackupContainer.h diff --git a/fdbclient/BackupContainerAzureBlobStore.h b/fdbclient/include/fdbclient/BackupContainerAzureBlobStore.h similarity index 100% rename from fdbclient/BackupContainerAzureBlobStore.h rename to fdbclient/include/fdbclient/BackupContainerAzureBlobStore.h diff --git a/fdbclient/BackupContainerFileSystem.h b/fdbclient/include/fdbclient/BackupContainerFileSystem.h similarity index 100% rename from fdbclient/BackupContainerFileSystem.h rename to fdbclient/include/fdbclient/BackupContainerFileSystem.h diff --git a/fdbclient/BackupContainerLocalDirectory.h b/fdbclient/include/fdbclient/BackupContainerLocalDirectory.h similarity index 100% rename from fdbclient/BackupContainerLocalDirectory.h rename to fdbclient/include/fdbclient/BackupContainerLocalDirectory.h diff --git a/fdbclient/BackupContainerS3BlobStore.h b/fdbclient/include/fdbclient/BackupContainerS3BlobStore.h similarity index 100% rename from fdbclient/BackupContainerS3BlobStore.h rename to fdbclient/include/fdbclient/BackupContainerS3BlobStore.h diff --git a/fdbclient/BlobConnectionProvider.h b/fdbclient/include/fdbclient/BlobConnectionProvider.h similarity index 100% rename from fdbclient/BlobConnectionProvider.h rename to fdbclient/include/fdbclient/BlobConnectionProvider.h diff --git a/fdbclient/BlobGranuleCommon.h b/fdbclient/include/fdbclient/BlobGranuleCommon.h similarity index 100% rename from fdbclient/BlobGranuleCommon.h rename to fdbclient/include/fdbclient/BlobGranuleCommon.h diff --git a/fdbclient/BlobGranuleFiles.h b/fdbclient/include/fdbclient/BlobGranuleFiles.h similarity index 100% rename from fdbclient/BlobGranuleFiles.h rename to fdbclient/include/fdbclient/BlobGranuleFiles.h diff --git a/fdbclient/BlobGranuleReader.actor.h b/fdbclient/include/fdbclient/BlobGranuleReader.actor.h similarity index 100% rename from fdbclient/BlobGranuleReader.actor.h rename to fdbclient/include/fdbclient/BlobGranuleReader.actor.h diff --git a/fdbclient/BlobMetadataUtils.h b/fdbclient/include/fdbclient/BlobMetadataUtils.h similarity index 100% rename from fdbclient/BlobMetadataUtils.h rename to fdbclient/include/fdbclient/BlobMetadataUtils.h diff --git a/fdbclient/BlobWorkerCommon.h b/fdbclient/include/fdbclient/BlobWorkerCommon.h similarity index 100% rename from fdbclient/BlobWorkerCommon.h rename to fdbclient/include/fdbclient/BlobWorkerCommon.h diff --git a/fdbclient/BlobWorkerInterface.h b/fdbclient/include/fdbclient/BlobWorkerInterface.h similarity index 100% rename from fdbclient/BlobWorkerInterface.h rename to fdbclient/include/fdbclient/BlobWorkerInterface.h diff --git a/fdbclient/ClientBooleanParams.h b/fdbclient/include/fdbclient/ClientBooleanParams.h similarity index 100% rename from fdbclient/ClientBooleanParams.h rename to fdbclient/include/fdbclient/ClientBooleanParams.h diff --git a/fdbclient/ClientKnobCollection.h b/fdbclient/include/fdbclient/ClientKnobCollection.h similarity index 100% rename from fdbclient/ClientKnobCollection.h rename to fdbclient/include/fdbclient/ClientKnobCollection.h diff --git a/fdbclient/ClientKnobs.h b/fdbclient/include/fdbclient/ClientKnobs.h similarity index 100% rename from fdbclient/ClientKnobs.h rename to fdbclient/include/fdbclient/ClientKnobs.h diff --git a/fdbclient/ClientLogEvents.h b/fdbclient/include/fdbclient/ClientLogEvents.h similarity index 100% rename from fdbclient/ClientLogEvents.h rename to fdbclient/include/fdbclient/ClientLogEvents.h diff --git a/fdbclient/ClientVersion.h b/fdbclient/include/fdbclient/ClientVersion.h similarity index 100% rename from fdbclient/ClientVersion.h rename to fdbclient/include/fdbclient/ClientVersion.h diff --git a/fdbclient/ClientWorkerInterface.h b/fdbclient/include/fdbclient/ClientWorkerInterface.h similarity index 100% rename from fdbclient/ClientWorkerInterface.h rename to fdbclient/include/fdbclient/ClientWorkerInterface.h diff --git a/fdbclient/ClusterConnectionFile.h b/fdbclient/include/fdbclient/ClusterConnectionFile.h similarity index 100% rename from fdbclient/ClusterConnectionFile.h rename to fdbclient/include/fdbclient/ClusterConnectionFile.h diff --git a/fdbclient/ClusterConnectionKey.actor.h b/fdbclient/include/fdbclient/ClusterConnectionKey.actor.h similarity index 100% rename from fdbclient/ClusterConnectionKey.actor.h rename to fdbclient/include/fdbclient/ClusterConnectionKey.actor.h diff --git a/fdbclient/ClusterConnectionMemoryRecord.h b/fdbclient/include/fdbclient/ClusterConnectionMemoryRecord.h similarity index 100% rename from fdbclient/ClusterConnectionMemoryRecord.h rename to fdbclient/include/fdbclient/ClusterConnectionMemoryRecord.h diff --git a/fdbclient/ClusterInterface.h b/fdbclient/include/fdbclient/ClusterInterface.h similarity index 100% rename from fdbclient/ClusterInterface.h rename to fdbclient/include/fdbclient/ClusterInterface.h diff --git a/fdbclient/CommitProxyInterface.h b/fdbclient/include/fdbclient/CommitProxyInterface.h similarity index 100% rename from fdbclient/CommitProxyInterface.h rename to fdbclient/include/fdbclient/CommitProxyInterface.h diff --git a/fdbclient/CommitTransaction.h b/fdbclient/include/fdbclient/CommitTransaction.h similarity index 100% rename from fdbclient/CommitTransaction.h rename to fdbclient/include/fdbclient/CommitTransaction.h diff --git a/fdbclient/ConfigKnobs.h b/fdbclient/include/fdbclient/ConfigKnobs.h similarity index 100% rename from fdbclient/ConfigKnobs.h rename to fdbclient/include/fdbclient/ConfigKnobs.h diff --git a/fdbclient/ConfigTransactionInterface.h b/fdbclient/include/fdbclient/ConfigTransactionInterface.h similarity index 100% rename from fdbclient/ConfigTransactionInterface.h rename to fdbclient/include/fdbclient/ConfigTransactionInterface.h diff --git a/fdbclient/ConvertUTF.h b/fdbclient/include/fdbclient/ConvertUTF.h similarity index 100% rename from fdbclient/ConvertUTF.h rename to fdbclient/include/fdbclient/ConvertUTF.h diff --git a/fdbclient/CoordinationInterface.h b/fdbclient/include/fdbclient/CoordinationInterface.h similarity index 100% rename from fdbclient/CoordinationInterface.h rename to fdbclient/include/fdbclient/CoordinationInterface.h diff --git a/fdbclient/DatabaseConfiguration.h b/fdbclient/include/fdbclient/DatabaseConfiguration.h similarity index 100% rename from fdbclient/DatabaseConfiguration.h rename to fdbclient/include/fdbclient/DatabaseConfiguration.h diff --git a/fdbclient/DatabaseContext.h b/fdbclient/include/fdbclient/DatabaseContext.h similarity index 100% rename from fdbclient/DatabaseContext.h rename to fdbclient/include/fdbclient/DatabaseContext.h diff --git a/fdbclient/EventTypes.actor.h b/fdbclient/include/fdbclient/EventTypes.actor.h similarity index 100% rename from fdbclient/EventTypes.actor.h rename to fdbclient/include/fdbclient/EventTypes.actor.h diff --git a/fdbclient/FDBAWSCredentialsProvider.h b/fdbclient/include/fdbclient/FDBAWSCredentialsProvider.h similarity index 100% rename from fdbclient/FDBAWSCredentialsProvider.h rename to fdbclient/include/fdbclient/FDBAWSCredentialsProvider.h diff --git a/fdbclient/FDBOptions.h b/fdbclient/include/fdbclient/FDBOptions.h similarity index 100% rename from fdbclient/FDBOptions.h rename to fdbclient/include/fdbclient/FDBOptions.h diff --git a/fdbclient/FDBTypes.h b/fdbclient/include/fdbclient/FDBTypes.h similarity index 100% rename from fdbclient/FDBTypes.h rename to fdbclient/include/fdbclient/FDBTypes.h diff --git a/fdbclient/GenericManagementAPI.actor.h b/fdbclient/include/fdbclient/GenericManagementAPI.actor.h similarity index 100% rename from fdbclient/GenericManagementAPI.actor.h rename to fdbclient/include/fdbclient/GenericManagementAPI.actor.h diff --git a/fdbclient/GenericTransactionHelper.h b/fdbclient/include/fdbclient/GenericTransactionHelper.h similarity index 100% rename from fdbclient/GenericTransactionHelper.h rename to fdbclient/include/fdbclient/GenericTransactionHelper.h diff --git a/fdbclient/GlobalConfig.actor.h b/fdbclient/include/fdbclient/GlobalConfig.actor.h similarity index 100% rename from fdbclient/GlobalConfig.actor.h rename to fdbclient/include/fdbclient/GlobalConfig.actor.h diff --git a/fdbclient/GlobalConfig.h b/fdbclient/include/fdbclient/GlobalConfig.h similarity index 100% rename from fdbclient/GlobalConfig.h rename to fdbclient/include/fdbclient/GlobalConfig.h diff --git a/fdbclient/GrvProxyInterface.h b/fdbclient/include/fdbclient/GrvProxyInterface.h similarity index 100% rename from fdbclient/GrvProxyInterface.h rename to fdbclient/include/fdbclient/GrvProxyInterface.h diff --git a/fdbclient/HTTP.h b/fdbclient/include/fdbclient/HTTP.h similarity index 100% rename from fdbclient/HTTP.h rename to fdbclient/include/fdbclient/HTTP.h diff --git a/fdbclient/HighContentionPrefixAllocator.actor.h b/fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h similarity index 100% rename from fdbclient/HighContentionPrefixAllocator.actor.h rename to fdbclient/include/fdbclient/HighContentionPrefixAllocator.actor.h diff --git a/fdbclient/IClientApi.h b/fdbclient/include/fdbclient/IClientApi.h similarity index 100% rename from fdbclient/IClientApi.h rename to fdbclient/include/fdbclient/IClientApi.h diff --git a/fdbclient/IConfigTransaction.h b/fdbclient/include/fdbclient/IConfigTransaction.h similarity index 100% rename from fdbclient/IConfigTransaction.h rename to fdbclient/include/fdbclient/IConfigTransaction.h diff --git a/fdbclient/IKnobCollection.h b/fdbclient/include/fdbclient/IKnobCollection.h similarity index 100% rename from fdbclient/IKnobCollection.h rename to fdbclient/include/fdbclient/IKnobCollection.h diff --git a/fdbclient/ISingleThreadTransaction.h b/fdbclient/include/fdbclient/ISingleThreadTransaction.h similarity index 100% rename from fdbclient/ISingleThreadTransaction.h rename to fdbclient/include/fdbclient/ISingleThreadTransaction.h diff --git a/fdbclient/JSONDoc.h b/fdbclient/include/fdbclient/JSONDoc.h similarity index 100% rename from fdbclient/JSONDoc.h rename to fdbclient/include/fdbclient/JSONDoc.h diff --git a/fdbclient/JsonBuilder.h b/fdbclient/include/fdbclient/JsonBuilder.h similarity index 100% rename from fdbclient/JsonBuilder.h rename to fdbclient/include/fdbclient/JsonBuilder.h diff --git a/fdbclient/KeyBackedTypes.h b/fdbclient/include/fdbclient/KeyBackedTypes.h similarity index 100% rename from fdbclient/KeyBackedTypes.h rename to fdbclient/include/fdbclient/KeyBackedTypes.h diff --git a/fdbclient/KeyRangeMap.h b/fdbclient/include/fdbclient/KeyRangeMap.h similarity index 100% rename from fdbclient/KeyRangeMap.h rename to fdbclient/include/fdbclient/KeyRangeMap.h diff --git a/fdbclient/Knobs.h b/fdbclient/include/fdbclient/Knobs.h similarity index 100% rename from fdbclient/Knobs.h rename to fdbclient/include/fdbclient/Knobs.h diff --git a/fdbclient/LocalClientAPI.h b/fdbclient/include/fdbclient/LocalClientAPI.h similarity index 100% rename from fdbclient/LocalClientAPI.h rename to fdbclient/include/fdbclient/LocalClientAPI.h diff --git a/fdbclient/ManagementAPI.actor.h b/fdbclient/include/fdbclient/ManagementAPI.actor.h similarity index 100% rename from fdbclient/ManagementAPI.actor.h rename to fdbclient/include/fdbclient/ManagementAPI.actor.h diff --git a/fdbclient/MonitorLeader.h b/fdbclient/include/fdbclient/MonitorLeader.h similarity index 100% rename from fdbclient/MonitorLeader.h rename to fdbclient/include/fdbclient/MonitorLeader.h diff --git a/fdbclient/MultiVersionAssignmentVars.h b/fdbclient/include/fdbclient/MultiVersionAssignmentVars.h similarity index 100% rename from fdbclient/MultiVersionAssignmentVars.h rename to fdbclient/include/fdbclient/MultiVersionAssignmentVars.h diff --git a/fdbclient/MultiVersionTransaction.h b/fdbclient/include/fdbclient/MultiVersionTransaction.h similarity index 100% rename from fdbclient/MultiVersionTransaction.h rename to fdbclient/include/fdbclient/MultiVersionTransaction.h diff --git a/fdbclient/MutationList.h b/fdbclient/include/fdbclient/MutationList.h similarity index 100% rename from fdbclient/MutationList.h rename to fdbclient/include/fdbclient/MutationList.h diff --git a/fdbclient/MutationLogReader.actor.h b/fdbclient/include/fdbclient/MutationLogReader.actor.h similarity index 100% rename from fdbclient/MutationLogReader.actor.h rename to fdbclient/include/fdbclient/MutationLogReader.actor.h diff --git a/fdbclient/NameLineage.h b/fdbclient/include/fdbclient/NameLineage.h similarity index 100% rename from fdbclient/NameLineage.h rename to fdbclient/include/fdbclient/NameLineage.h diff --git a/fdbclient/NativeAPI.actor.h b/fdbclient/include/fdbclient/NativeAPI.actor.h similarity index 100% rename from fdbclient/NativeAPI.actor.h rename to fdbclient/include/fdbclient/NativeAPI.actor.h diff --git a/fdbclient/Notified.h b/fdbclient/include/fdbclient/Notified.h similarity index 100% rename from fdbclient/Notified.h rename to fdbclient/include/fdbclient/Notified.h diff --git a/fdbclient/PImpl.h b/fdbclient/include/fdbclient/PImpl.h similarity index 100% rename from fdbclient/PImpl.h rename to fdbclient/include/fdbclient/PImpl.h diff --git a/fdbclient/ParallelStream.actor.h b/fdbclient/include/fdbclient/ParallelStream.actor.h similarity index 100% rename from fdbclient/ParallelStream.actor.h rename to fdbclient/include/fdbclient/ParallelStream.actor.h diff --git a/fdbclient/PaxosConfigTransaction.h b/fdbclient/include/fdbclient/PaxosConfigTransaction.h similarity index 100% rename from fdbclient/PaxosConfigTransaction.h rename to fdbclient/include/fdbclient/PaxosConfigTransaction.h diff --git a/fdbclient/ProcessInterface.h b/fdbclient/include/fdbclient/ProcessInterface.h similarity index 100% rename from fdbclient/ProcessInterface.h rename to fdbclient/include/fdbclient/ProcessInterface.h diff --git a/fdbclient/RESTClient.h b/fdbclient/include/fdbclient/RESTClient.h similarity index 100% rename from fdbclient/RESTClient.h rename to fdbclient/include/fdbclient/RESTClient.h diff --git a/fdbclient/RESTUtils.h b/fdbclient/include/fdbclient/RESTUtils.h similarity index 100% rename from fdbclient/RESTUtils.h rename to fdbclient/include/fdbclient/RESTUtils.h diff --git a/fdbclient/RYWIterator.h b/fdbclient/include/fdbclient/RYWIterator.h similarity index 100% rename from fdbclient/RYWIterator.h rename to fdbclient/include/fdbclient/RYWIterator.h diff --git a/fdbclient/ReadYourWrites.h b/fdbclient/include/fdbclient/ReadYourWrites.h similarity index 100% rename from fdbclient/ReadYourWrites.h rename to fdbclient/include/fdbclient/ReadYourWrites.h diff --git a/fdbclient/RestoreInterface.h b/fdbclient/include/fdbclient/RestoreInterface.h similarity index 100% rename from fdbclient/RestoreInterface.h rename to fdbclient/include/fdbclient/RestoreInterface.h diff --git a/fdbclient/RunTransaction.actor.h b/fdbclient/include/fdbclient/RunTransaction.actor.h similarity index 100% rename from fdbclient/RunTransaction.actor.h rename to fdbclient/include/fdbclient/RunTransaction.actor.h diff --git a/fdbclient/S3BlobStore.h b/fdbclient/include/fdbclient/S3BlobStore.h similarity index 100% rename from fdbclient/S3BlobStore.h rename to fdbclient/include/fdbclient/S3BlobStore.h diff --git a/fdbclient/Schemas.h b/fdbclient/include/fdbclient/Schemas.h similarity index 100% rename from fdbclient/Schemas.h rename to fdbclient/include/fdbclient/Schemas.h diff --git a/fdbclient/ServerKnobCollection.h b/fdbclient/include/fdbclient/ServerKnobCollection.h similarity index 100% rename from fdbclient/ServerKnobCollection.h rename to fdbclient/include/fdbclient/ServerKnobCollection.h diff --git a/fdbclient/ServerKnobs.h b/fdbclient/include/fdbclient/ServerKnobs.h similarity index 100% rename from fdbclient/ServerKnobs.h rename to fdbclient/include/fdbclient/ServerKnobs.h diff --git a/fdbclient/SimpleConfigTransaction.h b/fdbclient/include/fdbclient/SimpleConfigTransaction.h similarity index 100% rename from fdbclient/SimpleConfigTransaction.h rename to fdbclient/include/fdbclient/SimpleConfigTransaction.h diff --git a/fdbclient/SimpleIni.h b/fdbclient/include/fdbclient/SimpleIni.h similarity index 100% rename from fdbclient/SimpleIni.h rename to fdbclient/include/fdbclient/SimpleIni.h diff --git a/fdbclient/SnapshotCache.h b/fdbclient/include/fdbclient/SnapshotCache.h similarity index 100% rename from fdbclient/SnapshotCache.h rename to fdbclient/include/fdbclient/SnapshotCache.h diff --git a/fdbclient/SpecialKeySpace.actor.h b/fdbclient/include/fdbclient/SpecialKeySpace.actor.h similarity index 100% rename from fdbclient/SpecialKeySpace.actor.h rename to fdbclient/include/fdbclient/SpecialKeySpace.actor.h diff --git a/fdbclient/StackLineage.h b/fdbclient/include/fdbclient/StackLineage.h similarity index 100% rename from fdbclient/StackLineage.h rename to fdbclient/include/fdbclient/StackLineage.h diff --git a/fdbclient/Status.h b/fdbclient/include/fdbclient/Status.h similarity index 100% rename from fdbclient/Status.h rename to fdbclient/include/fdbclient/Status.h diff --git a/fdbclient/StatusClient.h b/fdbclient/include/fdbclient/StatusClient.h similarity index 100% rename from fdbclient/StatusClient.h rename to fdbclient/include/fdbclient/StatusClient.h diff --git a/fdbclient/StorageCheckpoint.h b/fdbclient/include/fdbclient/StorageCheckpoint.h similarity index 100% rename from fdbclient/StorageCheckpoint.h rename to fdbclient/include/fdbclient/StorageCheckpoint.h diff --git a/fdbclient/StorageServerInterface.h b/fdbclient/include/fdbclient/StorageServerInterface.h similarity index 100% rename from fdbclient/StorageServerInterface.h rename to fdbclient/include/fdbclient/StorageServerInterface.h diff --git a/fdbclient/Subspace.h b/fdbclient/include/fdbclient/Subspace.h similarity index 100% rename from fdbclient/Subspace.h rename to fdbclient/include/fdbclient/Subspace.h diff --git a/fdbclient/SystemData.h b/fdbclient/include/fdbclient/SystemData.h similarity index 100% rename from fdbclient/SystemData.h rename to fdbclient/include/fdbclient/SystemData.h diff --git a/fdbclient/TagThrottle.actor.h b/fdbclient/include/fdbclient/TagThrottle.actor.h similarity index 100% rename from fdbclient/TagThrottle.actor.h rename to fdbclient/include/fdbclient/TagThrottle.actor.h diff --git a/fdbclient/TaskBucket.h b/fdbclient/include/fdbclient/TaskBucket.h similarity index 100% rename from fdbclient/TaskBucket.h rename to fdbclient/include/fdbclient/TaskBucket.h diff --git a/fdbclient/Tenant.h b/fdbclient/include/fdbclient/Tenant.h similarity index 100% rename from fdbclient/Tenant.h rename to fdbclient/include/fdbclient/Tenant.h diff --git a/fdbclient/TenantManagement.actor.h b/fdbclient/include/fdbclient/TenantManagement.actor.h similarity index 100% rename from fdbclient/TenantManagement.actor.h rename to fdbclient/include/fdbclient/TenantManagement.actor.h diff --git a/fdbclient/TestKnobCollection.h b/fdbclient/include/fdbclient/TestKnobCollection.h similarity index 100% rename from fdbclient/TestKnobCollection.h rename to fdbclient/include/fdbclient/TestKnobCollection.h diff --git a/fdbclient/ThreadSafeTransaction.h b/fdbclient/include/fdbclient/ThreadSafeTransaction.h similarity index 100% rename from fdbclient/ThreadSafeTransaction.h rename to fdbclient/include/fdbclient/ThreadSafeTransaction.h diff --git a/fdbclient/Tracing.h b/fdbclient/include/fdbclient/Tracing.h similarity index 100% rename from fdbclient/Tracing.h rename to fdbclient/include/fdbclient/Tracing.h diff --git a/fdbclient/TransactionLineage.h b/fdbclient/include/fdbclient/TransactionLineage.h similarity index 100% rename from fdbclient/TransactionLineage.h rename to fdbclient/include/fdbclient/TransactionLineage.h diff --git a/fdbclient/Tuple.h b/fdbclient/include/fdbclient/Tuple.h similarity index 100% rename from fdbclient/Tuple.h rename to fdbclient/include/fdbclient/Tuple.h diff --git a/fdbclient/VersionVector.h b/fdbclient/include/fdbclient/VersionVector.h similarity index 100% rename from fdbclient/VersionVector.h rename to fdbclient/include/fdbclient/VersionVector.h diff --git a/fdbclient/VersionedMap.actor.h b/fdbclient/include/fdbclient/VersionedMap.actor.h similarity index 100% rename from fdbclient/VersionedMap.actor.h rename to fdbclient/include/fdbclient/VersionedMap.actor.h diff --git a/fdbclient/VersionedMap.h b/fdbclient/include/fdbclient/VersionedMap.h similarity index 100% rename from fdbclient/VersionedMap.h rename to fdbclient/include/fdbclient/VersionedMap.h diff --git a/fdbclient/Versionstamp.h b/fdbclient/include/fdbclient/Versionstamp.h similarity index 100% rename from fdbclient/Versionstamp.h rename to fdbclient/include/fdbclient/Versionstamp.h diff --git a/fdbclient/WriteMap.h b/fdbclient/include/fdbclient/WriteMap.h similarity index 100% rename from fdbclient/WriteMap.h rename to fdbclient/include/fdbclient/WriteMap.h diff --git a/fdbclient/json_spirit/json_spirit_error_position.h b/fdbclient/include/fdbclient/json_spirit/json_spirit_error_position.h similarity index 100% rename from fdbclient/json_spirit/json_spirit_error_position.h rename to fdbclient/include/fdbclient/json_spirit/json_spirit_error_position.h diff --git a/fdbclient/json_spirit/json_spirit_reader_template.h b/fdbclient/include/fdbclient/json_spirit/json_spirit_reader_template.h similarity index 100% rename from fdbclient/json_spirit/json_spirit_reader_template.h rename to fdbclient/include/fdbclient/json_spirit/json_spirit_reader_template.h diff --git a/fdbclient/json_spirit/json_spirit_value.h b/fdbclient/include/fdbclient/json_spirit/json_spirit_value.h similarity index 100% rename from fdbclient/json_spirit/json_spirit_value.h rename to fdbclient/include/fdbclient/json_spirit/json_spirit_value.h diff --git a/fdbclient/json_spirit/json_spirit_writer_options.h b/fdbclient/include/fdbclient/json_spirit/json_spirit_writer_options.h similarity index 100% rename from fdbclient/json_spirit/json_spirit_writer_options.h rename to fdbclient/include/fdbclient/json_spirit/json_spirit_writer_options.h diff --git a/fdbclient/json_spirit/json_spirit_writer_template.h b/fdbclient/include/fdbclient/json_spirit/json_spirit_writer_template.h similarity index 100% rename from fdbclient/json_spirit/json_spirit_writer_template.h rename to fdbclient/include/fdbclient/json_spirit/json_spirit_writer_template.h diff --git a/fdbclient/libb64/cdecode.h b/fdbclient/include/fdbclient/libb64/cdecode.h similarity index 100% rename from fdbclient/libb64/cdecode.h rename to fdbclient/include/fdbclient/libb64/cdecode.h diff --git a/fdbclient/libb64/cencode.h b/fdbclient/include/fdbclient/libb64/cencode.h similarity index 100% rename from fdbclient/libb64/cencode.h rename to fdbclient/include/fdbclient/libb64/cencode.h diff --git a/fdbclient/libb64/decode.h b/fdbclient/include/fdbclient/libb64/decode.h similarity index 100% rename from fdbclient/libb64/decode.h rename to fdbclient/include/fdbclient/libb64/decode.h diff --git a/fdbclient/libb64/encode.h b/fdbclient/include/fdbclient/libb64/encode.h similarity index 100% rename from fdbclient/libb64/encode.h rename to fdbclient/include/fdbclient/libb64/encode.h diff --git a/fdbclient/md5/md5.h b/fdbclient/include/fdbclient/md5/md5.h similarity index 100% rename from fdbclient/md5/md5.h rename to fdbclient/include/fdbclient/md5/md5.h diff --git a/fdbclient/rapidxml/rapidxml.hpp b/fdbclient/include/fdbclient/rapidxml/rapidxml.hpp similarity index 100% rename from fdbclient/rapidxml/rapidxml.hpp rename to fdbclient/include/fdbclient/rapidxml/rapidxml.hpp diff --git a/fdbclient/rapidxml/rapidxml_iterators.hpp b/fdbclient/include/fdbclient/rapidxml/rapidxml_iterators.hpp similarity index 100% rename from fdbclient/rapidxml/rapidxml_iterators.hpp rename to fdbclient/include/fdbclient/rapidxml/rapidxml_iterators.hpp diff --git a/fdbclient/rapidxml/rapidxml_print.hpp b/fdbclient/include/fdbclient/rapidxml/rapidxml_print.hpp similarity index 100% rename from fdbclient/rapidxml/rapidxml_print.hpp rename to fdbclient/include/fdbclient/rapidxml/rapidxml_print.hpp diff --git a/fdbclient/rapidxml/rapidxml_utils.hpp b/fdbclient/include/fdbclient/rapidxml/rapidxml_utils.hpp similarity index 100% rename from fdbclient/rapidxml/rapidxml_utils.hpp rename to fdbclient/include/fdbclient/rapidxml/rapidxml_utils.hpp diff --git a/fdbclient/sha1/SHA1.h b/fdbclient/include/fdbclient/sha1/SHA1.h similarity index 100% rename from fdbclient/sha1/SHA1.h rename to fdbclient/include/fdbclient/sha1/SHA1.h diff --git a/fdbclient/zipf.h b/fdbclient/include/fdbclient/zipf.h similarity index 100% rename from fdbclient/zipf.h rename to fdbclient/include/fdbclient/zipf.h diff --git a/fdbclient/libb64/cdecode.c b/fdbclient/libb64/cdecode.c index 537f6afdbbc..f10ecc3dcc2 100644 --- a/fdbclient/libb64/cdecode.c +++ b/fdbclient/libb64/cdecode.c @@ -5,7 +5,7 @@ This is part of the libb64 project, and has been placed in the public domain. For details, see http://sourceforge.net/projects/libb64 */ -#include "cdecode.h" +#include "fdbclient/libb64/cdecode.h" int base64_decode_value(char value_in) { static const char decoding[] = { 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -2, -1, diff --git a/fdbclient/libb64/cencode.c b/fdbclient/libb64/cencode.c index 94ba972f8de..7999b47d61b 100644 --- a/fdbclient/libb64/cencode.c +++ b/fdbclient/libb64/cencode.c @@ -5,7 +5,7 @@ This is part of the libb64 project, and has been placed in the public domain. For details, see http://sourceforge.net/projects/libb64 */ -#include "cencode.h" +#include "fdbclient/libb64/cencode.h" const int CHARS_PER_LINE = 72; diff --git a/fdbclient/sha1/SHA1.cpp b/fdbclient/sha1/SHA1.cpp index 06e08fb91b8..ba63a0485ce 100644 --- a/fdbclient/sha1/SHA1.cpp +++ b/fdbclient/sha1/SHA1.cpp @@ -13,7 +13,7 @@ -- Volker Grabsch */ -#include "SHA1.h" +#include "fdbclient/sha1/SHA1.h" #include #include #include diff --git a/fdbclient/zipf.c b/fdbclient/zipf.c index 91006263dcd..dfc183fd805 100644 --- a/fdbclient/zipf.c +++ b/fdbclient/zipf.c @@ -7,7 +7,7 @@ #include #include #include -#include "zipf.h" +#include "fdbclient/zipf.h" /* global static */ static int items; diff --git a/fdbmonitor/CMakeLists.txt b/fdbmonitor/CMakeLists.txt index b669d468468..177dde51703 100644 --- a/fdbmonitor/CMakeLists.txt +++ b/fdbmonitor/CMakeLists.txt @@ -1,7 +1,9 @@ set(FDBMONITOR_SRCS fdbmonitor.cpp) add_executable(fdbmonitor ${FDBMONITOR_SRCS}) -target_include_directories(fdbmonitor PUBLIC "${CMAKE_BINARY_DIR}/flow/include" "${CMAKE_BINARY_DIR}/fdbclient/include") +get_target_property(fdbclient_target_includes fdbclient INCLUDE_DIRECTORIES) +target_link_libraries(fdbmonitor PUBLIC SimpleOpt) +target_include_directories(fdbmonitor PUBLIC "${fdbclient_target_includes}") strip_debug_symbols(fdbmonitor) assert_no_version_h(fdbmonitor) if(UNIX AND NOT APPLE) diff --git a/fdbmonitor/fdbmonitor.cpp b/fdbmonitor/fdbmonitor.cpp index 9fa58ff91c2..318331fa331 100644 --- a/fdbmonitor/fdbmonitor.cpp +++ b/fdbmonitor/fdbmonitor.cpp @@ -75,7 +75,7 @@ #include #include -#include "flow/SimpleOpt.h" +#include "SimpleOpt/SimpleOpt.h" #include "fdbclient/SimpleIni.h" #include "fdbclient/versions.h" diff --git a/fdbrpc/CMakeLists.txt b/fdbrpc/CMakeLists.txt index 0d8f9be589c..de92e266e92 100644 --- a/fdbrpc/CMakeLists.txt +++ b/fdbrpc/CMakeLists.txt @@ -1,74 +1,4 @@ -set(FDBRPC_SRCS - ActorFuzz.h - AsyncFileCached.actor.h - AsyncFileChaos.h - AsyncFileEIO.actor.h - AsyncFileEncrypted.h - AsyncFileKAIO.actor.h - AsyncFileNonDurable.actor.h - AsyncFileReadAhead.actor.h - AsyncFileWinASIO.actor.h - AsyncFileCached.actor.cpp - AsyncFileEncrypted.actor.cpp - AsyncFileNonDurable.actor.cpp - AsyncFileWriteChecker.h - AsyncFileWriteChecker.cpp - Base64UrlDecode.h - Base64UrlDecode.cpp - Base64UrlEncode.h - Base64UrlEncode.cpp - ContinuousSample.h - FailureMonitor.h - FailureMonitor.actor.cpp - fdbrpc.h - FlowProcess.actor.h - FlowTransport.h - FlowTransport.actor.cpp - genericactors.actor.h - genericactors.actor.cpp - HealthMonitor.h - HealthMonitor.actor.cpp - IPAllowList.h - IPAllowList.cpp - linux_kaio.h - LoadBalance.h - LoadBalance.actor.h - LoadBalance.actor.cpp - Locality.h - Locality.cpp - MultiInterface.h - Net2FileSystem.h - Net2FileSystem.cpp - networksender.actor.h - PerfMetric.cpp - PerfMetric.h - QueueModel.h - QueueModel.cpp - RangeMap.h - Replication.h - ReplicationPolicy.h - ReplicationPolicy.cpp - ReplicationTypes.h - ReplicationTypes.cpp - ReplicationUtils.h - ReplicationUtils.cpp - SimExternalConnection.actor.cpp - SimExternalConnection.h - Smoother.h - Stats.actor.cpp - Stats.h - simulator.h - sim2.actor.cpp - sim_validation.h - sim_validation.cpp - TenantInfo.h - TimedRequest.h - TokenSign.h - TokenSign.cpp - TraceFileIO.h - TraceFileIO.cpp - TSSComparison.h - WellKnownEndpoints.h) +fdb_find_sources(FDBRPC_SRCS) set(COMPILE_EIO OFF) @@ -91,18 +21,9 @@ set(FDBRPC_SRCS_DISABLE_ACTOR_DIAGNOSTICS add_flow_target(STATIC_LIBRARY NAME fdbrpc SRCS ${FDBRPC_SRCS} DISABLE_ACTOR_DIAGNOSTICS ${FDBRPC_SRCS_DISABLE_ACTOR_DIAGNOSTICS}) -target_include_directories(fdbrpc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/libeio) -target_link_libraries(fdbrpc PUBLIC flow PRIVATE rapidjson) - add_flow_target(STATIC_LIBRARY NAME fdbrpc_sampling SRCS ${FDBRPC_SRCS} DISABLE_ACTOR_DIAGNOSTICS ${FDBRPC_SRCS_DISABLE_ACTOR_DIAGNOSTICS}) -target_include_directories(fdbrpc_sampling PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/libeio) -target_link_libraries(fdbrpc_sampling PUBLIC flow_sampling PRIVATE rapidjson) -target_compile_definitions(fdbrpc_sampling PRIVATE -DENABLE_SAMPLING) -if(WIN32) - add_dependencies(fdbrpc_sampling_actors fdbrpc_actors) -endif() if(COMPILE_EIO) add_library(eio STATIC libeio/eio.c) @@ -111,8 +32,6 @@ if(COMPILE_EIO) endif() target_compile_definitions(eio PRIVATE USE_UCONTEXT) target_compile_options(eio BEFORE PRIVATE -w) # disable warnings for eio - target_link_libraries(fdbrpc PRIVATE eio) - target_link_libraries(fdbrpc_sampling PRIVATE eio) endif() if(${COROUTINE_IMPL} STREQUAL libcoro) @@ -124,11 +43,8 @@ if(${COROUTINE_IMPL} STREQUAL libcoro) list(APPEND CORO_SRCS libcoroutine/context.c) endif() add_library(coro STATIC ${CORO_SRCS}) - target_include_directories(coro PRIVATE ${CMAKE_BINARY_DIR}/flow/include) + target_link_libraries(coro PRIVATE flow) target_include_directories(coro PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/libcoroutine) - # we don't want to link against flow, but we need tob make sure it is built first - # since we rely on files being copied because we include Platform.h - add_dependencies(coro flow) if(WIN32) target_compile_definitions(coro PRIVATE USE_FIBERS) else() @@ -138,6 +54,25 @@ if(${COROUTINE_IMPL} STREQUAL libcoro) if(USE_VALGRIND) target_link_libraries(coro PUBLIC Valgrind) endif() +endif() + +target_include_directories(fdbrpc PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}/include" PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/libeio) +target_link_libraries(fdbrpc PUBLIC flow PRIVATE rapidjson) + +target_include_directories(fdbrpc_sampling PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}/include" PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/libeio) +target_link_libraries(fdbrpc_sampling PUBLIC flow_sampling PRIVATE rapidjson) + +if(${COROUTINE_IMPL} STREQUAL libcoro) target_link_libraries(fdbrpc PUBLIC coro) target_link_libraries(fdbrpc_sampling PUBLIC coro) endif() + +if(COMPILE_EIO) + target_link_libraries(fdbrpc PRIVATE eio) + target_link_libraries(fdbrpc_sampling PRIVATE eio) +endif() + +target_compile_definitions(fdbrpc_sampling PRIVATE -DENABLE_SAMPLING) +if(WIN32) + add_dependencies(fdbrpc_sampling_actors fdbrpc_actors) +endif() diff --git a/fdbrpc/ActorFuzz.h b/fdbrpc/include/fdbrpc/ActorFuzz.h similarity index 100% rename from fdbrpc/ActorFuzz.h rename to fdbrpc/include/fdbrpc/ActorFuzz.h diff --git a/fdbrpc/AsyncFileCached.actor.h b/fdbrpc/include/fdbrpc/AsyncFileCached.actor.h similarity index 100% rename from fdbrpc/AsyncFileCached.actor.h rename to fdbrpc/include/fdbrpc/AsyncFileCached.actor.h diff --git a/fdbrpc/AsyncFileChaos.h b/fdbrpc/include/fdbrpc/AsyncFileChaos.h similarity index 100% rename from fdbrpc/AsyncFileChaos.h rename to fdbrpc/include/fdbrpc/AsyncFileChaos.h diff --git a/fdbrpc/AsyncFileEIO.actor.h b/fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h similarity index 100% rename from fdbrpc/AsyncFileEIO.actor.h rename to fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h diff --git a/fdbrpc/AsyncFileEncrypted.h b/fdbrpc/include/fdbrpc/AsyncFileEncrypted.h similarity index 100% rename from fdbrpc/AsyncFileEncrypted.h rename to fdbrpc/include/fdbrpc/AsyncFileEncrypted.h diff --git a/fdbrpc/AsyncFileKAIO.actor.h b/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h similarity index 99% rename from fdbrpc/AsyncFileKAIO.actor.h rename to fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h index 8a7403708ec..dd1f1b014df 100644 --- a/fdbrpc/AsyncFileKAIO.actor.h +++ b/fdbrpc/include/fdbrpc/AsyncFileKAIO.actor.h @@ -40,7 +40,7 @@ #include "flow/Knobs.h" #include "flow/Histogram.h" #include "flow/UnitTest.h" -#include "flow/crc32c.h" +#include "crc32/crc32c.h" #include "flow/genericactors.actor.h" #include "flow/actorcompiler.h" // This must be the last #include. diff --git a/fdbrpc/AsyncFileNonDurable.actor.h b/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h similarity index 100% rename from fdbrpc/AsyncFileNonDurable.actor.h rename to fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h diff --git a/fdbrpc/AsyncFileReadAhead.actor.h b/fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h similarity index 100% rename from fdbrpc/AsyncFileReadAhead.actor.h rename to fdbrpc/include/fdbrpc/AsyncFileReadAhead.actor.h diff --git a/fdbrpc/AsyncFileWinASIO.actor.h b/fdbrpc/include/fdbrpc/AsyncFileWinASIO.actor.h similarity index 100% rename from fdbrpc/AsyncFileWinASIO.actor.h rename to fdbrpc/include/fdbrpc/AsyncFileWinASIO.actor.h diff --git a/fdbrpc/AsyncFileWriteChecker.h b/fdbrpc/include/fdbrpc/AsyncFileWriteChecker.h similarity index 99% rename from fdbrpc/AsyncFileWriteChecker.h rename to fdbrpc/include/fdbrpc/AsyncFileWriteChecker.h index dbd95f3084c..4427e357966 100644 --- a/fdbrpc/AsyncFileWriteChecker.h +++ b/fdbrpc/include/fdbrpc/AsyncFileWriteChecker.h @@ -19,7 +19,7 @@ */ #include "flow/IAsyncFile.h" -#include "flow/crc32c.h" +#include "crc32/crc32c.h" #if VALGRIND #include diff --git a/fdbrpc/Base64UrlDecode.h b/fdbrpc/include/fdbrpc/Base64UrlDecode.h similarity index 100% rename from fdbrpc/Base64UrlDecode.h rename to fdbrpc/include/fdbrpc/Base64UrlDecode.h diff --git a/fdbrpc/Base64UrlEncode.h b/fdbrpc/include/fdbrpc/Base64UrlEncode.h similarity index 100% rename from fdbrpc/Base64UrlEncode.h rename to fdbrpc/include/fdbrpc/Base64UrlEncode.h diff --git a/fdbrpc/ContinuousSample.h b/fdbrpc/include/fdbrpc/ContinuousSample.h similarity index 100% rename from fdbrpc/ContinuousSample.h rename to fdbrpc/include/fdbrpc/ContinuousSample.h diff --git a/fdbrpc/FailureMonitor.h b/fdbrpc/include/fdbrpc/FailureMonitor.h similarity index 100% rename from fdbrpc/FailureMonitor.h rename to fdbrpc/include/fdbrpc/FailureMonitor.h diff --git a/fdbrpc/FlowProcess.actor.h b/fdbrpc/include/fdbrpc/FlowProcess.actor.h similarity index 100% rename from fdbrpc/FlowProcess.actor.h rename to fdbrpc/include/fdbrpc/FlowProcess.actor.h diff --git a/fdbrpc/FlowTransport.h b/fdbrpc/include/fdbrpc/FlowTransport.h similarity index 100% rename from fdbrpc/FlowTransport.h rename to fdbrpc/include/fdbrpc/FlowTransport.h diff --git a/fdbrpc/HealthMonitor.h b/fdbrpc/include/fdbrpc/HealthMonitor.h similarity index 100% rename from fdbrpc/HealthMonitor.h rename to fdbrpc/include/fdbrpc/HealthMonitor.h diff --git a/fdbrpc/IPAllowList.h b/fdbrpc/include/fdbrpc/IPAllowList.h similarity index 100% rename from fdbrpc/IPAllowList.h rename to fdbrpc/include/fdbrpc/IPAllowList.h diff --git a/fdbrpc/LoadBalance.actor.h b/fdbrpc/include/fdbrpc/LoadBalance.actor.h similarity index 100% rename from fdbrpc/LoadBalance.actor.h rename to fdbrpc/include/fdbrpc/LoadBalance.actor.h diff --git a/fdbrpc/LoadBalance.h b/fdbrpc/include/fdbrpc/LoadBalance.h similarity index 100% rename from fdbrpc/LoadBalance.h rename to fdbrpc/include/fdbrpc/LoadBalance.h diff --git a/fdbrpc/LoadPlugin.h b/fdbrpc/include/fdbrpc/LoadPlugin.h similarity index 100% rename from fdbrpc/LoadPlugin.h rename to fdbrpc/include/fdbrpc/LoadPlugin.h diff --git a/fdbrpc/Locality.h b/fdbrpc/include/fdbrpc/Locality.h similarity index 100% rename from fdbrpc/Locality.h rename to fdbrpc/include/fdbrpc/Locality.h diff --git a/fdbrpc/MultiInterface.h b/fdbrpc/include/fdbrpc/MultiInterface.h similarity index 100% rename from fdbrpc/MultiInterface.h rename to fdbrpc/include/fdbrpc/MultiInterface.h diff --git a/fdbrpc/Net2FileSystem.h b/fdbrpc/include/fdbrpc/Net2FileSystem.h similarity index 100% rename from fdbrpc/Net2FileSystem.h rename to fdbrpc/include/fdbrpc/Net2FileSystem.h diff --git a/fdbrpc/PerfMetric.h b/fdbrpc/include/fdbrpc/PerfMetric.h similarity index 100% rename from fdbrpc/PerfMetric.h rename to fdbrpc/include/fdbrpc/PerfMetric.h diff --git a/fdbrpc/QueueModel.h b/fdbrpc/include/fdbrpc/QueueModel.h similarity index 100% rename from fdbrpc/QueueModel.h rename to fdbrpc/include/fdbrpc/QueueModel.h diff --git a/fdbrpc/RangeMap.h b/fdbrpc/include/fdbrpc/RangeMap.h similarity index 100% rename from fdbrpc/RangeMap.h rename to fdbrpc/include/fdbrpc/RangeMap.h diff --git a/fdbrpc/Replication.h b/fdbrpc/include/fdbrpc/Replication.h similarity index 100% rename from fdbrpc/Replication.h rename to fdbrpc/include/fdbrpc/Replication.h diff --git a/fdbrpc/ReplicationPolicy.h b/fdbrpc/include/fdbrpc/ReplicationPolicy.h similarity index 100% rename from fdbrpc/ReplicationPolicy.h rename to fdbrpc/include/fdbrpc/ReplicationPolicy.h diff --git a/fdbrpc/ReplicationTypes.h b/fdbrpc/include/fdbrpc/ReplicationTypes.h similarity index 100% rename from fdbrpc/ReplicationTypes.h rename to fdbrpc/include/fdbrpc/ReplicationTypes.h diff --git a/fdbrpc/ReplicationUtils.h b/fdbrpc/include/fdbrpc/ReplicationUtils.h similarity index 100% rename from fdbrpc/ReplicationUtils.h rename to fdbrpc/include/fdbrpc/ReplicationUtils.h diff --git a/fdbrpc/SimExternalConnection.h b/fdbrpc/include/fdbrpc/SimExternalConnection.h similarity index 100% rename from fdbrpc/SimExternalConnection.h rename to fdbrpc/include/fdbrpc/SimExternalConnection.h diff --git a/fdbrpc/Smoother.h b/fdbrpc/include/fdbrpc/Smoother.h similarity index 100% rename from fdbrpc/Smoother.h rename to fdbrpc/include/fdbrpc/Smoother.h diff --git a/fdbrpc/Stats.h b/fdbrpc/include/fdbrpc/Stats.h similarity index 100% rename from fdbrpc/Stats.h rename to fdbrpc/include/fdbrpc/Stats.h diff --git a/fdbrpc/TSSComparison.h b/fdbrpc/include/fdbrpc/TSSComparison.h similarity index 100% rename from fdbrpc/TSSComparison.h rename to fdbrpc/include/fdbrpc/TSSComparison.h diff --git a/fdbrpc/TenantInfo.h b/fdbrpc/include/fdbrpc/TenantInfo.h similarity index 100% rename from fdbrpc/TenantInfo.h rename to fdbrpc/include/fdbrpc/TenantInfo.h diff --git a/fdbrpc/TimedRequest.h b/fdbrpc/include/fdbrpc/TimedRequest.h similarity index 100% rename from fdbrpc/TimedRequest.h rename to fdbrpc/include/fdbrpc/TimedRequest.h diff --git a/fdbrpc/TokenSign.h b/fdbrpc/include/fdbrpc/TokenSign.h similarity index 100% rename from fdbrpc/TokenSign.h rename to fdbrpc/include/fdbrpc/TokenSign.h diff --git a/fdbrpc/TraceFileIO.h b/fdbrpc/include/fdbrpc/TraceFileIO.h similarity index 100% rename from fdbrpc/TraceFileIO.h rename to fdbrpc/include/fdbrpc/TraceFileIO.h diff --git a/fdbrpc/WellKnownEndpoints.h b/fdbrpc/include/fdbrpc/WellKnownEndpoints.h similarity index 100% rename from fdbrpc/WellKnownEndpoints.h rename to fdbrpc/include/fdbrpc/WellKnownEndpoints.h diff --git a/fdbrpc/fdbrpc.h b/fdbrpc/include/fdbrpc/fdbrpc.h similarity index 100% rename from fdbrpc/fdbrpc.h rename to fdbrpc/include/fdbrpc/fdbrpc.h diff --git a/fdbrpc/genericactors.actor.h b/fdbrpc/include/fdbrpc/genericactors.actor.h similarity index 100% rename from fdbrpc/genericactors.actor.h rename to fdbrpc/include/fdbrpc/genericactors.actor.h diff --git a/fdbrpc/linux_kaio.h b/fdbrpc/include/fdbrpc/linux_kaio.h similarity index 100% rename from fdbrpc/linux_kaio.h rename to fdbrpc/include/fdbrpc/linux_kaio.h diff --git a/fdbrpc/networksender.actor.h b/fdbrpc/include/fdbrpc/networksender.actor.h similarity index 100% rename from fdbrpc/networksender.actor.h rename to fdbrpc/include/fdbrpc/networksender.actor.h diff --git a/fdbrpc/sim_validation.h b/fdbrpc/include/fdbrpc/sim_validation.h similarity index 100% rename from fdbrpc/sim_validation.h rename to fdbrpc/include/fdbrpc/sim_validation.h diff --git a/fdbrpc/simulator.h b/fdbrpc/include/fdbrpc/simulator.h similarity index 100% rename from fdbrpc/simulator.h rename to fdbrpc/include/fdbrpc/simulator.h diff --git a/fdbrpc/sim2.actor.cpp b/fdbrpc/sim2.actor.cpp index 185b2f1c1d7..6c508c02798 100644 --- a/fdbrpc/sim2.actor.cpp +++ b/fdbrpc/sim2.actor.cpp @@ -40,7 +40,7 @@ #include "fdbrpc/AsyncFileEncrypted.h" #include "fdbrpc/AsyncFileNonDurable.actor.h" #include "fdbrpc/AsyncFileChaos.h" -#include "flow/crc32c.h" +#include "crc32/crc32c.h" #include "fdbrpc/TraceFileIO.h" #include "flow/FaultInjection.h" #include "flow/flow.h" diff --git a/fdbrpc/sim_validation.cpp b/fdbrpc/sim_validation.cpp index 292c5255f33..061df1386e4 100644 --- a/fdbrpc/sim_validation.cpp +++ b/fdbrpc/sim_validation.cpp @@ -18,7 +18,7 @@ * limitations under the License. */ -#include "sim_validation.h" +#include "fdbrpc/sim_validation.h" #include "fdbrpc/TraceFileIO.h" #include "flow/network.h" #include "fdbrpc/simulator.h" @@ -151,4 +151,4 @@ bool debug_checkVersionTime(int64_t version, double t, std::string context, Seve return true; } return false; -} \ No newline at end of file +} diff --git a/fdbserver/CMakeLists.txt b/fdbserver/CMakeLists.txt index b78f4c118ef..4386b84b5e1 100644 --- a/fdbserver/CMakeLists.txt +++ b/fdbserver/CMakeLists.txt @@ -1,352 +1,12 @@ -set(FDBSERVER_SRCS - ApplyMetadataMutation.cpp - ApplyMetadataMutation.h - art.h - art_impl.h - ArtMutationBuffer.h - BackupInterface.h - BackupProgress.actor.cpp - BackupProgress.actor.h - BackupWorker.actor.cpp - BlobGranuleServerCommon.actor.cpp - BlobGranuleServerCommon.actor.h - BlobGranuleValidation.actor.cpp - BlobGranuleValidation.actor.h - BlobManager.actor.cpp - BlobManagerInterface.h - BlobWorker.actor.cpp - ClusterController.actor.cpp - ClusterController.actor.h - ClusterRecovery.actor.cpp - ClusterRecovery.actor.h - CommitProxyServer.actor.cpp - ConfigBroadcaster.actor.cpp - ConfigBroadcaster.h - ConfigBroadcastInterface.h - ConfigDatabaseUnitTests.actor.cpp - ConfigFollowerInterface.cpp - ConfigFollowerInterface.h - ConfigNode.actor.cpp - ConfigNode.h - ConflictSet.h - CoordinatedState.actor.cpp - CoordinatedState.h - Coordination.actor.cpp - CoordinationInterface.h - CoroFlow.h - DataDistribution.actor.cpp - DataDistribution.actor.h - DataDistributionQueue.actor.cpp - DataDistributionTracker.actor.cpp - DataDistributorInterface.h - DBCoreState.h - DDTeamCollection.actor.cpp - DDTeamCollection.h - DDTxnProcessor.h - DDTxnProcessor.actor.cpp - DeltaTree.h - DiskQueue.actor.cpp - EncryptKeyProxy.actor.cpp - EncryptKeyProxyInterface.h - FDBExecHelper.actor.cpp - FDBExecHelper.actor.h - fdbserver.actor.cpp - GetEncryptCipherKeys.actor.cpp - GetEncryptCipherKeys.h - GrvProxyServer.actor.cpp - IConfigConsumer.cpp - IConfigConsumer.h - IDiskQueue.h - IKeyValueContainer.h - IKeyValueStore.h - IPager.h - KeyValueStoreCompressTestData.actor.cpp - KeyValueStoreMemory.actor.cpp - KeyValueStoreRocksDB.actor.cpp - KeyValueStoreShardedRocksDB.actor.cpp - KeyValueStoreSQLite.actor.cpp - KmsConnector.h - KmsConnectorInterface.h - KnobProtectiveGroups.cpp - KnobProtectiveGroups.h - Knobs.h - LatencyBandConfig.cpp - LatencyBandConfig.h - LeaderElection.actor.cpp - LeaderElection.h - LocalConfiguration.actor.cpp - LocalConfiguration.h - LogProtocolMessage.h - LogRouter.actor.cpp - LogSystem.cpp - LogSystem.h - LogSystemConfig.cpp - LogSystemConfig.h - LogSystemDiskQueueAdapter.actor.cpp - LogSystemDiskQueueAdapter.h - LogSystemPeekCursor.actor.cpp - MasterInterface.h - masterserver.actor.cpp - MetricLogger.actor.cpp - MetricLogger.actor.h - MoveKeys.actor.cpp - MoveKeys.actor.h - MutationTracking.cpp - MutationTracking.h - networktest.actor.cpp - NetworkTest.h - OldTLogServer_4_6.actor.cpp - OldTLogServer_6_0.actor.cpp - OldTLogServer_6_2.actor.cpp - OTELSpanContextMessage.h - OnDemandStore.actor.cpp - OnDemandStore.h - PaxosConfigConsumer.actor.cpp - PaxosConfigConsumer.h - ProxyCommitData.actor.h - pubsub.actor.cpp - pubsub.h - QuietDatabase.actor.cpp - QuietDatabase.h - RadixTree.h - Ratekeeper.actor.cpp - Ratekeeper.h - RatekeeperInterface.h - RecoveryState.h - RemoteIKeyValueStore.actor.h - RemoteIKeyValueStore.actor.cpp - RESTKmsConnector.h - RESTKmsConnector.actor.cpp - ResolutionBalancer.actor.cpp - ResolutionBalancer.actor.h - Resolver.actor.cpp - ResolverInterface.h - RestoreApplier.actor.cpp - RestoreApplier.actor.h - RestoreCommon.actor.cpp - RestoreCommon.actor.h - RestoreController.actor.cpp - RestoreController.actor.h - RestoreLoader.actor.cpp - RestoreLoader.actor.h - RestoreRoleCommon.actor.cpp - RestoreRoleCommon.actor.h - RestoreUtil.actor.cpp - RestoreUtil.h - RestoreWorker.actor.cpp - RestoreWorker.actor.h - RestoreWorkerInterface.actor.cpp - RestoreWorkerInterface.actor.h - RkTagThrottleCollection.cpp - RkTagThrottleCollection.h - RocksDBCheckpointUtils.actor.cpp - RocksDBCheckpointUtils.actor.h - RoleLineage.actor.cpp - RoleLineage.actor.h - ServerCheckpoint.actor.cpp - ServerCheckpoint.actor.h - ServerDBInfo.actor.h - ServerDBInfo.h - SigStack.cpp - SimKmsConnector.h - SimKmsConnector.actor.cpp - SimpleConfigConsumer.actor.cpp - SimpleConfigConsumer.h - SimulatedCluster.actor.cpp - SimulatedCluster.h - SkipList.cpp - SpanContextMessage.h - Status.actor.cpp - Status.h - StorageCache.actor.cpp - StorageMetrics.actor.cpp - StorageMetrics.h - storageserver.actor.cpp - TagPartitionedLogSystem.actor.cpp - TagPartitionedLogSystem.actor.h - TagThrottler.actor.cpp - TagThrottler.h - TCInfo.actor.cpp - TCInfo.h - template_fdb.h - tester.actor.cpp - TenantCache.actor.cpp - TenantCache.h - TesterInterface.actor.h - TLogInterface.h - TLogServer.actor.cpp - TransactionTagCounter.cpp - TransactionTagCounter.h - TSSMappingUtil.actor.cpp - TSSMappingUtil.actor.h - VersionedBTree.actor.cpp - VFSAsync.cpp - VFSAsync.h - WaitFailure.actor.cpp - WaitFailure.h - worker.actor.cpp - WorkerInterface.actor.h - workloads/ApiCorrectness.actor.cpp - workloads/ApiWorkload.actor.cpp - workloads/ApiWorkload.h - workloads/AsyncFile.actor.h - workloads/AsyncFile.cpp - workloads/AsyncFileCorrectness.actor.cpp - workloads/AsyncFileRead.actor.cpp - workloads/AsyncFileWrite.actor.cpp - workloads/AtomicOps.actor.cpp - workloads/AtomicOpsApiCorrectness.actor.cpp - workloads/AtomicRestore.actor.cpp - workloads/AtomicSwitchover.actor.cpp - workloads/BackgroundSelectors.actor.cpp - workloads/BackupAndParallelRestoreCorrectness.actor.cpp - workloads/BackupCorrectness.actor.cpp - workloads/BackupToBlob.actor.cpp - workloads/BackupToDBAbort.actor.cpp - workloads/BackupToDBCorrectness.actor.cpp - workloads/BackupToDBUpgrade.actor.cpp - workloads/BlobGranuleCorrectnessWorkload.actor.cpp - workloads/BlobGranuleVerifier.actor.cpp - workloads/BlobStoreWorkload.h - workloads/BulkLoad.actor.cpp - workloads/BulkSetup.actor.h - workloads/Cache.actor.cpp - workloads/ChangeConfig.actor.cpp - workloads/ChangeFeeds.actor.cpp - workloads/ClearSingleRange.actor.cpp - workloads/ClientTransactionProfileCorrectness.actor.cpp - workloads/ClientWorkload.actor.cpp - workloads/ClogSingleConnection.actor.cpp - workloads/CommitBugCheck.actor.cpp - workloads/ConfigIncrement.actor.cpp - workloads/ConfigureDatabase.actor.cpp - workloads/ConflictRange.actor.cpp - workloads/ConsistencyCheck.actor.cpp - workloads/CpuProfiler.actor.cpp - workloads/Cycle.actor.cpp - workloads/DataDistributionMetrics.actor.cpp - workloads/DataLossRecovery.actor.cpp - workloads/DDBalance.actor.cpp - workloads/DDMetrics.actor.cpp - workloads/DDMetricsExclude.actor.cpp - workloads/DifferentClustersSameRV.actor.cpp - workloads/DiskDurability.actor.cpp - workloads/DiskDurabilityTest.actor.cpp - workloads/DiskFailureInjection.actor.cpp - workloads/DummyWorkload.actor.cpp - workloads/EncryptionOps.actor.cpp - workloads/EncryptKeyProxyTest.actor.cpp - workloads/ExternalWorkload.actor.cpp - workloads/FastTriggeredWatches.actor.cpp - workloads/FileSystem.actor.cpp - workloads/Fuzz.cpp - workloads/FuzzApiCorrectness.actor.cpp - workloads/GetMappedRange.actor.cpp - workloads/GetRangeStream.actor.cpp - workloads/HealthMetricsApi.actor.cpp - workloads/HighContentionPrefixAllocatorWorkload.actor.cpp - workloads/Increment.actor.cpp - workloads/IncrementalBackup.actor.cpp - workloads/IndexScan.actor.cpp - workloads/Inventory.actor.cpp - workloads/KillRegion.actor.cpp - workloads/KVStoreTest.actor.cpp - workloads/LocalRatekeeper.actor.cpp - workloads/LockDatabase.actor.cpp - workloads/LockDatabaseFrequently.actor.cpp - workloads/LogMetrics.actor.cpp - workloads/LowLatency.actor.cpp - workloads/MachineAttrition.actor.cpp - workloads/Mako.actor.cpp - workloads/MemoryKeyValueStore.cpp - workloads/MemoryKeyValueStore.h - workloads/MemoryLifetime.actor.cpp - workloads/MetricLogging.actor.cpp - workloads/MiniCycle.actor.cpp - workloads/MutationLogReaderCorrectness.actor.cpp - workloads/ParallelRestore.actor.cpp - workloads/Performance.actor.cpp - workloads/PhysicalShardMove.actor.cpp - workloads/Ping.actor.cpp - workloads/PopulateTPCC.actor.cpp - workloads/PrivateEndpoints.actor.cpp - workloads/ProtocolVersion.actor.cpp - workloads/PubSubMultiples.actor.cpp - workloads/QueuePush.actor.cpp - workloads/RandomClogging.actor.cpp - workloads/RandomMoveKeys.actor.cpp - workloads/RandomSelector.actor.cpp - workloads/ReadAfterWrite.actor.cpp - workloads/ReadHotDetection.actor.cpp - workloads/ReadWrite.actor.cpp - workloads/ReadWriteWorkload.actor.h - workloads/RemoveServersSafely.actor.cpp - workloads/ReportConflictingKeys.actor.cpp - workloads/RestoreBackup.actor.cpp - workloads/RestoreFromBlob.actor.cpp - workloads/Rollback.actor.cpp - workloads/RyowCorrectness.actor.cpp - workloads/RYWDisable.actor.cpp - workloads/RYWPerformance.actor.cpp - workloads/SaveAndKill.actor.cpp - workloads/SelectorCorrectness.actor.cpp - workloads/Serializability.actor.cpp - workloads/Sideband.actor.cpp - workloads/SidebandSingle.actor.cpp - workloads/SimpleAtomicAdd.actor.cpp - workloads/SkewedReadWrite.actor.cpp - workloads/SlowTaskWorkload.actor.cpp - workloads/SnapTest.actor.cpp - workloads/SpecialKeySpaceCorrectness.actor.cpp - workloads/StatusWorkload.actor.cpp - workloads/Storefront.actor.cpp - workloads/StreamingRangeRead.actor.cpp - workloads/StreamingRead.actor.cpp - workloads/SubmitBackup.actor.cpp - workloads/SuspendProcesses.actor.cpp - workloads/TagThrottleApi.actor.cpp - workloads/TargetedKill.actor.cpp - workloads/TaskBucketCorrectness.actor.cpp - workloads/TenantManagementWorkload.actor.cpp - workloads/ThreadSafety.actor.cpp - workloads/Throttling.actor.cpp - workloads/Throughput.actor.cpp - workloads/TimeKeeperCorrectness.actor.cpp - workloads/TPCC.actor.cpp - workloads/TPCCWorkload.h - workloads/TriggerRecovery.actor.cpp - workloads/UDPWorkload.actor.cpp - workloads/UnitPerf.actor.cpp - workloads/UnitTests.actor.cpp - workloads/Unreadable.actor.cpp - workloads/VersionStamp.actor.cpp - workloads/WatchAndWait.actor.cpp - workloads/Watches.actor.cpp - workloads/WatchesSameKeyCorrectness.actor.cpp - workloads/WorkerErrors.actor.cpp - workloads/workloads.actor.h - workloads/WriteBandwidth.actor.cpp - workloads/WriteDuringRead.actor.cpp - workloads/WriteTagThrottling.actor.cpp -) +fdb_find_sources(FDBSERVER_SRCS) if(${COROUTINE_IMPL} STREQUAL libcoro) - list(APPEND FDBSERVER_SRCS CoroFlowCoro.actor.cpp) + list(APPEND FDBSERVER_SRCS coroimpl/CoroFlowCoro.actor.cpp) else() - list(APPEND FDBSERVER_SRCS CoroFlow.actor.cpp) + list(APPEND FDBSERVER_SRCS coroimpl/CoroFlow.actor.cpp) endif() -add_library(fdb_sqlite STATIC - sqlite/btree.h - sqlite/hash.h - sqlite/sqlite3.h - sqlite/sqlite3ext.h - sqlite/sqliteInt.h - sqlite/sqliteLimit.h - sqlite/sqlite3.amalgamation.c) -target_include_directories(fdb_sqlite PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/sqlite) - -if(WITH_ROCKSDB_EXPERIMENTAL) +if (WITH_ROCKSDB_EXPERIMENTAL) add_definitions(-DSSD_ROCKSDB_EXPERIMENTAL) include(CompileRocksDB) @@ -359,12 +19,6 @@ if(WITH_ROCKSDB_EXPERIMENTAL) endif() endif() -# Suppress warnings in sqlite since it's third party -if(NOT WIN32) - target_compile_definitions(fdb_sqlite PRIVATE $<$:NDEBUG>) - target_compile_options(fdb_sqlite BEFORE PRIVATE -w) # disable warnings for third party -endif() - file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/workloads) add_flow_target(EXECUTABLE NAME fdbserver SRCS ${FDBSERVER_SRCS}) @@ -372,21 +26,21 @@ add_flow_target(EXECUTABLE NAME fdbserver SRCS ${FDBSERVER_SRCS}) target_include_directories(fdbserver PRIVATE ${CMAKE_SOURCE_DIR}/bindings/c ${CMAKE_BINARY_DIR}/bindings/c - ${CMAKE_CURRENT_BINARY_DIR}/workloads - ${CMAKE_CURRENT_SOURCE_DIR}/workloads) -if(WITH_ROCKSDB_EXPERIMENTAL) + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_BINARY_DIR}/include) +if (WITH_ROCKSDB_EXPERIMENTAL) add_dependencies(fdbserver rocksdb) if(WITH_LIBURING) target_include_directories(fdbserver PRIVATE ${ROCKSDB_INCLUDE_DIR} ${uring_INCLUDE_DIR}) - target_link_libraries(fdbserver PRIVATE fdbclient fdb_sqlite ${ROCKSDB_LIBRARIES} ${uring_LIBRARIES} ${lz4_STATIC_LIBRARIES}) + target_link_libraries(fdbserver PRIVATE fdbclient sqlite ${ROCKSDB_LIBRARIES} ${uring_LIBRARIES} ${lz4_STATIC_LIBRARIES}) target_compile_definitions(fdbserver PRIVATE BOOST_ASIO_HAS_IO_URING=1 BOOST_ASIO_DISABLE_EPOLL=1) else() target_include_directories(fdbserver PRIVATE ${ROCKSDB_INCLUDE_DIR}) - target_link_libraries(fdbserver PRIVATE fdbclient fdb_sqlite ${ROCKSDB_LIBRARIES} ${lz4_STATIC_LIBRARIES}) + target_link_libraries(fdbserver PRIVATE fdbclient sqlite ${ROCKSDB_LIBRARIES} ${lz4_STATIC_LIBRARIES}) target_compile_definitions(fdbserver PRIVATE) endif() else() - target_link_libraries(fdbserver PRIVATE fdbclient fdb_sqlite) + target_link_libraries(fdbserver PRIVATE fdbclient sqlite) endif() target_link_libraries(fdbserver PRIVATE toml11_target jemalloc rapidjson) diff --git a/fdbserver/CompactMap.cpp b/fdbserver/CompactMap.cpp deleted file mode 100644 index 1854cd4d6bb..00000000000 --- a/fdbserver/CompactMap.cpp +++ /dev/null @@ -1,905 +0,0 @@ -/* - * CompactMap.cpp - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2013-2022 Apple Inc. and the FoundationDB project authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#pragma intrinsic(memcmp) - -#include "flow/flow.h" -#include "flow/DeterministicRandom.h" -#include "fdbserver/PrefixTree.h" -#include - -static int nextPowerOfTwo(int n) { - int p; - for (p = 1; p < n; p += p) - ; - return p; -} - -static int less(StringRef a, StringRef b) { - int al = a.size(), bl = b.size(); - int cl = al < bl ? al : bl; - uint8_t const* ap = a.begin(); - uint8_t const* bp = b.begin(); - for (int i = 0; i < cl; i++) { - if (ap[i] < bp[i]) - return 1; - else if (bp[i] < ap[i]) - return 0; - } - return al < bl; -} - -struct CompactPreOrderTree { - enum { - ENABLE_PREFETCH_RIGHT = 1 - }; // Use rather more memory BW, but hide a little latency when a right branch takes us out of a cache line. Seems - // to help slightly. - - struct Node { - enum { ENABLE_PREFIX = 1 }; // Enable or disable key prefix compression within a CompactPreOrderTree - enum { ENABLE_LEFT_PTR = 0 }; - - // offsets relative to `this`: - enum { KEY_LENGTH_OFFSET = ENABLE_PREFIX * 1 }; - enum { KEY_DATA_OFFSET = KEY_LENGTH_OFFSET + 1 }; - - // offsets relative to `keyEnd()`: - enum { LPTR_OFFSET = 0 }; - enum { RPTR_OFFSET = 2 * ENABLE_LEFT_PTR }; - enum { END_OFFSET = RPTR_OFFSET + 2 }; - enum { IMPLICIT_LPTR_VALUE = END_OFFSET }; - - static int getMaxOverhead() { return KEY_DATA_OFFSET + END_OFFSET; } - - int keyPrefixLength() { - if (ENABLE_PREFIX) - return *(uint8_t*)this; - else - return 0; - } - int keyLength() { return *((uint8_t*)this + KEY_LENGTH_OFFSET); } - uint8_t const* keyData() { return (uint8_t const*)this + KEY_DATA_OFFSET; } - uint8_t const* keyEnd() { return (uint8_t const*)this + KEY_DATA_OFFSET + keyLength(); } - StringRef key() { return StringRef(keyData(), keyLength()); } - Node* left() { - auto ke = keyEnd(); - return (Node*)(ke + (ENABLE_LEFT_PTR ? *(int16_t*)(ke + LPTR_OFFSET) : IMPLICIT_LPTR_VALUE)); - } - Node* right() { - auto ke = keyEnd(); - return (Node*)(ke + *(uint16_t*)(ke + RPTR_OFFSET)); - } - uint8_t* getEnd() { return (uint8_t*)keyEnd() + END_OFFSET; } - - void setKeyPrefixLength(int l) { - if (ENABLE_PREFIX) { - ASSERT(l < 256); - *(uint8_t*)this = l; - } else - ASSERT(!l); - } - void setKeyLength(int l) { - ASSERT(l < 256); - *((uint8_t*)this + KEY_LENGTH_OFFSET) = l; - } - void setLeftPointer(Node* ptr) { - auto ke = keyEnd(); - int o = (uint8_t*)ptr - ke; - ASSERT(ENABLE_LEFT_PTR ? (int16_t(o) == o) : o == IMPLICIT_LPTR_VALUE); - if (ENABLE_LEFT_PTR) - *(uint16_t*)(ke + LPTR_OFFSET) = o; - } - void setRightPointer(Node* ptr) { - auto ke = keyEnd(); - int o = (uint8_t*)ptr - ke; - ASSERT(-32768 <= o && o < 32767); - *(uint16_t*)(ke + RPTR_OFFSET) = o; - } - }; - - int nodeCount; - Node root; - - int relAddr(Node* n) { return (uint8_t*)n - (uint8_t*)this; } - - Node* lastLessOrEqual(StringRef searchKey) { - Node* n = &root; // n is the root of the subtree we are searching - Node* b = 0; // b is the greatest node <= searchKey which is a parent of n - int nBFIndex = 0; // the index of the node n in the entire tree in "breadth first order", i.e. level by level. - // This is NOT the order the tree is stored in! - int prefixSize = 0; // the number of bytes of searchKey which are equal to the first bytes of the logical key of - // the parent of n - int dir; - - while (nBFIndex < nodeCount) { - int np = n->keyPrefixLength(); - if (ENABLE_PREFETCH_RIGHT) - _mm_prefetch((const char*)n->right(), _MM_HINT_T0); - if (prefixSize < np) { - // The searchKey differs from this node's logical key in the prefix this node shares with its parent - // So the comparison between this node and searchKey has the same result as the comparison with the - // parent and searchKey (dir is unchanged) - } else { - // The searchKey is equal to this node's logical key up to the beginning of the compressed key - int al = searchKey.size() - np; - int bl = n->keyLength(); - int cl = al < bl ? al : bl; - int prefixLen = commonPrefixLength(searchKey.begin() + np, n->keyData(), cl); - dir = prefixLen == cl ? al < bl : searchKey[np + prefixLen] < n->keyData()[prefixLen]; - if (Node::ENABLE_PREFIX) - prefixSize = np + prefixLen; - } - - nBFIndex = nBFIndex + nBFIndex + 2 - dir; - auto l = n->left(), r = n->right(); - b = dir ? b : n; - n = dir ? l : r; - } - - return b; - } - - static std::pair lastLessOrEqual2(CompactPreOrderTree* this1, - CompactPreOrderTree* this2, - StringRef searchKey1, - StringRef searchKey2) { - // Do two separate lastLessOrEqual operations at once, to make better use of the memory subsystem. - // Don't try to read this code, it is write only (constructed by copy/paste from lastLessOrEqual and adding 1 - // and 2 to variables as necessary) - - Node* n1 = &this1->root; // n is the root of the subtree we are searching - Node* b1 = 0; // b is the greatest node <= searchKey which is a parent of n - int nBFIndex1 = 0; // the index of the node n in the entire tree in "breadth first order", i.e. level by level. - // This is NOT the order the tree is stored in! - int prefixSize1 = 0; // the number of bytes of searchKey which are equal to the first bytes of the logical key - // of the parent of n - int dir1; - - Node* n2 = &this2->root; // n is the root of the subtree we are searching - Node* b2 = 0; // b is the greatest node <= searchKey which is a parent of n - int nBFIndex2 = 0; // the index of the node n in the entire tree in "breadth first order", i.e. level by level. - // This is NOT the order the tree is stored in! - int prefixSize2 = 0; // the number of bytes of searchKey which are equal to the first bytes of the logical key - // of the parent of n - int dir2; - - while (nBFIndex1 < this1->nodeCount && nBFIndex2 < this2->nodeCount) { - int np1 = n1->keyPrefixLength(); - int np2 = n2->keyPrefixLength(); - if (ENABLE_PREFETCH_RIGHT) { - _mm_prefetch((const char*)n1->right(), _MM_HINT_T0); - _mm_prefetch((const char*)n2->right(), _MM_HINT_T0); - } - if (prefixSize1 < np1) { - // The searchKey differs from this node's logical key in the prefix this node shares with its parent - // So the comparison between this node and searchKey has the same result as the comparison with the - // parent and searchKey (dir is unchanged) - } else { - // The searchKey is equal to this node's logical key up to the beginning of the compressed key - int al1 = searchKey1.size() - np1; - int bl1 = n1->keyLength(); - int cl1 = al1 < bl1 ? al1 : bl1; - int prefixLen1 = commonPrefixLength(searchKey1.begin() + np1, n1->keyData(), cl1); - dir1 = prefixLen1 == cl1 ? al1 < bl1 : searchKey1[np1 + prefixLen1] < n1->keyData()[prefixLen1]; - prefixSize1 = np1 + prefixLen1; - } - if (prefixSize2 < np2) { - // The searchKey differs from this node's logical key in the prefix this node shares with its parent - // So the comparison between this node and searchKey has the same result as the comparison with the - // parent and searchKey (dir is unchanged) - } else { - // The searchKey is equal to this node's logical key up to the beginning of the compressed key - int al2 = searchKey2.size() - np2; - int bl2 = n2->keyLength(); - int cl2 = al2 < bl2 ? al2 : bl2; - int prefixLen2 = commonPrefixLength(searchKey2.begin() + np2, n2->keyData(), cl2); - dir2 = prefixLen2 == cl2 ? al2 < bl2 : searchKey2[np2 + prefixLen2] < n2->keyData()[prefixLen2]; - prefixSize2 = np2 + prefixLen2; - } - - nBFIndex1 = nBFIndex1 + nBFIndex1 + 2 - dir1; - nBFIndex2 = nBFIndex2 + nBFIndex2 + 2 - dir2; - auto l1 = n1->left(), r1 = n1->right(); - auto l2 = n2->left(), r2 = n2->right(); - b1 = dir1 ? b1 : n1; - b2 = dir2 ? b2 : n2; - n1 = dir1 ? l1 : r1; - n2 = dir2 ? l2 : r2; - } - - while (nBFIndex1 < this1->nodeCount) { - int np1 = n1->keyPrefixLength(); - if (prefixSize1 < np1) { - // The searchKey differs from this node's logical key in the prefix this node shares with its parent - // So the comparison between this node and searchKey has the same result as the comparison with the - // parent and searchKey (dir is unchanged) - } else { - // The searchKey is equal to this node's logical key up to the beginning of the compressed key - int al1 = searchKey1.size() - np1; - int bl1 = n1->keyLength(); - int cl1 = al1 < bl1 ? al1 : bl1; - int prefixLen1 = commonPrefixLength(searchKey1.begin() + np1, n1->keyData(), cl1); - dir1 = prefixLen1 == cl1 ? al1 < bl1 : searchKey1[np1 + prefixLen1] < n1->keyData()[prefixLen1]; - prefixSize1 = np1 + prefixLen1; - } - nBFIndex1 = nBFIndex1 + nBFIndex1 + 2 - dir1; - auto l1 = n1->left(), r1 = n1->right(); - b1 = dir1 ? b1 : n1; - n1 = dir1 ? l1 : r1; - } - - while (nBFIndex2 < this2->nodeCount) { - int np2 = n2->keyPrefixLength(); - if (prefixSize2 < np2) { - // The searchKey differs from this node's logical key in the prefix this node shares with its parent - // So the comparison between this node and searchKey has the same result as the comparison with the - // parent and searchKey (dir is unchanged) - } else { - // The searchKey is equal to this node's logical key up to the beginning of the compressed key - int al2 = searchKey2.size() - np2; - int bl2 = n2->keyLength(); - int cl2 = al2 < bl2 ? al2 : bl2; - int prefixLen2 = commonPrefixLength(searchKey2.begin() + np2, n2->keyData(), cl2); - dir2 = prefixLen2 == cl2 ? al2 < bl2 : searchKey2[np2 + prefixLen2] < n2->keyData()[prefixLen2]; - prefixSize2 = np2 + prefixLen2; - } - nBFIndex2 = nBFIndex2 + nBFIndex2 + 2 - dir2; - auto l2 = n2->left(), r2 = n2->right(); - b2 = dir2 ? b2 : n2; - n2 = dir2 ? l2 : r2; - } - - return std::make_pair(b1, b2); - } - -#if 0 - enum { ENABLE_FANCY_BUILD=1 }; - - struct BuildInfo { - Node* parent; - bool rightChild; - std::string const& prefix; - std::string* begin; - std::string* end; - BuildInfo(Node* parent, bool rightChild, std::string const& prefix, std::string* begin, std::string* end) - : parent(parent), rightChild(rightChild), prefix(prefix), begin(begin), end(end) {} - }; - - int build(std::vector& input, std::string const& prefix = std::string()) { - nodeCount = input.size(); - - Deque< BuildInfo > queue; - Deque< BuildInfo > deferred; - queue.push_back(BuildInfo(nullptr, false, prefix, &input[0], &input[0] + input.size())); - - Node* node = &root; - uint8_t* cacheLineEnd = (uint8_t*)node + 64; - while (queue.size() || deferred.size()) { - if (!queue.size()) { - for (int i = 0; i < deferred.size(); i++) - queue.push_back( deferred[i] ); - deferred.clear(); - } - BuildInfo bi = queue.front(); - queue.pop_front(); - - int mid = perfectSubtreeSplitPoint(bi.end - bi.begin); - std::string& s = bi.begin[mid]; - int prefixLen = Node::ENABLE_PREFIX ? commonPrefixLength((uint8_t*)&bi.prefix[0], (uint8_t*)&s[0], std::min(bi.prefix.size(), s.size())) : 0; - node->setKeyPrefixLength(prefixLen); - node->setKeyLength(s.size() - prefixLen); - memcpy((uint8_t*)node->key().begin(), &s[prefixLen], s.size() - prefixLen); - - if (bi.parent) { - if (bi.rightChild) - bi.parent->setRightPointer(node); - else - bi.parent->setLeftPointer(node); - } - - if ((uint8_t*)node->getEnd() > cacheLineEnd) { - cacheLineEnd = (uint8_t*)((intptr_t)node->getEnd() &~63) + 64; - for (int i = 0; i < queue.size(); i++) - deferred.push_back(queue[i]); - queue.clear(); - } - - if (bi.begin != bi.begin + mid) - queue.push_back(BuildInfo(node, false, s, bi.begin, bi.begin + mid)); - else if (Node::ENABLE_LEFT_PTR) - node->setLeftPointer(node); - - if (bi.begin + mid + 1 != bi.end) - queue.push_back(BuildInfo(node, true, s, bi.begin + mid + 1, bi.end)); - else - node->setRightPointer(node); - - node = (Node*)node->getEnd(); - } - - return (uint8_t*)node - (uint8_t*)this; - } - -#else - enum { ENABLE_FANCY_BUILD = 0 }; - - int build(std::vector& input, std::string const& prefix = std::string()) { - nodeCount = input.size(); - return (uint8_t*)build(root, prefix, &input[0], &input[0] + input.size()) - (uint8_t*)this; - } - Node* build(Node& node, std::string const& prefix, std::string* begin, std::string* end) { - if (begin == end) - return &node; - int mid = perfectSubtreeSplitPoint(end - begin); - std::string& s = begin[mid]; - int prefixLen = - Node::ENABLE_PREFIX - ? commonPrefixLength((uint8_t*)&prefix[0], (uint8_t*)&s[0], std::min(prefix.size(), s.size())) - : 0; - // printf("Node: %s at %d, subtree size %d, mid=%d, prefix %d\n", s.c_str(), relAddr(&node), end-begin, mid, - // prefixLen); - node.setKeyPrefixLength(prefixLen); - node.setKeyLength(s.size() - prefixLen); - memcpy((uint8_t*)node.key().begin(), &s[prefixLen], s.size() - prefixLen); - - Node* next = (Node*)node.getEnd(); - if (begin != begin + mid) { - node.setLeftPointer(next); - next = build(*node.left(), s, begin, begin + mid); - } else if (Node::ENABLE_LEFT_PTR) - node.setLeftPointer(&node); - - if (begin + mid + 1 != end) { - node.setRightPointer(next); - next = build(*node.right(), s, begin + mid + 1, end); - } else - node.setRightPointer(&node); - - return next; - } -#endif -}; - -void compactMapTests(std::vector testData, - std::vector sampleQueries, - std::string prefixTreeDOTFile = "") { - double t1, t2; - int r = 0; - std::sort(testData.begin(), testData.end()); - - /*for (int i = 0; i < testData.size() - 1; i++) { - ASSERT(testData[i + 1].substr(0, 4) != testData[i].substr(0, 4)); - ASSERT(_byteswap_ulong(*(uint32_t*)&testData[i][0]) < _byteswap_ulong(*(uint32_t*)&testData[i + 1][0])); - }*/ - - int totalKeyBytes = 0; - for (auto& s : testData) - totalKeyBytes += s.size(); - printf("%d bytes in %lu keys\n", totalKeyBytes, testData.size()); - - for (int i = 0; i < 5; i++) - printf(" '%s'\n", printable(StringRef(testData[i])).c_str()); - - CompactPreOrderTree* t = - (CompactPreOrderTree*)new uint8_t[sizeof(CompactPreOrderTree) + totalKeyBytes + - CompactPreOrderTree::Node::getMaxOverhead() * testData.size()]; - - t1 = timer_monotonic(); - int compactTreeBytes = t->build(testData); - t2 = timer_monotonic(); - - printf("Compact tree is %d bytes\n", compactTreeBytes); - printf("Build time %0.0f us (%0.2f M/sec)\n", (t2 - t1) * 1e6, 1 / (t2 - t1) / 1e6); - - t1 = timer_monotonic(); - const int nBuild = 20000; - for (int i = 0; i < nBuild; i++) - r += t->build(testData); - t2 = timer_monotonic(); - printf("Build time %0.0f us (%0.2f M/sec)\n", (t2 - t1) / nBuild * 1e6, nBuild / (t2 - t1) / 1e6); - - PrefixTree* pt = (PrefixTree*)new uint8_t[sizeof(PrefixTree) + totalKeyBytes + - testData.size() * PrefixTree::Node::getMaxOverhead(1, 256, 256)]; - - std::vector keys; - for (auto& k : testData) { - keys.emplace_back(k, StringRef()); - } - - t1 = timer_monotonic(); - int prefixTreeBytes = pt->build(&*keys.begin(), &*keys.end(), StringRef(), StringRef()); - t2 = timer_monotonic(); - - if (!prefixTreeDOTFile.empty()) { - FILE* fout = fopen(prefixTreeDOTFile.c_str(), "w"); - fprintf(fout, "%s\n", pt->toDOT(StringRef(), StringRef()).c_str()); - fclose(fout); - } - - // Calculate perfect prefix-compressed size - int perfectSize = testData.front().size(); - for (int i = 1; i < testData.size(); ++i) { - int common = commonPrefixLength(StringRef(testData[i]), StringRef(testData[i - 1])); - perfectSize += (testData[i].size() - common); - } - - printf("PrefixTree tree is %d bytes\n", prefixTreeBytes); - printf("Perfect compressed size with no overhead is %d, average PrefixTree overhead is %.2f per item\n", - perfectSize, - double(prefixTreeBytes - perfectSize) / testData.size()); - printf("PrefixTree Build time %0.0f us (%0.2f M/sec)\n", (t2 - t1) * 1e6, 1 / (t2 - t1) / 1e6); - - // Test cursor forward iteration - auto c = pt->getCursor(StringRef(), StringRef()); - ASSERT(c.moveFirst()); - - bool end = false; - for (int i = 0; i < keys.size(); ++i) { - ASSERT(c.getKeyRef() == keys[i].key); - end = !c.moveNext(); - } - ASSERT(end); - printf("PrefixTree forward scan passed\n"); - - // Test cursor backward iteration - ASSERT(c.moveLast()); - - for (int i = keys.size() - 1; i >= 0; --i) { - ASSERT(c.getKeyRef() == keys[i].key); - end = !c.movePrev(); - } - ASSERT(end); - printf("PrefixTree reverse scan passed\n"); - - t1 = timer_monotonic(); - for (int i = 0; i < nBuild; i++) - r += pt->build(&*keys.begin(), &*keys.end(), StringRef(), StringRef()); - t2 = timer_monotonic(); - printf("PrefixTree Build time %0.0f us (%0.2f M/sec)\n", (t2 - t1) / nBuild * 1e6, nBuild / (t2 - t1) / 1e6); - - t->lastLessOrEqual(LiteralStringRef("8f9fad2e5e2af980a")); - - { - std::string s, s1; - CompactPreOrderTree::Node* n; - for (int i = 0; i < testData.size(); i++) { - s = testData[i]; - - auto s1 = s; // s.substr(0, s.size() - 1); - if (!s1.back()) - s1 = s1.substr(0, s1.size() - 1); - else { - s1.back()--; - s1 += "\xff\xff\xff\xff\xff\xff"; - } - auto n = t->lastLessOrEqual(s1); - // printf("lastLessOrEqual(%s) = %s\n", s1.c_str(), n ? n->key().toString().c_str() : "(null)"); - ASSERT(i ? testData[i - 1].substr(n->keyPrefixLength()) == n->key() : !n); - n = t->lastLessOrEqual(s); - // printf("lastLessOrEqual(%s) = %s\n", s.c_str(), n ? n->key().toString().c_str() : "(null)"); - ASSERT(n->key() == s.substr(n->keyPrefixLength())); - s1 = s + "a"; - auto n1 = t->lastLessOrEqual(s1); - // printf("lastLessOrEqual(%s) = %s\n", s1.c_str(), n ? n->key().toString().c_str() : "(null)"); - ASSERT(n1->key() == s.substr(n1->keyPrefixLength())); - - ASSERT(CompactPreOrderTree::lastLessOrEqual2(t, t, s, s1) == std::make_pair(n, n1)); - } - printf("compactMap lastLessOrEqual tests passed\n"); - } - - { - auto cur = pt->getCursor(StringRef(), StringRef()); - - for (int i = 0; i < keys.size(); i++) { - StringRef s = keys[i].key; - - ASSERT(cur.seekLessThanOrEqual(s)); - ASSERT(cur.valid()); - ASSERT(cur.getKey() == s); - - StringRef shortString = s.substr(0, s.size() - 1); - bool shorter = cur.seekLessThanOrEqual(shortString); - if (i > 0) { - if (shortString >= keys[i - 1].key) { - ASSERT(shorter); - ASSERT(cur.valid()); - ASSERT(cur.getKey() == keys[i - 1].key); - } - } else { - ASSERT(!shorter); - } - - ASSERT(cur.seekLessThanOrEqual(s.toString() + '\0')); - ASSERT(cur.valid()); - ASSERT(cur.getKey() == s); - } - printf("PrefixTree lastLessOrEqual tests passed\n"); - } - - printf("Making %lu copies:\n", 2 * sampleQueries.size()); - - std::vector copies; - for (int i = 0; i < 2 * sampleQueries.size(); i++) { - copies.push_back((CompactPreOrderTree*)new uint8_t[compactTreeBytes]); - memcpy(copies.back(), t, compactTreeBytes); - } - deterministicRandom()->randomShuffle(copies); - - std::vector prefixTreeCopies; - for (int i = 0; i < 2 * sampleQueries.size(); i++) { - prefixTreeCopies.push_back((PrefixTree*)new uint8_t[prefixTreeBytes]); - memcpy(prefixTreeCopies.back(), pt, prefixTreeBytes); - } - deterministicRandom()->randomShuffle(prefixTreeCopies); - - std::vector> array_copies; - for (int i = 0; i < sampleQueries.size(); i++) { - array_copies.push_back(testData); - } - deterministicRandom()->randomShuffle(array_copies); - - printf("shuffled\n"); - - t1 = timer_monotonic(); - for (auto& q : sampleQueries) - r += (intptr_t)t->lastLessOrEqual(q); - t2 = timer_monotonic(); - printf("compactmap, in cache: %d queries in %0.3f sec: %0.3f M/sec\n", - (int)sampleQueries.size(), - t2 - t1, - sampleQueries.size() / (t2 - t1) / 1e6); - - auto cur = pt->getCursor(StringRef(), StringRef()); - - t1 = timer_monotonic(); - for (auto& q : sampleQueries) - r += cur.seekLessThanOrEqual(StringRef(q)) ? 1 : 0; - t2 = timer_monotonic(); - printf("prefixtree, in cache: %d queries in %0.3f sec: %0.3f M/sec\n", - (int)sampleQueries.size(), - t2 - t1, - sampleQueries.size() / (t2 - t1) / 1e6); - - /* t1 = timer_monotonic(); - for (int q = 0; q < sampleQueries.size(); q += 2) { - auto x = CompactPreOrderTree::lastLessOrEqual2(t, t, sampleQueries[q], sampleQueries[q + 1]); - r += (intptr_t)x.first + (intptr_t)x.second; - } - t2 = timer_monotonic(); - printf("in cache (2x interleaved): %d queries in %0.3f sec: %0.3f M/sec\n", (int)sampleQueries.size(), t2 - t1, - sampleQueries.size() / (t2 - t1) / 1e6); - */ - - t1 = timer_monotonic(); - for (int q = 0; q < sampleQueries.size(); q++) - r += (intptr_t)copies[q]->lastLessOrEqual(sampleQueries[q]); - t2 = timer_monotonic(); - printf("compactmap, out of cache: %d queries in %0.3f sec: %0.3f M/sec\n", - (int)sampleQueries.size(), - t2 - t1, - sampleQueries.size() / (t2 - t1) / 1e6); - - std::vector cursors; - for (int q = 0; q < sampleQueries.size(); q++) - cursors.push_back(prefixTreeCopies[q]->getCursor(StringRef(), StringRef())); - - t1 = timer_monotonic(); - for (int q = 0; q < sampleQueries.size(); q++) - r += cursors[q].seekLessThanOrEqual(sampleQueries[q]) ? 1 : 0; - t2 = timer_monotonic(); - printf("prefixtree, out of cache: %d queries in %0.3f sec: %0.3f M/sec\n", - (int)sampleQueries.size(), - t2 - t1, - sampleQueries.size() / (t2 - t1) / 1e6); - - /* - t1 = timer_monotonic(); - for (int q = 0; q < sampleQueries.size(); q += 2) { - auto x = CompactPreOrderTree::lastLessOrEqual2(copies[q + sampleQueries.size()], copies[q + - sampleQueries.size() + 1], sampleQueries[q], sampleQueries[q + 1]); r += (intptr_t)x.first + (intptr_t)x.second; - } - t2 = timer_monotonic(); - printf("out of cache (2x interleaved): %d queries in %0.3f sec: %0.3f M/sec\n", (int)sampleQueries.size(), t2 - - t1, sampleQueries.size() / (t2 - t1) / 1e6); - */ - - t1 = timer_monotonic(); - for (int q = 0; q < sampleQueries.size(); q++) - r += (intptr_t)(std::lower_bound(array_copies[q].begin(), array_copies[q].end(), sampleQueries[q]) - - testData.begin()); - t2 = timer_monotonic(); - printf("std::lower_bound: %d queries in %0.3f sec: %0.3f M/sec\n", - (int)sampleQueries.size(), - t2 - t1, - sampleQueries.size() / (t2 - t1) / 1e6); -} - -std::vector sampleDocuments(int N) { - std::vector testData; - std::string p = "pre"; - std::string n = "\x01" - "name\x00\x00"; - std::string a = "\x01" - "address\x00\x00"; - std::string o = "\x01" - "orders\x00\x00"; - std::string oi = "\x01" - "id\x00\x00"; - std::string oa = "\x01" - "amount\x00\x00"; - std::string dbl = "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00"; - for (int i = 0; i < N; i++) { - std::string id = - BinaryWriter::toValue(deterministicRandom()->randomUniqueID(), Unversioned()).substr(12).toString(); - testData.push_back(p + id + n); - testData.push_back(p + id + a); - for (int j = 0; j < 5; j++) { - std::string okey = p + id + o + dbl + (char)j; - testData.push_back(okey + oi); - testData.push_back(okey + oa); - } - } - return testData; -} - -StringRef shortestKeyBetween(StringRef a, StringRef b) { - int p = commonPrefixLength(a.begin(), b.begin(), std::min(a.size(), b.size())); - ASSERT(p < b.size()); - return b.substr(0, p + 1); -} - -std::vector sampleBPlusTreeSeparators(std::vector rawDocs, int prefixToStrip) { - // In the middle of a B+Tree, we won't have adjacent document keys but separators between - // pages. These need only contain as many bytes as necessary to distinguish the last item - // in the previous page and the first item in the next page ("suffix compression"), and when - // balancing the tree we can move a few keys left or right if it makes a big difference in the - // suffix size ("split interval") - // The B+Tree will presumably also do its own prefix compression, so we trim off the "obvious" - // common prefix for this imaginary middle node - - std::vector testData; - std::sort(rawDocs.begin(), rawDocs.end()); - for (int i = 0; i + 1 < rawDocs.size(); i += 1000) { - StringRef bestSplitPoint = shortestKeyBetween(rawDocs[i], rawDocs[i + 1]); - - for (int j = i + 1; j < i + 11; j++) { - StringRef s = shortestKeyBetween(rawDocs[j], rawDocs[j + 1]); - if (s.size() < bestSplitPoint.size()) - bestSplitPoint = s; - } - - testData.push_back(bestSplitPoint.substr(prefixToStrip).toString()); - } - return testData; -} - -struct Page { - Page() : tree(nullptr), size(0), sizeBuilt(0), unsortedKeys(0) {} - - std::vector keys; - PrefixTree* tree; - std::string treeBuffer; - int size; - int sizeBuilt; - int unsortedKeys; - - void add(StringRef k) { - keys.emplace_back(k, StringRef()); - size += k.size(); - ++unsortedKeys; - } - - void sort() { - static auto cmp = [=](const PrefixTree::EntryRef& a, const PrefixTree::EntryRef& b) { return a.key < b.key; }; - if (unsortedKeys > 0) { - // sort newest elements, then merge - std::sort(keys.end() - unsortedKeys, keys.end(), cmp); - std::inplace_merge(keys.begin(), keys.end() - unsortedKeys, keys.end(), cmp); - unsortedKeys = 0; - } - } - - int build() { - if (sizeBuilt != size) { - sort(); - treeBuffer.reserve(keys.size() * PrefixTree::Node::getMaxOverhead(1, 256, 256) + size); - tree = (PrefixTree*)treeBuffer.data(); - int b = tree->build(&*keys.begin(), &*keys.end(), StringRef(), StringRef()); - sizeBuilt = size; - return b; - } - return 0; - } -}; - -void ingestBenchmark() { - std::vector keys_generated; - Arena arena; - std::set testmap; - for (int i = 0; i < 1000000; ++i) { - keys_generated.push_back(StringRef(arena, - format("........%02X......%02X.....%02X........%02X", - deterministicRandom()->randomInt(0, 100), - deterministicRandom()->randomInt(0, 100), - deterministicRandom()->randomInt(0, 100), - deterministicRandom()->randomInt(0, 100)))); - } - - double t1 = timer_monotonic(); - for (const auto& k : keys_generated) - testmap.insert(k); - double t2 = timer_monotonic(); - printf("Ingested %d elements into map, Speed %f M/s\n", - (int)keys_generated.size(), - keys_generated.size() / (t2 - t1) / 1e6); - - // sort a group after k elements were added - for (int k = 5; k <= 20; k += 5) { - // g is average page delta size - for (int g = 10; g <= 150; g += 10) { - // rebuild page after r bytes added - for (int r = 500; r <= 4000; r += 500) { - double elapsed = timer_monotonic(); - int builds = 0; - int buildbytes = 0; - int keybytes = 0; - - std::vector pages; - int pageCount = keys_generated.size() / g; - pages.resize(pageCount); - - for (auto& key : keys_generated) { - int p = deterministicRandom()->randomInt(0, pageCount); - Page*& pPage = pages[p]; - if (pPage == nullptr) - pPage = new Page(); - Page& page = *pPage; - - page.add(key); - keybytes += key.size(); - - if (page.keys.size() % k == 0) { - page.sort(); - } - - // Rebuild page after r bytes added - if (page.size - page.sizeBuilt > r) { - int b = page.build(); - if (b > 0) { - ++builds; - buildbytes += b; - } - } - } - - for (auto p : pages) { - if (p) { - int b = p->build(); - if (b > 0) { - ++builds; - buildbytes += b; - } - } - } - - elapsed = timer_monotonic() - elapsed; - printf("%6d keys %6d pages %3f builds/page %6d builds/s %6d pages/s %5d avg keys/page sort every " - "%d deltas rebuild every %5d bytes %7d keys/s %8d keybytes/s\n", - (int)keys_generated.size(), - pageCount, - (double)builds / pageCount, - int(builds / elapsed), - int(pageCount / elapsed), - g, - k, - r, - int(keys_generated.size() / elapsed), - int(keybytes / elapsed)); - - for (auto p : pages) { - delete p; - } - } - } - } -} - -int main() { - printf("CompactMap test\n"); - -#ifndef NDEBUG - printf("Compiler optimization is OFF\n"); -#endif - - printf("Key prefix compression is %s\n", CompactPreOrderTree::Node::ENABLE_PREFIX ? "ON" : "OFF"); - printf("Right subtree prefetch is %s\n", CompactPreOrderTree::ENABLE_PREFETCH_RIGHT ? "ON" : "OFF"); - printf("Left pointer is %s\n", CompactPreOrderTree::Node::ENABLE_LEFT_PTR ? "ON" : "OFF"); - printf("Fancy build is %s\n", CompactPreOrderTree::ENABLE_FANCY_BUILD ? "ON" : "OFF"); - - setThreadLocalDeterministicRandomSeed(1); - - // ingestBenchmark(); - - /*for (int subtree_size = 1; subtree_size < 20; subtree_size++) { - printf("Subtree of size %d:\n", subtree_size); - - int s = lessOrEqualPowerOfTwo((subtree_size - 1) / 2 + 1) - 1; - - printf(" s=%d\n", s); - printf(" 1 + s + s=%d\n", 1 + s + s); - printf(" left: %d\n", subtree_size - 1 - 2 * s); - - printf(" s*2+1: %d %d\n", s * 2 + 1, subtree_size - (s * 2 + 1) - 1); - printf(" n-s-1: %d %d\n", subtree_size-s-1, s); - printf(" min: %d %d\n", std::min(s * 2 + 1, subtree_size - s - 1), subtree_size - std::min(s * 2 + 1, - subtree_size - s - 1) - 1); - }*/ - - printf("\n16 byte hexadecimal random keys\n"); - std::vector testData; - for (int i = 0; i < 200; i++) { - testData.push_back(deterministicRandom()->randomUniqueID().shortString()); - } - std::vector sampleQueries; - for (int i = 0; i < 10000; i++) { - sampleQueries.push_back( - deterministicRandom()->randomUniqueID().shortString().substr(0, deterministicRandom()->randomInt(0, 16))); - } - compactMapTests(testData, sampleQueries); - - printf("\nRaw index keys\n"); - testData.clear(); - sampleQueries.clear(); - for (int i = 0; i < 100; i++) { - testData.push_back(format("%d Main Street #%d, New York NY 12345, United States of America|", - 1234 * (i / 100), - (i / 10) % 10 + 1000) + - deterministicRandom()->randomUniqueID().shortString()); - } - for (int i = 0; i < 10000; i++) - sampleQueries.push_back(format("%d Main Street", deterministicRandom()->randomInt(1000, 10000))); - compactMapTests(testData, sampleQueries, "graph_addresses.dot"); - - printf("\nb+tree separators for index keys\n"); - testData.clear(); - for (int i = 0; i < 100000; i++) { - testData.push_back(format("%d Main Street #%d, New York NY 12345, United States of America|", - 12 * (i / 100), - (i / 10) % 10 + 1000) + - deterministicRandom()->randomUniqueID().shortString()); - } - testData = sampleBPlusTreeSeparators(testData, 0); - compactMapTests(testData, sampleQueries); - - printf("\nraw document keys\n"); - testData = sampleDocuments(20); - sampleQueries.clear(); - std::string p = "pre"; - for (int i = 0; i < 10000; i++) - sampleQueries.push_back( - p + BinaryWriter::toValue(deterministicRandom()->randomUniqueID(), Unversioned()).substr(12).toString()); - compactMapTests(testData, sampleQueries); - - printf("\nb+tree split keys for documents\n"); - testData = sampleBPlusTreeSeparators(sampleDocuments(30000), p.size()); - compactMapTests(testData, sampleQueries); - - return 0; -} diff --git a/fdbserver/DiskQueue.actor.cpp b/fdbserver/DiskQueue.actor.cpp index 99f8a1667cb..0b96f30f67c 100644 --- a/fdbserver/DiskQueue.actor.cpp +++ b/fdbserver/DiskQueue.actor.cpp @@ -22,7 +22,7 @@ #include "flow/IAsyncFile.h" #include "fdbserver/Knobs.h" #include "fdbrpc/simulator.h" -#include "flow/crc32c.h" +#include "crc32/crc32c.h" #include "flow/genericactors.actor.h" #include "flow/xxhash.h" diff --git a/fdbserver/KeyValueStoreSQLite.actor.cpp b/fdbserver/KeyValueStoreSQLite.actor.cpp index 1977355b212..f65ce271998 100644 --- a/fdbserver/KeyValueStoreSQLite.actor.cpp +++ b/fdbserver/KeyValueStoreSQLite.actor.cpp @@ -20,7 +20,7 @@ #define SQLITE_THREADSAFE 0 // also in sqlite3.amalgamation.c! #include "fmt/format.h" -#include "flow/crc32c.h" +#include "crc32/crc32c.h" #include "fdbserver/IKeyValueStore.h" #include "fdbserver/CoroFlow.h" #include "fdbserver/Knobs.h" diff --git a/fdbserver/VFSAsync.cpp b/fdbserver/VFSAsync.cpp index b6a655a0105..9ea9007203f 100644 --- a/fdbserver/VFSAsync.cpp +++ b/fdbserver/VFSAsync.cpp @@ -18,7 +18,7 @@ * limitations under the License. */ -#include "sqlite/sqlite3.h" +#include "sqlite3.h" #include #include #include diff --git a/fdbserver/CoroFlow.actor.cpp b/fdbserver/coroimpl/CoroFlow.actor.cpp similarity index 100% rename from fdbserver/CoroFlow.actor.cpp rename to fdbserver/coroimpl/CoroFlow.actor.cpp diff --git a/fdbserver/CoroFlowCoro.actor.cpp b/fdbserver/coroimpl/CoroFlowCoro.actor.cpp similarity index 100% rename from fdbserver/CoroFlowCoro.actor.cpp rename to fdbserver/coroimpl/CoroFlowCoro.actor.cpp diff --git a/fdbserver/fdbserver.actor.cpp b/fdbserver/fdbserver.actor.cpp index 4666e4a0e88..62a2aaa6b20 100644 --- a/fdbserver/fdbserver.actor.cpp +++ b/fdbserver/fdbserver.actor.cpp @@ -74,7 +74,7 @@ #include "flow/DeterministicRandom.h" #include "flow/Platform.h" #include "flow/ProtocolVersion.h" -#include "flow/SimpleOpt.h" +#include "SimpleOpt/SimpleOpt.h" #include "flow/SystemMonitor.h" #include "flow/TLSConfig.actor.h" #include "fdbclient/Tracing.h" diff --git a/fdbserver/ApplyMetadataMutation.h b/fdbserver/include/fdbserver/ApplyMetadataMutation.h similarity index 100% rename from fdbserver/ApplyMetadataMutation.h rename to fdbserver/include/fdbserver/ApplyMetadataMutation.h diff --git a/fdbserver/ArtMutationBuffer.h b/fdbserver/include/fdbserver/ArtMutationBuffer.h similarity index 100% rename from fdbserver/ArtMutationBuffer.h rename to fdbserver/include/fdbserver/ArtMutationBuffer.h diff --git a/fdbserver/BackupInterface.h b/fdbserver/include/fdbserver/BackupInterface.h similarity index 100% rename from fdbserver/BackupInterface.h rename to fdbserver/include/fdbserver/BackupInterface.h diff --git a/fdbserver/BackupProgress.actor.h b/fdbserver/include/fdbserver/BackupProgress.actor.h similarity index 100% rename from fdbserver/BackupProgress.actor.h rename to fdbserver/include/fdbserver/BackupProgress.actor.h diff --git a/fdbserver/BlobGranuleServerCommon.actor.h b/fdbserver/include/fdbserver/BlobGranuleServerCommon.actor.h similarity index 100% rename from fdbserver/BlobGranuleServerCommon.actor.h rename to fdbserver/include/fdbserver/BlobGranuleServerCommon.actor.h diff --git a/fdbserver/BlobGranuleValidation.actor.h b/fdbserver/include/fdbserver/BlobGranuleValidation.actor.h similarity index 100% rename from fdbserver/BlobGranuleValidation.actor.h rename to fdbserver/include/fdbserver/BlobGranuleValidation.actor.h diff --git a/fdbserver/BlobManagerInterface.h b/fdbserver/include/fdbserver/BlobManagerInterface.h similarity index 100% rename from fdbserver/BlobManagerInterface.h rename to fdbserver/include/fdbserver/BlobManagerInterface.h diff --git a/fdbserver/ClusterController.actor.h b/fdbserver/include/fdbserver/ClusterController.actor.h similarity index 100% rename from fdbserver/ClusterController.actor.h rename to fdbserver/include/fdbserver/ClusterController.actor.h diff --git a/fdbserver/ClusterRecovery.actor.h b/fdbserver/include/fdbserver/ClusterRecovery.actor.h similarity index 100% rename from fdbserver/ClusterRecovery.actor.h rename to fdbserver/include/fdbserver/ClusterRecovery.actor.h diff --git a/fdbserver/ConfigBroadcastInterface.h b/fdbserver/include/fdbserver/ConfigBroadcastInterface.h similarity index 100% rename from fdbserver/ConfigBroadcastInterface.h rename to fdbserver/include/fdbserver/ConfigBroadcastInterface.h diff --git a/fdbserver/ConfigBroadcaster.h b/fdbserver/include/fdbserver/ConfigBroadcaster.h similarity index 100% rename from fdbserver/ConfigBroadcaster.h rename to fdbserver/include/fdbserver/ConfigBroadcaster.h diff --git a/fdbserver/ConfigFollowerInterface.h b/fdbserver/include/fdbserver/ConfigFollowerInterface.h similarity index 100% rename from fdbserver/ConfigFollowerInterface.h rename to fdbserver/include/fdbserver/ConfigFollowerInterface.h diff --git a/fdbserver/ConfigNode.h b/fdbserver/include/fdbserver/ConfigNode.h similarity index 100% rename from fdbserver/ConfigNode.h rename to fdbserver/include/fdbserver/ConfigNode.h diff --git a/fdbserver/ConflictSet.h b/fdbserver/include/fdbserver/ConflictSet.h similarity index 100% rename from fdbserver/ConflictSet.h rename to fdbserver/include/fdbserver/ConflictSet.h diff --git a/fdbserver/CoordinatedState.h b/fdbserver/include/fdbserver/CoordinatedState.h similarity index 100% rename from fdbserver/CoordinatedState.h rename to fdbserver/include/fdbserver/CoordinatedState.h diff --git a/fdbserver/CoordinationInterface.h b/fdbserver/include/fdbserver/CoordinationInterface.h similarity index 100% rename from fdbserver/CoordinationInterface.h rename to fdbserver/include/fdbserver/CoordinationInterface.h diff --git a/fdbserver/CoroFlow.h b/fdbserver/include/fdbserver/CoroFlow.h similarity index 100% rename from fdbserver/CoroFlow.h rename to fdbserver/include/fdbserver/CoroFlow.h diff --git a/fdbserver/DBCoreState.h b/fdbserver/include/fdbserver/DBCoreState.h similarity index 100% rename from fdbserver/DBCoreState.h rename to fdbserver/include/fdbserver/DBCoreState.h diff --git a/fdbserver/DDTeamCollection.h b/fdbserver/include/fdbserver/DDTeamCollection.h similarity index 100% rename from fdbserver/DDTeamCollection.h rename to fdbserver/include/fdbserver/DDTeamCollection.h diff --git a/fdbserver/DDTxnProcessor.h b/fdbserver/include/fdbserver/DDTxnProcessor.h similarity index 100% rename from fdbserver/DDTxnProcessor.h rename to fdbserver/include/fdbserver/DDTxnProcessor.h diff --git a/fdbserver/DataDistribution.actor.h b/fdbserver/include/fdbserver/DataDistribution.actor.h similarity index 100% rename from fdbserver/DataDistribution.actor.h rename to fdbserver/include/fdbserver/DataDistribution.actor.h diff --git a/fdbserver/DataDistributorInterface.h b/fdbserver/include/fdbserver/DataDistributorInterface.h similarity index 100% rename from fdbserver/DataDistributorInterface.h rename to fdbserver/include/fdbserver/DataDistributorInterface.h diff --git a/fdbserver/DeltaTree.h b/fdbserver/include/fdbserver/DeltaTree.h similarity index 100% rename from fdbserver/DeltaTree.h rename to fdbserver/include/fdbserver/DeltaTree.h diff --git a/fdbserver/EncryptKeyProxyInterface.h b/fdbserver/include/fdbserver/EncryptKeyProxyInterface.h similarity index 100% rename from fdbserver/EncryptKeyProxyInterface.h rename to fdbserver/include/fdbserver/EncryptKeyProxyInterface.h diff --git a/fdbserver/FDBExecHelper.actor.h b/fdbserver/include/fdbserver/FDBExecHelper.actor.h similarity index 100% rename from fdbserver/FDBExecHelper.actor.h rename to fdbserver/include/fdbserver/FDBExecHelper.actor.h diff --git a/fdbserver/GetEncryptCipherKeys.h b/fdbserver/include/fdbserver/GetEncryptCipherKeys.h similarity index 100% rename from fdbserver/GetEncryptCipherKeys.h rename to fdbserver/include/fdbserver/GetEncryptCipherKeys.h diff --git a/fdbserver/IConfigConsumer.h b/fdbserver/include/fdbserver/IConfigConsumer.h similarity index 100% rename from fdbserver/IConfigConsumer.h rename to fdbserver/include/fdbserver/IConfigConsumer.h diff --git a/fdbserver/IDiskQueue.h b/fdbserver/include/fdbserver/IDiskQueue.h similarity index 100% rename from fdbserver/IDiskQueue.h rename to fdbserver/include/fdbserver/IDiskQueue.h diff --git a/fdbserver/IKeyValueContainer.h b/fdbserver/include/fdbserver/IKeyValueContainer.h similarity index 100% rename from fdbserver/IKeyValueContainer.h rename to fdbserver/include/fdbserver/IKeyValueContainer.h diff --git a/fdbserver/IKeyValueStore.h b/fdbserver/include/fdbserver/IKeyValueStore.h similarity index 100% rename from fdbserver/IKeyValueStore.h rename to fdbserver/include/fdbserver/IKeyValueStore.h diff --git a/fdbserver/IPager.h b/fdbserver/include/fdbserver/IPager.h similarity index 100% rename from fdbserver/IPager.h rename to fdbserver/include/fdbserver/IPager.h diff --git a/fdbserver/KmsConnector.h b/fdbserver/include/fdbserver/KmsConnector.h similarity index 100% rename from fdbserver/KmsConnector.h rename to fdbserver/include/fdbserver/KmsConnector.h diff --git a/fdbserver/KmsConnectorInterface.h b/fdbserver/include/fdbserver/KmsConnectorInterface.h similarity index 100% rename from fdbserver/KmsConnectorInterface.h rename to fdbserver/include/fdbserver/KmsConnectorInterface.h diff --git a/fdbserver/KnobProtectiveGroups.h b/fdbserver/include/fdbserver/KnobProtectiveGroups.h similarity index 100% rename from fdbserver/KnobProtectiveGroups.h rename to fdbserver/include/fdbserver/KnobProtectiveGroups.h diff --git a/fdbserver/Knobs.h b/fdbserver/include/fdbserver/Knobs.h similarity index 100% rename from fdbserver/Knobs.h rename to fdbserver/include/fdbserver/Knobs.h diff --git a/fdbserver/LatencyBandConfig.h b/fdbserver/include/fdbserver/LatencyBandConfig.h similarity index 100% rename from fdbserver/LatencyBandConfig.h rename to fdbserver/include/fdbserver/LatencyBandConfig.h diff --git a/fdbserver/LeaderElection.h b/fdbserver/include/fdbserver/LeaderElection.h similarity index 100% rename from fdbserver/LeaderElection.h rename to fdbserver/include/fdbserver/LeaderElection.h diff --git a/fdbserver/LocalConfiguration.h b/fdbserver/include/fdbserver/LocalConfiguration.h similarity index 100% rename from fdbserver/LocalConfiguration.h rename to fdbserver/include/fdbserver/LocalConfiguration.h diff --git a/fdbserver/LogProtocolMessage.h b/fdbserver/include/fdbserver/LogProtocolMessage.h similarity index 100% rename from fdbserver/LogProtocolMessage.h rename to fdbserver/include/fdbserver/LogProtocolMessage.h diff --git a/fdbserver/LogSystem.h b/fdbserver/include/fdbserver/LogSystem.h similarity index 100% rename from fdbserver/LogSystem.h rename to fdbserver/include/fdbserver/LogSystem.h diff --git a/fdbserver/LogSystemConfig.h b/fdbserver/include/fdbserver/LogSystemConfig.h similarity index 100% rename from fdbserver/LogSystemConfig.h rename to fdbserver/include/fdbserver/LogSystemConfig.h diff --git a/fdbserver/LogSystemDiskQueueAdapter.h b/fdbserver/include/fdbserver/LogSystemDiskQueueAdapter.h similarity index 100% rename from fdbserver/LogSystemDiskQueueAdapter.h rename to fdbserver/include/fdbserver/LogSystemDiskQueueAdapter.h diff --git a/fdbserver/MasterInterface.h b/fdbserver/include/fdbserver/MasterInterface.h similarity index 100% rename from fdbserver/MasterInterface.h rename to fdbserver/include/fdbserver/MasterInterface.h diff --git a/fdbserver/MetricLogger.actor.h b/fdbserver/include/fdbserver/MetricLogger.actor.h similarity index 100% rename from fdbserver/MetricLogger.actor.h rename to fdbserver/include/fdbserver/MetricLogger.actor.h diff --git a/fdbserver/MoveKeys.actor.h b/fdbserver/include/fdbserver/MoveKeys.actor.h similarity index 100% rename from fdbserver/MoveKeys.actor.h rename to fdbserver/include/fdbserver/MoveKeys.actor.h diff --git a/fdbserver/MutationTracking.h b/fdbserver/include/fdbserver/MutationTracking.h similarity index 100% rename from fdbserver/MutationTracking.h rename to fdbserver/include/fdbserver/MutationTracking.h diff --git a/fdbserver/NetworkTest.h b/fdbserver/include/fdbserver/NetworkTest.h similarity index 100% rename from fdbserver/NetworkTest.h rename to fdbserver/include/fdbserver/NetworkTest.h diff --git a/fdbserver/OTELSpanContextMessage.h b/fdbserver/include/fdbserver/OTELSpanContextMessage.h similarity index 100% rename from fdbserver/OTELSpanContextMessage.h rename to fdbserver/include/fdbserver/OTELSpanContextMessage.h diff --git a/fdbserver/OnDemandStore.h b/fdbserver/include/fdbserver/OnDemandStore.h similarity index 100% rename from fdbserver/OnDemandStore.h rename to fdbserver/include/fdbserver/OnDemandStore.h diff --git a/fdbserver/PaxosConfigConsumer.h b/fdbserver/include/fdbserver/PaxosConfigConsumer.h similarity index 100% rename from fdbserver/PaxosConfigConsumer.h rename to fdbserver/include/fdbserver/PaxosConfigConsumer.h diff --git a/fdbserver/ProxyCommitData.actor.h b/fdbserver/include/fdbserver/ProxyCommitData.actor.h similarity index 100% rename from fdbserver/ProxyCommitData.actor.h rename to fdbserver/include/fdbserver/ProxyCommitData.actor.h diff --git a/fdbserver/QuietDatabase.h b/fdbserver/include/fdbserver/QuietDatabase.h similarity index 100% rename from fdbserver/QuietDatabase.h rename to fdbserver/include/fdbserver/QuietDatabase.h diff --git a/fdbserver/RESTKmsConnector.h b/fdbserver/include/fdbserver/RESTKmsConnector.h similarity index 100% rename from fdbserver/RESTKmsConnector.h rename to fdbserver/include/fdbserver/RESTKmsConnector.h diff --git a/fdbserver/RadixTree.h b/fdbserver/include/fdbserver/RadixTree.h similarity index 100% rename from fdbserver/RadixTree.h rename to fdbserver/include/fdbserver/RadixTree.h diff --git a/fdbserver/Ratekeeper.h b/fdbserver/include/fdbserver/Ratekeeper.h similarity index 100% rename from fdbserver/Ratekeeper.h rename to fdbserver/include/fdbserver/Ratekeeper.h diff --git a/fdbserver/RatekeeperInterface.h b/fdbserver/include/fdbserver/RatekeeperInterface.h similarity index 100% rename from fdbserver/RatekeeperInterface.h rename to fdbserver/include/fdbserver/RatekeeperInterface.h diff --git a/fdbserver/RecoveryState.h b/fdbserver/include/fdbserver/RecoveryState.h similarity index 100% rename from fdbserver/RecoveryState.h rename to fdbserver/include/fdbserver/RecoveryState.h diff --git a/fdbserver/RemoteIKeyValueStore.actor.h b/fdbserver/include/fdbserver/RemoteIKeyValueStore.actor.h similarity index 100% rename from fdbserver/RemoteIKeyValueStore.actor.h rename to fdbserver/include/fdbserver/RemoteIKeyValueStore.actor.h diff --git a/fdbserver/ResolutionBalancer.actor.h b/fdbserver/include/fdbserver/ResolutionBalancer.actor.h similarity index 100% rename from fdbserver/ResolutionBalancer.actor.h rename to fdbserver/include/fdbserver/ResolutionBalancer.actor.h diff --git a/fdbserver/ResolverInterface.h b/fdbserver/include/fdbserver/ResolverInterface.h similarity index 100% rename from fdbserver/ResolverInterface.h rename to fdbserver/include/fdbserver/ResolverInterface.h diff --git a/fdbserver/RestoreApplier.actor.h b/fdbserver/include/fdbserver/RestoreApplier.actor.h similarity index 100% rename from fdbserver/RestoreApplier.actor.h rename to fdbserver/include/fdbserver/RestoreApplier.actor.h diff --git a/fdbserver/RestoreCommon.actor.h b/fdbserver/include/fdbserver/RestoreCommon.actor.h similarity index 100% rename from fdbserver/RestoreCommon.actor.h rename to fdbserver/include/fdbserver/RestoreCommon.actor.h diff --git a/fdbserver/RestoreController.actor.h b/fdbserver/include/fdbserver/RestoreController.actor.h similarity index 100% rename from fdbserver/RestoreController.actor.h rename to fdbserver/include/fdbserver/RestoreController.actor.h diff --git a/fdbserver/RestoreLoader.actor.h b/fdbserver/include/fdbserver/RestoreLoader.actor.h similarity index 100% rename from fdbserver/RestoreLoader.actor.h rename to fdbserver/include/fdbserver/RestoreLoader.actor.h diff --git a/fdbserver/RestoreRoleCommon.actor.h b/fdbserver/include/fdbserver/RestoreRoleCommon.actor.h similarity index 100% rename from fdbserver/RestoreRoleCommon.actor.h rename to fdbserver/include/fdbserver/RestoreRoleCommon.actor.h diff --git a/fdbserver/RestoreUtil.h b/fdbserver/include/fdbserver/RestoreUtil.h similarity index 100% rename from fdbserver/RestoreUtil.h rename to fdbserver/include/fdbserver/RestoreUtil.h diff --git a/fdbserver/RestoreWorker.actor.h b/fdbserver/include/fdbserver/RestoreWorker.actor.h similarity index 100% rename from fdbserver/RestoreWorker.actor.h rename to fdbserver/include/fdbserver/RestoreWorker.actor.h diff --git a/fdbserver/RestoreWorkerInterface.actor.h b/fdbserver/include/fdbserver/RestoreWorkerInterface.actor.h similarity index 100% rename from fdbserver/RestoreWorkerInterface.actor.h rename to fdbserver/include/fdbserver/RestoreWorkerInterface.actor.h diff --git a/fdbserver/RkTagThrottleCollection.h b/fdbserver/include/fdbserver/RkTagThrottleCollection.h similarity index 100% rename from fdbserver/RkTagThrottleCollection.h rename to fdbserver/include/fdbserver/RkTagThrottleCollection.h diff --git a/fdbserver/RocksDBCheckpointUtils.actor.h b/fdbserver/include/fdbserver/RocksDBCheckpointUtils.actor.h similarity index 100% rename from fdbserver/RocksDBCheckpointUtils.actor.h rename to fdbserver/include/fdbserver/RocksDBCheckpointUtils.actor.h diff --git a/fdbserver/RoleLineage.actor.h b/fdbserver/include/fdbserver/RoleLineage.actor.h similarity index 100% rename from fdbserver/RoleLineage.actor.h rename to fdbserver/include/fdbserver/RoleLineage.actor.h diff --git a/fdbserver/ServerCheckpoint.actor.h b/fdbserver/include/fdbserver/ServerCheckpoint.actor.h similarity index 100% rename from fdbserver/ServerCheckpoint.actor.h rename to fdbserver/include/fdbserver/ServerCheckpoint.actor.h diff --git a/fdbserver/ServerDBInfo.actor.h b/fdbserver/include/fdbserver/ServerDBInfo.actor.h similarity index 100% rename from fdbserver/ServerDBInfo.actor.h rename to fdbserver/include/fdbserver/ServerDBInfo.actor.h diff --git a/fdbserver/ServerDBInfo.h b/fdbserver/include/fdbserver/ServerDBInfo.h similarity index 100% rename from fdbserver/ServerDBInfo.h rename to fdbserver/include/fdbserver/ServerDBInfo.h diff --git a/fdbserver/SimEncryptKmsProxy.actor.h b/fdbserver/include/fdbserver/SimEncryptKmsProxy.actor.h similarity index 100% rename from fdbserver/SimEncryptKmsProxy.actor.h rename to fdbserver/include/fdbserver/SimEncryptKmsProxy.actor.h diff --git a/fdbserver/SimKmsConnector.h b/fdbserver/include/fdbserver/SimKmsConnector.h similarity index 100% rename from fdbserver/SimKmsConnector.h rename to fdbserver/include/fdbserver/SimKmsConnector.h diff --git a/fdbserver/SimpleConfigConsumer.h b/fdbserver/include/fdbserver/SimpleConfigConsumer.h similarity index 100% rename from fdbserver/SimpleConfigConsumer.h rename to fdbserver/include/fdbserver/SimpleConfigConsumer.h diff --git a/fdbserver/SimulatedCluster.h b/fdbserver/include/fdbserver/SimulatedCluster.h similarity index 100% rename from fdbserver/SimulatedCluster.h rename to fdbserver/include/fdbserver/SimulatedCluster.h diff --git a/fdbserver/SpanContextMessage.h b/fdbserver/include/fdbserver/SpanContextMessage.h similarity index 100% rename from fdbserver/SpanContextMessage.h rename to fdbserver/include/fdbserver/SpanContextMessage.h diff --git a/fdbserver/Status.h b/fdbserver/include/fdbserver/Status.h similarity index 100% rename from fdbserver/Status.h rename to fdbserver/include/fdbserver/Status.h diff --git a/fdbserver/StorageMetrics.h b/fdbserver/include/fdbserver/StorageMetrics.h similarity index 100% rename from fdbserver/StorageMetrics.h rename to fdbserver/include/fdbserver/StorageMetrics.h diff --git a/fdbserver/TCInfo.h b/fdbserver/include/fdbserver/TCInfo.h similarity index 100% rename from fdbserver/TCInfo.h rename to fdbserver/include/fdbserver/TCInfo.h diff --git a/fdbserver/TLogInterface.h b/fdbserver/include/fdbserver/TLogInterface.h similarity index 100% rename from fdbserver/TLogInterface.h rename to fdbserver/include/fdbserver/TLogInterface.h diff --git a/fdbserver/TSSMappingUtil.actor.h b/fdbserver/include/fdbserver/TSSMappingUtil.actor.h similarity index 100% rename from fdbserver/TSSMappingUtil.actor.h rename to fdbserver/include/fdbserver/TSSMappingUtil.actor.h diff --git a/fdbserver/TagPartitionedLogSystem.actor.h b/fdbserver/include/fdbserver/TagPartitionedLogSystem.actor.h similarity index 100% rename from fdbserver/TagPartitionedLogSystem.actor.h rename to fdbserver/include/fdbserver/TagPartitionedLogSystem.actor.h diff --git a/fdbserver/TagThrottler.h b/fdbserver/include/fdbserver/TagThrottler.h similarity index 100% rename from fdbserver/TagThrottler.h rename to fdbserver/include/fdbserver/TagThrottler.h diff --git a/fdbserver/TenantCache.h b/fdbserver/include/fdbserver/TenantCache.h similarity index 100% rename from fdbserver/TenantCache.h rename to fdbserver/include/fdbserver/TenantCache.h diff --git a/fdbserver/TesterInterface.actor.h b/fdbserver/include/fdbserver/TesterInterface.actor.h similarity index 100% rename from fdbserver/TesterInterface.actor.h rename to fdbserver/include/fdbserver/TesterInterface.actor.h diff --git a/fdbserver/TransactionTagCounter.h b/fdbserver/include/fdbserver/TransactionTagCounter.h similarity index 100% rename from fdbserver/TransactionTagCounter.h rename to fdbserver/include/fdbserver/TransactionTagCounter.h diff --git a/fdbserver/VFSAsync.h b/fdbserver/include/fdbserver/VFSAsync.h similarity index 100% rename from fdbserver/VFSAsync.h rename to fdbserver/include/fdbserver/VFSAsync.h diff --git a/fdbserver/WaitFailure.h b/fdbserver/include/fdbserver/WaitFailure.h similarity index 100% rename from fdbserver/WaitFailure.h rename to fdbserver/include/fdbserver/WaitFailure.h diff --git a/fdbserver/WorkerInterface.actor.h b/fdbserver/include/fdbserver/WorkerInterface.actor.h similarity index 100% rename from fdbserver/WorkerInterface.actor.h rename to fdbserver/include/fdbserver/WorkerInterface.actor.h diff --git a/fdbserver/art.h b/fdbserver/include/fdbserver/art.h similarity index 100% rename from fdbserver/art.h rename to fdbserver/include/fdbserver/art.h diff --git a/fdbserver/art_impl.h b/fdbserver/include/fdbserver/art_impl.h similarity index 100% rename from fdbserver/art_impl.h rename to fdbserver/include/fdbserver/art_impl.h diff --git a/fdbserver/pubsub.h b/fdbserver/include/fdbserver/pubsub.h similarity index 100% rename from fdbserver/pubsub.h rename to fdbserver/include/fdbserver/pubsub.h diff --git a/fdbserver/template_fdb.h b/fdbserver/include/fdbserver/template_fdb.h similarity index 100% rename from fdbserver/template_fdb.h rename to fdbserver/include/fdbserver/template_fdb.h diff --git a/fdbserver/workloads/ApiWorkload.h b/fdbserver/include/fdbserver/workloads/ApiWorkload.h similarity index 100% rename from fdbserver/workloads/ApiWorkload.h rename to fdbserver/include/fdbserver/workloads/ApiWorkload.h diff --git a/fdbserver/workloads/AsyncFile.actor.h b/fdbserver/include/fdbserver/workloads/AsyncFile.actor.h similarity index 100% rename from fdbserver/workloads/AsyncFile.actor.h rename to fdbserver/include/fdbserver/workloads/AsyncFile.actor.h diff --git a/fdbserver/workloads/BlobStoreWorkload.h b/fdbserver/include/fdbserver/workloads/BlobStoreWorkload.h similarity index 100% rename from fdbserver/workloads/BlobStoreWorkload.h rename to fdbserver/include/fdbserver/workloads/BlobStoreWorkload.h diff --git a/fdbserver/workloads/BulkSetup.actor.h b/fdbserver/include/fdbserver/workloads/BulkSetup.actor.h similarity index 100% rename from fdbserver/workloads/BulkSetup.actor.h rename to fdbserver/include/fdbserver/workloads/BulkSetup.actor.h diff --git a/fdbserver/workloads/MemoryKeyValueStore.h b/fdbserver/include/fdbserver/workloads/MemoryKeyValueStore.h similarity index 100% rename from fdbserver/workloads/MemoryKeyValueStore.h rename to fdbserver/include/fdbserver/workloads/MemoryKeyValueStore.h diff --git a/fdbserver/workloads/ReadWriteWorkload.actor.h b/fdbserver/include/fdbserver/workloads/ReadWriteWorkload.actor.h similarity index 100% rename from fdbserver/workloads/ReadWriteWorkload.actor.h rename to fdbserver/include/fdbserver/workloads/ReadWriteWorkload.actor.h diff --git a/fdbserver/workloads/TPCCWorkload.h b/fdbserver/include/fdbserver/workloads/TPCCWorkload.h similarity index 100% rename from fdbserver/workloads/TPCCWorkload.h rename to fdbserver/include/fdbserver/workloads/TPCCWorkload.h diff --git a/fdbserver/workloads/workloads.actor.h b/fdbserver/include/fdbserver/workloads/workloads.actor.h similarity index 100% rename from fdbserver/workloads/workloads.actor.h rename to fdbserver/include/fdbserver/workloads/workloads.actor.h diff --git a/fdbserver/workloads/Mako.actor.cpp b/fdbserver/workloads/Mako.actor.cpp index e1ec2ba9f7d..d6597674c48 100644 --- a/fdbserver/workloads/Mako.actor.cpp +++ b/fdbserver/workloads/Mako.actor.cpp @@ -24,7 +24,7 @@ #include "fdbserver/workloads/BulkSetup.actor.h" #include "fdbclient/ReadYourWrites.h" #include "fdbclient/zipf.h" -#include "flow/crc32c.h" +#include "crc32/crc32c.h" #include "flow/actorcompiler.h" enum { diff --git a/fdbservice/FDBService.cpp b/fdbservice/FDBService.cpp index 26b862ae6f6..66df1c1815f 100644 --- a/fdbservice/FDBService.cpp +++ b/fdbservice/FDBService.cpp @@ -28,7 +28,7 @@ #include #include -#include "flow/SimpleOpt.h" +#include "SimpleOpt/SimpleOpt.h" #include "fdbclient/SimpleIni.h" #include "fdbclient/versions.h" diff --git a/flow/Arena.cpp b/flow/Arena.cpp index 2bd9a573708..07b7740a496 100644 --- a/flow/Arena.cpp +++ b/flow/Arena.cpp @@ -18,7 +18,7 @@ * limitations under the License. */ -#include "Arena.h" +#include "flow/Arena.h" #include "flow/UnitTest.h" diff --git a/flow/CMakeLists.txt b/flow/CMakeLists.txt index 0a3a8e39a85..3034c77ba63 100644 --- a/flow/CMakeLists.txt +++ b/flow/CMakeLists.txt @@ -1,145 +1,6 @@ find_package(Threads REQUIRED) -set(FLOW_SRCS - ActorCollection.actor.cpp - ActorCollection.h - Arena.cpp - Arena.h - ArgParseUtil.h - AsioReactor.h - BooleanParam.h - BlobCipher.h - BlobCipher.cpp - CompressedInt.actor.cpp - CompressedInt.h - DebugTrace.h - Deque.cpp - Deque.h - DeterministicRandom.cpp - DeterministicRandom.h - Error.cpp - Error.h - EventTypes.actor.h - EncryptUtils.h - EncryptUtils.cpp - FastAlloc.cpp - FastAlloc.h - FastRef.h - FaultInjection.cpp - FaultInjection.h - FileIdentifier.h - FileTraceLogWriter.cpp - FileTraceLogWriter.h - Hash3.c - Hash3.h - Histogram.cpp - Histogram.h - Hostname.actor.cpp - Hostname.h - IAsyncFile.h - IAsyncFile.actor.cpp - IDispatched.h - IRandom.h - IRateControl.h - IThreadPoolTest.actor.cpp - IThreadPool.cpp - IThreadPool.h - ITrace.h - IndexedSet.actor.h - IndexedSet.cpp - IndexedSet.h - JsonTraceLogFormatter.cpp - JsonTraceLogFormatter.h - Knobs.cpp - Knobs.h - MetricSample.h - MkCert.h - MkCert.cpp - Net2.actor.cpp - Net2Packet.cpp - Net2Packet.h - ObjectSerializer.h - ObjectSerializerTraits.h - PKey.h - PKey.cpp - Platform.actor.cpp - Platform.actor.h - Platform.h - Profiler.actor.cpp - Profiler.h - ProtocolVersion.h - ScopeExit.h - SendBufferIterator.h - SimpleOpt.h - StreamCipher.cpp - StreamCipher.h - SystemMonitor.cpp - SystemMonitor.h - TDMetric.actor.h - TDMetric.cpp - TLSConfig.actor.cpp - TLSConfig.actor.h - ThreadHelper.actor.h - ThreadHelper.actor.cpp - ThreadPrimitives.cpp - ThreadPrimitives.h - ThreadSafeQueue.h - Trace.cpp - Trace.h - TreeBenchmark.h - TypeTraits.h - UnitTest.cpp - UnitTest.h - Util.h - WriteOnlySet.h - WriteOnlySet.actor.cpp - XmlTraceLogFormatter.cpp - XmlTraceLogFormatter.h - actorcompiler.h - crc32c.h - crc32c.cpp - ppc-asm.h - crc32.S - crc32_wrapper.h - crc32_wrapper.c - error_definitions.h - ${CMAKE_CURRENT_BINARY_DIR}/include/flow/SourceVersion.h - flat_buffers.cpp - flat_buffers.h - flow.cpp - flow.h - folly_memcpy.h - genericactors.actor.cpp - genericactors.actor.h - network.cpp - network.h - rte_memcpy.h - serialize.cpp - serialize.h - sse2neon.h - singleton.h - stacktrace.h - test_memcpy.cpp - test_memcpy_perf.cpp - unactorcompiler.h - version.cpp - xxhash.c - xxhash.h) - -add_library(stacktrace stacktrace.amalgamation.cpp stacktrace.h) -if (USE_ASAN) - target_compile_definitions(stacktrace PRIVATE ADDRESS_SANITIZER) -elseif(USE_MSAN) - target_compile_definitions(stacktrace PRIVATE MEMORY_SANITIZER) -elseif(USE_UBSAN) - target_compile_definitions(stacktrace PRIVATE UNDEFINED_BEHAVIOR_SANITIZER) -elseif(USE_TSAN) - target_compile_definitions(stacktrace PRIVATE THREAD_SANITIZER DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1) -endif() - -if(UNIX AND NOT APPLE) - list(APPEND FLOW_SRCS folly_memcpy.S) -endif() +fdb_find_sources(FLOW_SRCS) if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") list(APPEND FLOW_SRCS aarch64/memcmp.S aarch64/memcpy.S) @@ -150,75 +11,68 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/SourceVersion.h.cmake ${CMAKE_CURRENT configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/include/flow/config.h) add_flow_target(STATIC_LIBRARY NAME flow SRCS ${FLOW_SRCS}) -target_link_libraries(flow PRIVATE stacktrace) -target_link_libraries(flow PUBLIC fmt::fmt) - add_flow_target(STATIC_LIBRARY NAME flow_sampling SRCS ${FLOW_SRCS}) -target_link_libraries(flow_sampling PRIVATE stacktrace) -target_link_libraries(flow_sampling PUBLIC fmt::fmt) + +foreach(ft flow flow_sampling) + target_include_directories(${ft} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}/include") + + target_link_libraries(${ft} PRIVATE stacktrace) + target_link_libraries(${ft} PUBLIC fmt::fmt SimpleOpt crc32) + if(UNIX AND NOT APPLE) + target_link_libraries(${ft} PRIVATE folly_memcpy) + target_compile_definitions(${ft} PRIVATE WITH_FOLLY_MEMCPY) + endif() + + if (NOT APPLE AND NOT WIN32) + set (FLOW_LIBS ${FLOW_LIBS} rt) + elseif(WIN32) + target_link_libraries(${ft} PUBLIC winmm.lib) + target_link_libraries(${ft} PUBLIC psapi.lib) + endif() + + if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + set (FLOW_LIBS ${FLOW_LIBS} execinfo devstat) + find_library(EIO eio) + if(EIO) + target_link_libraries(${ft} PUBLIC ${EIO}) + endif() + endif() + target_link_libraries(${ft} PRIVATE ${FLOW_LIBS}) + + if(USE_VALGRIND) + target_link_libraries(${ft} PUBLIC Valgrind) + endif() + target_link_libraries(${ft} PUBLIC OpenSSL::SSL) + if(USE_WOLFSSL) + target_include_directories(${ft} SYSTEM BEFORE PUBLIC ${WOLFSSL_INCLUDE_DIR}/wolfssl) + endif() + target_link_libraries(${ft} PUBLIC Threads::Threads ${CMAKE_DL_LIBS}) + if(USE_SANITIZER) + target_link_libraries(${ft} PUBLIC boost_asan) + else() + target_link_libraries(${ft} PUBLIC boost_target) + endif() + if(USE_VALGRIND) + target_link_libraries(${ft} PUBLIC Valgrind) + endif() + + if(APPLE) + find_library(IO_KIT IOKit) + find_library(CORE_FOUNDATION CoreFoundation) + target_link_libraries(${ft} PRIVATE ${IO_KIT} ${CORE_FOUNDATION}) + endif() +endforeach() + target_compile_definitions(flow_sampling PRIVATE -DENABLE_SAMPLING) if(WIN32) add_dependencies(flow_sampling_actors flow_actors) endif() -if (NOT APPLE AND NOT WIN32) - set (FLOW_LIBS ${FLOW_LIBS} rt) -elseif(WIN32) - target_link_libraries(flow PUBLIC winmm.lib) - target_link_libraries(flow PUBLIC psapi.lib) - target_link_libraries(flow_sampling PUBLIC winmm.lib) - target_link_libraries(flow_sampling PUBLIC psapi.lib) -endif() -if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") - set (FLOW_LIBS ${FLOW_LIBS} execinfo devstat) - find_library(EIO eio) - if(EIO) - target_link_libraries(flow PUBLIC ${EIO}) - target_link_libraries(flow_sampling PUBLIC ${EIO}) - endif() -endif() -target_link_libraries(flow PRIVATE ${FLOW_LIBS}) -target_link_libraries(flow_sampling PRIVATE ${FLOW_LIBS}) -if(USE_VALGRIND) - target_link_libraries(flow PUBLIC Valgrind) - target_link_libraries(flow_sampling PUBLIC Valgrind) -endif() -target_link_libraries(flow PUBLIC OpenSSL::SSL) -target_link_libraries(flow_sampling PUBLIC OpenSSL::SSL) -if(USE_WOLFSSL) - target_include_directories(flow SYSTEM BEFORE PUBLIC ${WOLFSSL_INCLUDE_DIR}/wolfssl) - target_include_directories(flow_sampling SYSTEM BEFORE PUBLIC ${WOLFSSL_INCLUDE_DIR}/wolfssl) -endif() -target_link_libraries(flow PUBLIC Threads::Threads ${CMAKE_DL_LIBS}) -target_link_libraries(flow_sampling PUBLIC Threads::Threads ${CMAKE_DL_LIBS}) -if(USE_SANITIZER) - target_link_libraries(flow PUBLIC boost_asan) - target_link_libraries(flow_sampling PUBLIC boost_asan) -else() - target_link_libraries(flow PUBLIC boost_target) - target_link_libraries(flow_sampling PUBLIC boost_target) -endif() -if(USE_VALGRIND) - target_link_libraries(flow PUBLIC Valgrind) - target_link_libraries(flow_sampling PUBLIC Valgrind) -endif() - -if(APPLE) - find_library(IO_KIT IOKit) - find_library(CORE_FOUNDATION CoreFoundation) - target_link_libraries(flow PRIVATE ${IO_KIT} ${CORE_FOUNDATION}) - target_link_libraries(flow_sampling PRIVATE ${IO_KIT} ${CORE_FOUNDATION}) -endif() add_executable(mkcert MkCertCli.cpp) -target_link_libraries(mkcert PUBLIC fmt::fmt flow) +target_link_libraries(mkcert PUBLIC flow) add_executable(mtls_unittest TLSTest.cpp) -target_link_libraries(mtls_unittest PUBLIC fmt::fmt flow) -if(USE_SANITIZER) - target_link_libraries(mtls_unittest PUBLIC boost_asan) -else() - target_link_libraries(mtls_unittest PUBLIC boost_target) -endif() +target_link_libraries(mtls_unittest PUBLIC flow) add_test(NAME mutual_tls_unittest COMMAND $) diff --git a/flow/Error.cpp b/flow/Error.cpp index e756fb6d867..04302d98d61 100644 --- a/flow/Error.cpp +++ b/flow/Error.cpp @@ -184,7 +184,7 @@ ErrorCodeTable::ErrorCodeTable() { #define ERROR(name, number, description) \ addCode(number, #name, description); \ enum { Duplicate_Error_Code_##number = 0 }; -#include "error_definitions.h" +#include "flow/error_definitions.h" } void ErrorCodeTable::addCode(int code, const char* name, const char* description) { diff --git a/flow/FastAlloc.cpp b/flow/FastAlloc.cpp index dd6f68c5420..5b4d80185f7 100644 --- a/flow/FastAlloc.cpp +++ b/flow/FastAlloc.cpp @@ -25,7 +25,7 @@ #include "flow/Error.h" #include "flow/Knobs.h" #include "flow/UnitTest.h" -#include "flow/crc32c.h" +#include "crc32/crc32c.h" #include "flow/flow.h" #include diff --git a/flow/MkCertCli.cpp b/flow/MkCertCli.cpp index 29bb70ebb47..7517e2a2036 100644 --- a/flow/MkCertCli.cpp +++ b/flow/MkCertCli.cpp @@ -30,7 +30,7 @@ #include "flow/network.h" #include "flow/Platform.h" #include "flow/ScopeExit.h" -#include "flow/SimpleOpt.h" +#include "SimpleOpt/SimpleOpt.h" #include "flow/TLSConfig.actor.h" #include "flow/Trace.h" diff --git a/flow/Platform.actor.cpp b/flow/Platform.actor.cpp index 6252d46ba66..c7352bedeb5 100644 --- a/flow/Platform.actor.cpp +++ b/flow/Platform.actor.cpp @@ -96,7 +96,7 @@ #include #include -#include "flow/stacktrace.h" +#include "stacktrace/stacktrace.h" #ifdef __linux__ /* Needed for memory allocation */ @@ -3244,24 +3244,6 @@ int eraseDirectoryRecursive(std::string const& dir) { return __eraseDirectoryRecurseiveCount; } -bool isHwCrcSupported() { -#if defined(_WIN32) - int info[4]; - __cpuid(info, 1); - return (info[2] & (1 << 20)) != 0; -#elif defined(__aarch64__) - return true; /* force to use crc instructions */ -#elif defined(__powerpc64__) - return false; /* force not to use crc instructions */ -#elif defined(__unixish__) - uint32_t eax, ebx, ecx, edx, level = 1, count = 0; - __cpuid_count(level, count, eax, ebx, ecx, edx); - return ((ecx >> 20) & 1) != 0; -#else -#error Port me! -#endif -} - TmpFile::TmpFile() : filename("") { createTmpFile(boost::filesystem::temp_directory_path().string(), TmpFile::defaultPrefix); } diff --git a/flow/flow.cpp b/flow/flow.cpp index fc09c92ab41..e758ffbfd3c 100644 --- a/flow/flow.cpp +++ b/flow/flow.cpp @@ -22,7 +22,9 @@ #include "flow/DeterministicRandom.h" #include "flow/UnitTest.h" #include "flow/rte_memcpy.h" -#include "flow/folly_memcpy.h" +#ifdef WITH_FOLLY_MEMCPY +#include "folly_memcpy.h" +#endif #include #include diff --git a/flow/ActorCollection.h b/flow/include/flow/ActorCollection.h similarity index 100% rename from flow/ActorCollection.h rename to flow/include/flow/ActorCollection.h diff --git a/flow/Arena.h b/flow/include/flow/Arena.h similarity index 100% rename from flow/Arena.h rename to flow/include/flow/Arena.h diff --git a/flow/ArgParseUtil.h b/flow/include/flow/ArgParseUtil.h similarity index 100% rename from flow/ArgParseUtil.h rename to flow/include/flow/ArgParseUtil.h diff --git a/flow/AsioReactor.h b/flow/include/flow/AsioReactor.h similarity index 100% rename from flow/AsioReactor.h rename to flow/include/flow/AsioReactor.h diff --git a/flow/BlobCipher.h b/flow/include/flow/BlobCipher.h similarity index 100% rename from flow/BlobCipher.h rename to flow/include/flow/BlobCipher.h diff --git a/flow/BooleanParam.h b/flow/include/flow/BooleanParam.h similarity index 100% rename from flow/BooleanParam.h rename to flow/include/flow/BooleanParam.h diff --git a/flow/CompressedInt.h b/flow/include/flow/CompressedInt.h similarity index 100% rename from flow/CompressedInt.h rename to flow/include/flow/CompressedInt.h diff --git a/flow/DebugTrace.h b/flow/include/flow/DebugTrace.h similarity index 100% rename from flow/DebugTrace.h rename to flow/include/flow/DebugTrace.h diff --git a/flow/Deque.h b/flow/include/flow/Deque.h similarity index 100% rename from flow/Deque.h rename to flow/include/flow/Deque.h diff --git a/flow/DeterministicRandom.h b/flow/include/flow/DeterministicRandom.h similarity index 100% rename from flow/DeterministicRandom.h rename to flow/include/flow/DeterministicRandom.h diff --git a/flow/EncryptUtils.h b/flow/include/flow/EncryptUtils.h similarity index 100% rename from flow/EncryptUtils.h rename to flow/include/flow/EncryptUtils.h diff --git a/flow/Error.h b/flow/include/flow/Error.h similarity index 100% rename from flow/Error.h rename to flow/include/flow/Error.h diff --git a/flow/EventTypes.actor.h b/flow/include/flow/EventTypes.actor.h similarity index 100% rename from flow/EventTypes.actor.h rename to flow/include/flow/EventTypes.actor.h diff --git a/flow/FastAlloc.h b/flow/include/flow/FastAlloc.h similarity index 100% rename from flow/FastAlloc.h rename to flow/include/flow/FastAlloc.h diff --git a/flow/FastRef.h b/flow/include/flow/FastRef.h similarity index 100% rename from flow/FastRef.h rename to flow/include/flow/FastRef.h diff --git a/flow/FaultInjection.h b/flow/include/flow/FaultInjection.h similarity index 100% rename from flow/FaultInjection.h rename to flow/include/flow/FaultInjection.h diff --git a/flow/FileIdentifier.h b/flow/include/flow/FileIdentifier.h similarity index 100% rename from flow/FileIdentifier.h rename to flow/include/flow/FileIdentifier.h diff --git a/flow/FileTraceLogWriter.h b/flow/include/flow/FileTraceLogWriter.h similarity index 100% rename from flow/FileTraceLogWriter.h rename to flow/include/flow/FileTraceLogWriter.h diff --git a/flow/Hash3.h b/flow/include/flow/Hash3.h similarity index 100% rename from flow/Hash3.h rename to flow/include/flow/Hash3.h diff --git a/flow/Histogram.h b/flow/include/flow/Histogram.h similarity index 100% rename from flow/Histogram.h rename to flow/include/flow/Histogram.h diff --git a/flow/Hostname.h b/flow/include/flow/Hostname.h similarity index 100% rename from flow/Hostname.h rename to flow/include/flow/Hostname.h diff --git a/flow/IAsyncFile.h b/flow/include/flow/IAsyncFile.h similarity index 100% rename from flow/IAsyncFile.h rename to flow/include/flow/IAsyncFile.h diff --git a/flow/IDispatched.h b/flow/include/flow/IDispatched.h similarity index 100% rename from flow/IDispatched.h rename to flow/include/flow/IDispatched.h diff --git a/flow/IRandom.h b/flow/include/flow/IRandom.h similarity index 100% rename from flow/IRandom.h rename to flow/include/flow/IRandom.h diff --git a/flow/IRateControl.h b/flow/include/flow/IRateControl.h similarity index 100% rename from flow/IRateControl.h rename to flow/include/flow/IRateControl.h diff --git a/flow/IThreadPool.h b/flow/include/flow/IThreadPool.h similarity index 100% rename from flow/IThreadPool.h rename to flow/include/flow/IThreadPool.h diff --git a/flow/ITrace.h b/flow/include/flow/ITrace.h similarity index 100% rename from flow/ITrace.h rename to flow/include/flow/ITrace.h diff --git a/flow/IndexedSet.actor.h b/flow/include/flow/IndexedSet.actor.h similarity index 100% rename from flow/IndexedSet.actor.h rename to flow/include/flow/IndexedSet.actor.h diff --git a/flow/IndexedSet.h b/flow/include/flow/IndexedSet.h similarity index 100% rename from flow/IndexedSet.h rename to flow/include/flow/IndexedSet.h diff --git a/flow/JsonTraceLogFormatter.h b/flow/include/flow/JsonTraceLogFormatter.h similarity index 100% rename from flow/JsonTraceLogFormatter.h rename to flow/include/flow/JsonTraceLogFormatter.h diff --git a/flow/Knobs.h b/flow/include/flow/Knobs.h similarity index 100% rename from flow/Knobs.h rename to flow/include/flow/Knobs.h diff --git a/flow/MetricSample.h b/flow/include/flow/MetricSample.h similarity index 100% rename from flow/MetricSample.h rename to flow/include/flow/MetricSample.h diff --git a/flow/MkCert.h b/flow/include/flow/MkCert.h similarity index 100% rename from flow/MkCert.h rename to flow/include/flow/MkCert.h diff --git a/flow/Net2Packet.h b/flow/include/flow/Net2Packet.h similarity index 100% rename from flow/Net2Packet.h rename to flow/include/flow/Net2Packet.h diff --git a/flow/ObjectSerializer.h b/flow/include/flow/ObjectSerializer.h similarity index 100% rename from flow/ObjectSerializer.h rename to flow/include/flow/ObjectSerializer.h diff --git a/flow/ObjectSerializerTraits.h b/flow/include/flow/ObjectSerializerTraits.h similarity index 100% rename from flow/ObjectSerializerTraits.h rename to flow/include/flow/ObjectSerializerTraits.h diff --git a/flow/PKey.h b/flow/include/flow/PKey.h similarity index 100% rename from flow/PKey.h rename to flow/include/flow/PKey.h diff --git a/flow/Platform.actor.h b/flow/include/flow/Platform.actor.h similarity index 100% rename from flow/Platform.actor.h rename to flow/include/flow/Platform.actor.h diff --git a/flow/Platform.h b/flow/include/flow/Platform.h similarity index 97% rename from flow/Platform.h rename to flow/include/flow/Platform.h index a5cc2e172ce..17dfff2650d 100644 --- a/flow/Platform.h +++ b/flow/include/flow/Platform.h @@ -420,8 +420,6 @@ std::string format_backtrace(void** addresses, int numAddresses); // Avoid in production code: not atomic, not fast, not reliable in all environments int eraseDirectoryRecursive(std::string const& directory); -bool isHwCrcSupported(); - // Creates a temporary file; file gets destroyed/deleted along with object destruction. // If 'tmpDir' is empty, code defaults to 'boost::filesystem::temp_directory_path()' // If 'pattern' is empty, code defaults to 'fdbtmp' @@ -840,34 +838,6 @@ inline void fdb_probe_actor_enter(const char* name, unsigned long id, int index) inline void fdb_probe_actor_exit(const char* name, unsigned long id, int index) {} #endif -// CRC32C -#ifdef __aarch64__ -// aarch64 -#include -static inline uint32_t hwCrc32cU8(unsigned int crc, unsigned char v) { - uint32_t ret; - asm volatile("crc32cb %w[r], %w[c], %w[v]" : [r] "=r"(ret) : [c] "r"(crc), [v] "r"(v)); - return ret; -} -static inline uint32_t hwCrc32cU32(unsigned int crc, unsigned int v) { - uint32_t ret; - asm volatile("crc32cw %w[r], %w[c], %w[v]" : [r] "=r"(ret) : [c] "r"(crc), [v] "r"(v)); - return ret; -} -static inline uint64_t hwCrc32cU64(uint64_t crc, uint64_t v) { - uint64_t ret; - asm volatile("crc32cx %w[r], %w[c], %x[v]" : [r] "=r"(ret) : [c] "r"(crc), [v] "r"(v)); - return ret; -} -#else -#ifndef __powerpc64__ -// Intel -#define hwCrc32cU8(c, v) _mm_crc32_u8(c, v) -#define hwCrc32cU32(c, v) _mm_crc32_u32(c, v) -#define hwCrc32cU64(c, v) _mm_crc32_u64(c, v) -#endif -#endif - #if defined(__aarch64__) #define _MM_HINT_T0 0 /* dummy -- not used */ #endif diff --git a/flow/Profiler.h b/flow/include/flow/Profiler.h similarity index 100% rename from flow/Profiler.h rename to flow/include/flow/Profiler.h diff --git a/flow/ProtocolVersion.h b/flow/include/flow/ProtocolVersion.h similarity index 100% rename from flow/ProtocolVersion.h rename to flow/include/flow/ProtocolVersion.h diff --git a/flow/ScopeExit.h b/flow/include/flow/ScopeExit.h similarity index 100% rename from flow/ScopeExit.h rename to flow/include/flow/ScopeExit.h diff --git a/flow/SendBufferIterator.h b/flow/include/flow/SendBufferIterator.h similarity index 100% rename from flow/SendBufferIterator.h rename to flow/include/flow/SendBufferIterator.h diff --git a/flow/StreamCipher.h b/flow/include/flow/StreamCipher.h similarity index 100% rename from flow/StreamCipher.h rename to flow/include/flow/StreamCipher.h diff --git a/flow/SystemMonitor.h b/flow/include/flow/SystemMonitor.h similarity index 100% rename from flow/SystemMonitor.h rename to flow/include/flow/SystemMonitor.h diff --git a/flow/TDMetric.actor.h b/flow/include/flow/TDMetric.actor.h similarity index 100% rename from flow/TDMetric.actor.h rename to flow/include/flow/TDMetric.actor.h diff --git a/flow/TLSConfig.actor.h b/flow/include/flow/TLSConfig.actor.h similarity index 100% rename from flow/TLSConfig.actor.h rename to flow/include/flow/TLSConfig.actor.h diff --git a/flow/ThreadHelper.actor.h b/flow/include/flow/ThreadHelper.actor.h similarity index 100% rename from flow/ThreadHelper.actor.h rename to flow/include/flow/ThreadHelper.actor.h diff --git a/flow/ThreadPrimitives.h b/flow/include/flow/ThreadPrimitives.h similarity index 100% rename from flow/ThreadPrimitives.h rename to flow/include/flow/ThreadPrimitives.h diff --git a/flow/ThreadSafeQueue.h b/flow/include/flow/ThreadSafeQueue.h similarity index 100% rename from flow/ThreadSafeQueue.h rename to flow/include/flow/ThreadSafeQueue.h diff --git a/flow/Trace.h b/flow/include/flow/Trace.h similarity index 100% rename from flow/Trace.h rename to flow/include/flow/Trace.h diff --git a/flow/TreeBenchmark.h b/flow/include/flow/TreeBenchmark.h similarity index 100% rename from flow/TreeBenchmark.h rename to flow/include/flow/TreeBenchmark.h diff --git a/flow/TypeTraits.h b/flow/include/flow/TypeTraits.h similarity index 100% rename from flow/TypeTraits.h rename to flow/include/flow/TypeTraits.h diff --git a/flow/UnitTest.h b/flow/include/flow/UnitTest.h similarity index 100% rename from flow/UnitTest.h rename to flow/include/flow/UnitTest.h diff --git a/flow/Util.h b/flow/include/flow/Util.h similarity index 100% rename from flow/Util.h rename to flow/include/flow/Util.h diff --git a/flow/WriteOnlySet.h b/flow/include/flow/WriteOnlySet.h similarity index 100% rename from flow/WriteOnlySet.h rename to flow/include/flow/WriteOnlySet.h diff --git a/flow/XmlTraceLogFormatter.h b/flow/include/flow/XmlTraceLogFormatter.h similarity index 100% rename from flow/XmlTraceLogFormatter.h rename to flow/include/flow/XmlTraceLogFormatter.h diff --git a/flow/actorcompiler.h b/flow/include/flow/actorcompiler.h similarity index 100% rename from flow/actorcompiler.h rename to flow/include/flow/actorcompiler.h diff --git a/flow/error_definitions.h b/flow/include/flow/error_definitions.h similarity index 100% rename from flow/error_definitions.h rename to flow/include/flow/error_definitions.h diff --git a/flow/flat_buffers.h b/flow/include/flow/flat_buffers.h similarity index 100% rename from flow/flat_buffers.h rename to flow/include/flow/flat_buffers.h diff --git a/flow/flow.h b/flow/include/flow/flow.h similarity index 100% rename from flow/flow.h rename to flow/include/flow/flow.h diff --git a/flow/genericactors.actor.h b/flow/include/flow/genericactors.actor.h similarity index 100% rename from flow/genericactors.actor.h rename to flow/include/flow/genericactors.actor.h diff --git a/flow/network.h b/flow/include/flow/network.h similarity index 100% rename from flow/network.h rename to flow/include/flow/network.h diff --git a/flow/ppc-asm.h b/flow/include/flow/ppc-asm.h similarity index 100% rename from flow/ppc-asm.h rename to flow/include/flow/ppc-asm.h diff --git a/flow/ppc-opcode.h b/flow/include/flow/ppc-opcode.h similarity index 100% rename from flow/ppc-opcode.h rename to flow/include/flow/ppc-opcode.h diff --git a/flow/rte_memcpy.h b/flow/include/flow/rte_memcpy.h similarity index 100% rename from flow/rte_memcpy.h rename to flow/include/flow/rte_memcpy.h diff --git a/flow/serialize.h b/flow/include/flow/serialize.h similarity index 100% rename from flow/serialize.h rename to flow/include/flow/serialize.h diff --git a/flow/singleton.h b/flow/include/flow/singleton.h similarity index 100% rename from flow/singleton.h rename to flow/include/flow/singleton.h diff --git a/flow/sse2neon.h b/flow/include/flow/sse2neon.h similarity index 100% rename from flow/sse2neon.h rename to flow/include/flow/sse2neon.h diff --git a/flow/unactorcompiler.h b/flow/include/flow/unactorcompiler.h similarity index 100% rename from flow/unactorcompiler.h rename to flow/include/flow/unactorcompiler.h diff --git a/flow/xxhash.h b/flow/include/flow/xxhash.h similarity index 100% rename from flow/xxhash.h rename to flow/include/flow/xxhash.h diff --git a/flow/network.cpp b/flow/network.cpp index 0e592b7a6af..f97e66cffc3 100644 --- a/flow/network.cpp +++ b/flow/network.cpp @@ -18,7 +18,7 @@ * limitations under the License. */ -#include "Arena.h" +#include "flow/Arena.h" #include "boost/asio.hpp" #include "flow/network.h" diff --git a/flow/test_memcpy.cpp b/flow/test_memcpy.cpp index 0859b054776..c5d3fd70920 100644 --- a/flow/test_memcpy.cpp +++ b/flow/test_memcpy.cpp @@ -7,7 +7,9 @@ #include #include -#include "flow/folly_memcpy.h" +#ifdef WITH_FOLLY_MEMCPY +#include "folly_memcpy.h" +#endif #include "flow/rte_memcpy.h" #include "flow/IRandom.h" @@ -116,4 +118,4 @@ TEST_CASE("/rte/memcpy") { return Void(); } -void forceLinkMemcpyTests() {} \ No newline at end of file +void forceLinkMemcpyTests() {} diff --git a/flow/xxhash.c b/flow/xxhash.c index eff6520fd37..5be47b687a1 100644 --- a/flow/xxhash.c +++ b/flow/xxhash.c @@ -39,4 +39,4 @@ #define XXH_STATIC_LINKING_ONLY /* access advanced declarations */ #define XXH_IMPLEMENTATION /* access definitions */ -#include "xxhash.h" +#include "flow/xxhash.h" diff --git a/flowbench/BenchHash.cpp b/flowbench/BenchHash.cpp index b5e0dc55078..40d15db4abe 100644 --- a/flowbench/BenchHash.cpp +++ b/flowbench/BenchHash.cpp @@ -19,7 +19,7 @@ */ #include "benchmark/benchmark.h" -#include "flow/crc32c.h" +#include "crc32/crc32c.h" #include "flow/Hash3.h" #include "flow/xxhash.h" #include "flowbench/GlobalData.h" diff --git a/flowbench/CMakeLists.txt b/flowbench/CMakeLists.txt index 8378c9c8ab5..92870d992d8 100644 --- a/flowbench/CMakeLists.txt +++ b/flowbench/CMakeLists.txt @@ -1,23 +1,7 @@ -set(FLOWBENCH_SRCS - flowbench.actor.cpp - BenchCallback.actor.cpp - BenchEncrypt.cpp - BenchHash.cpp - BenchIterate.cpp - BenchIONet2.actor.cpp - BenchMem.cpp - BenchMetadataCheck.cpp - BenchNet2.actor.cpp - BenchPopulate.cpp - BenchRandom.cpp - BenchRef.cpp - BenchStream.actor.cpp - BenchTimer.cpp - BenchVersionVector.cpp - GlobalData.h - GlobalData.cpp) - project (flowbench) + +fdb_find_sources(FLOWBENCH_SRCS) + # include the configurations from benchmark.cmake configure_file(benchmark.cmake googlebenchmark-download/CMakeLists.txt) # executing the configuration step @@ -46,6 +30,6 @@ add_subdirectory( ${CMAKE_CURRENT_BINARY_DIR}/googlebenchmark-build EXCLUDE_FROM_ALL ) -include_directories(${CMAKE_CURRENT_BINARY_DIR}/googlebenchmark-src/include) add_flow_target(EXECUTABLE NAME flowbench SRCS ${FLOWBENCH_SRCS}) +target_include_directories(flowbench PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}/include" ${CMAKE_CURRENT_BINARY_DIR}/googlebenchmark-src/include) target_link_libraries(flowbench benchmark pthread flow fdbclient) diff --git a/flowbench/GlobalData.h b/flowbench/include/flowbench/GlobalData.h similarity index 100% rename from flowbench/GlobalData.h rename to flowbench/include/flowbench/GlobalData.h