diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d902a3cfa1..bcd32c84490 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -229,6 +229,10 @@ endif () # Using system libs can cause a lot of warnings in includes (on macro expansion). if (UNBUNDLED OR NOT (OS_LINUX OR OS_DARWIN) OR ARCH_32) option (NO_WERROR "Disable -Werror compiler option" ON) + + if (NOT NO_WERROR) + add_warning(error) + endif () endif () # Make this extra-checks for correct library dependencies. @@ -326,7 +330,6 @@ include (cmake/find/poco.cmake) include (cmake/find/lz4.cmake) include (cmake/find/xxhash.cmake) include (cmake/find/sparsehash.cmake) -include (cmake/find/rt.cmake) include (cmake/find/execinfo.cmake) include (cmake/find/re2.cmake) include (cmake/find/libgsasl.cmake) @@ -365,9 +368,9 @@ if (ENABLE_TESTS) endif () # Need to process before "contrib" dir: -include (libs/libcommon/cmake/find_jemalloc.cmake) -include (libs/libcommon/cmake/find_cctz.cmake) -include (libs/libmysqlxx/cmake/find_mysqlclient.cmake) +include (cmake/find/jemalloc.cmake) +include (cmake/find/cctz.cmake) +include (cmake/find/mysqlclient.cmake) # When testing for memory leaks with Valgrind, don't link tcmalloc or jemalloc. @@ -399,7 +402,7 @@ macro (add_executable target) endif() endmacro() -add_subdirectory (libs) +add_subdirectory (base) add_subdirectory (utils) add_subdirectory (dbms) diff --git a/base/CMakeLists.txt b/base/CMakeLists.txt new file mode 100644 index 00000000000..65593f70a95 --- /dev/null +++ b/base/CMakeLists.txt @@ -0,0 +1,17 @@ +add_subdirectory (common) +add_subdirectory (loggers) +add_subdirectory (daemon) + +if (USE_INTERNAL_MEMCPY) + add_subdirectory (memcpy) +endif() + +if (USE_MYSQL) + add_subdirectory (mysqlxx) +endif () + +if (USE_INTERNAL_CONSISTENT_HASHING_LIBRARY) + add_subdirectory (consistent-hashing) +endif () +add_subdirectory (consistent-hashing-sumbur) +add_subdirectory (widechar_width) diff --git a/base/common/CMakeLists.txt b/base/common/CMakeLists.txt new file mode 100644 index 00000000000..cce3a28e582 --- /dev/null +++ b/base/common/CMakeLists.txt @@ -0,0 +1,64 @@ +configure_file (config_common.h.in config_common.h) + +set (SRCS + argsToConfig.cpp + coverage.cpp + DateLUT.cpp + DateLUTImpl.cpp + demangle.cpp + getMemoryAmount.cpp + getThreadId.cpp + JSON.cpp + LineReader.cpp + mremap.cpp + phdr_cache.cpp + preciseExp10.c + setTerminalEcho.cpp + shift10.cpp + sleep.cpp +) + +if (ENABLE_REPLXX) + set (SRCS ${SRCS} + ReplxxLineReader.cpp + ReplxxLineReader.h + ) +endif () + +add_library (common ${SRCS}) + +target_include_directories(common PUBLIC .. ${CMAKE_CURRENT_BINARY_DIR}/..) + +if (USE_INTERNAL_MEMCPY) + target_link_libraries (common PRIVATE memcpy) +endif () + +if(CCTZ_INCLUDE_DIR) + target_include_directories(common BEFORE PRIVATE ${CCTZ_INCLUDE_DIR}) +endif() + +if (NOT USE_INTERNAL_BOOST_LIBRARY) + target_include_directories (common SYSTEM BEFORE PUBLIC ${Boost_INCLUDE_DIRS}) +endif () + +if(NOT USE_INTERNAL_POCO_LIBRARY) + target_include_directories (common SYSTEM BEFORE PUBLIC ${Poco_Foundation_INCLUDE_DIR}) +endif() + +if(CCTZ_LIBRARY) + target_link_libraries(common PRIVATE ${CCTZ_LIBRARY}) +endif() + +target_link_libraries(common PUBLIC replxx) + +target_link_libraries (common + PUBLIC + ${Poco_Util_LIBRARY} + ${Poco_Foundation_LIBRARY} + ${CITYHASH_LIBRARIES} + ${Boost_SYSTEM_LIBRARY} +) + +if (ENABLE_TESTS) + add_subdirectory (tests) +endif () diff --git a/libs/libcommon/src/DateLUT.cpp b/base/common/DateLUT.cpp similarity index 100% rename from libs/libcommon/src/DateLUT.cpp rename to base/common/DateLUT.cpp diff --git a/libs/libcommon/include/common/DateLUT.h b/base/common/DateLUT.h similarity index 100% rename from libs/libcommon/include/common/DateLUT.h rename to base/common/DateLUT.h diff --git a/libs/libcommon/src/DateLUTImpl.cpp b/base/common/DateLUTImpl.cpp similarity index 100% rename from libs/libcommon/src/DateLUTImpl.cpp rename to base/common/DateLUTImpl.cpp diff --git a/libs/libcommon/include/common/DateLUTImpl.h b/base/common/DateLUTImpl.h similarity index 98% rename from libs/libcommon/include/common/DateLUTImpl.h rename to base/common/DateLUTImpl.h index 7f1e8c74313..2f2e431f950 100644 --- a/libs/libcommon/include/common/DateLUTImpl.h +++ b/base/common/DateLUTImpl.h @@ -391,9 +391,9 @@ public: /* The bits in week_mode has the following meaning: - WeekModeFlag::MONDAY_FIRST (0) If not set Sunday is first day of week - If set Monday is first day of week - WeekModeFlag::YEAR (1) If not set Week is in range 0-53 + WeekModeFlag::MONDAY_FIRST (0) If not set Sunday is first day of week + If set Monday is first day of week + WeekModeFlag::YEAR (1) If not set Week is in range 0-53 Week 0 is returned for the the last week of the previous year (for a date at start of january) In this case one can get 53 for the @@ -401,19 +401,19 @@ public: relevant for the given year. Note that this flag is only releveant if WeekModeFlag::JANUARY is not set. - If set Week is in range 1-53. + If set Week is in range 1-53. In this case one may get week 53 for a date in January (when the week is that last week of previous year) and week 1 for a date in December. - WeekModeFlag::FIRST_WEEKDAY (2) If not set Weeks are numbered according + WeekModeFlag::FIRST_WEEKDAY (2) If not set Weeks are numbered according to ISO 8601:1988 - If set The week that contains the first + If set The week that contains the first 'first-day-of-week' is week 1. - WeekModeFlag::NEWYEAR_DAY (3) If not set no meaning - If set The week that contains the January 1 is week 1. + WeekModeFlag::NEWYEAR_DAY (3) If not set no meaning + If set The week that contains the January 1 is week 1. Week is in range 1-53. And ignore WeekModeFlag::YEAR, WeekModeFlag::FIRST_WEEKDAY diff --git a/libs/libcommon/include/common/DayNum.h b/base/common/DayNum.h similarity index 100% rename from libs/libcommon/include/common/DayNum.h rename to base/common/DayNum.h diff --git a/libs/libcommon/include/common/ErrorHandlers.h b/base/common/ErrorHandlers.h similarity index 100% rename from libs/libcommon/include/common/ErrorHandlers.h rename to base/common/ErrorHandlers.h diff --git a/libs/libcommon/src/JSON.cpp b/base/common/JSON.cpp similarity index 99% rename from libs/libcommon/src/JSON.cpp rename to base/common/JSON.cpp index 1d2c94e37ae..c6c0c843a16 100644 --- a/libs/libcommon/src/JSON.cpp +++ b/base/common/JSON.cpp @@ -399,7 +399,7 @@ JSON::Pos JSON::skipElement() const ElementType type = getType(); - switch(type) + switch (type) { case TYPE_NULL: return skipNull(); @@ -587,7 +587,7 @@ std::string JSON::getString() const ++s; checkPos(s); - switch(*s) + switch (*s) { case '"': buf += '"'; @@ -665,7 +665,7 @@ StringRef JSON::getRawString() const if (*s != '"') throw JSONException(std::string("JSON: expected \", got ") + *s); while (++s != ptr_end && *s != '"'); - if (s != ptr_end ) + if (s != ptr_end) return StringRef(ptr_begin + 1, s - ptr_begin - 1); throw JSONException("JSON: incorrect syntax (expected end of string, found end of JSON)."); } diff --git a/libs/libcommon/include/common/JSON.h b/base/common/JSON.h similarity index 100% rename from libs/libcommon/include/common/JSON.h rename to base/common/JSON.h diff --git a/libs/libcommon/src/LineReader.cpp b/base/common/LineReader.cpp similarity index 99% rename from libs/libcommon/src/LineReader.cpp rename to base/common/LineReader.cpp index 22e0019803d..9dfefcea01f 100644 --- a/libs/libcommon/src/LineReader.cpp +++ b/base/common/LineReader.cpp @@ -3,8 +3,8 @@ #include #include -#include #include +#include #ifdef OS_LINUX /// We can detect if code is linked with one or another readline variants or open the library dynamically. diff --git a/libs/libcommon/include/common/LineReader.h b/base/common/LineReader.h similarity index 100% rename from libs/libcommon/include/common/LineReader.h rename to base/common/LineReader.h diff --git a/libs/libcommon/include/common/LocalDate.h b/base/common/LocalDate.h similarity index 100% rename from libs/libcommon/include/common/LocalDate.h rename to base/common/LocalDate.h diff --git a/libs/libcommon/include/common/LocalDateTime.h b/base/common/LocalDateTime.h similarity index 100% rename from libs/libcommon/include/common/LocalDateTime.h rename to base/common/LocalDateTime.h diff --git a/libs/libcommon/src/ReplxxLineReader.cpp b/base/common/ReplxxLineReader.cpp similarity index 98% rename from libs/libcommon/src/ReplxxLineReader.cpp rename to base/common/ReplxxLineReader.cpp index 044ea05413d..6a0956fb36a 100644 --- a/libs/libcommon/src/ReplxxLineReader.cpp +++ b/base/common/ReplxxLineReader.cpp @@ -1,8 +1,8 @@ #include #include -#include #include +#include namespace { diff --git a/libs/libcommon/include/common/ReplxxLineReader.h b/base/common/ReplxxLineReader.h similarity index 100% rename from libs/libcommon/include/common/ReplxxLineReader.h rename to base/common/ReplxxLineReader.h diff --git a/libs/libcommon/include/common/SimpleCache.h b/base/common/SimpleCache.h similarity index 100% rename from libs/libcommon/include/common/SimpleCache.h rename to base/common/SimpleCache.h diff --git a/libs/libcommon/include/common/StringRef.h b/base/common/StringRef.h similarity index 100% rename from libs/libcommon/include/common/StringRef.h rename to base/common/StringRef.h diff --git a/libs/libcommon/include/common/Types.h b/base/common/Types.h similarity index 100% rename from libs/libcommon/include/common/Types.h rename to base/common/Types.h diff --git a/libs/libcommon/src/argsToConfig.cpp b/base/common/argsToConfig.cpp similarity index 100% rename from libs/libcommon/src/argsToConfig.cpp rename to base/common/argsToConfig.cpp diff --git a/libs/libcommon/include/common/argsToConfig.h b/base/common/argsToConfig.h similarity index 100% rename from libs/libcommon/include/common/argsToConfig.h rename to base/common/argsToConfig.h diff --git a/libs/libcommon/include/common/arithmeticOverflow.h b/base/common/arithmeticOverflow.h similarity index 100% rename from libs/libcommon/include/common/arithmeticOverflow.h rename to base/common/arithmeticOverflow.h diff --git a/libs/libcommon/include/common/config_common.h.in b/base/common/config_common.h.in similarity index 100% rename from libs/libcommon/include/common/config_common.h.in rename to base/common/config_common.h.in diff --git a/libs/libcommon/include/common/constexpr_helpers.h b/base/common/constexpr_helpers.h similarity index 100% rename from libs/libcommon/include/common/constexpr_helpers.h rename to base/common/constexpr_helpers.h diff --git a/libs/libcommon/src/coverage.cpp b/base/common/coverage.cpp similarity index 100% rename from libs/libcommon/src/coverage.cpp rename to base/common/coverage.cpp diff --git a/libs/libcommon/include/common/coverage.h b/base/common/coverage.h similarity index 100% rename from libs/libcommon/include/common/coverage.h rename to base/common/coverage.h diff --git a/libs/libcommon/src/demangle.cpp b/base/common/demangle.cpp similarity index 100% rename from libs/libcommon/src/demangle.cpp rename to base/common/demangle.cpp diff --git a/libs/libcommon/include/common/demangle.h b/base/common/demangle.h similarity index 100% rename from libs/libcommon/include/common/demangle.h rename to base/common/demangle.h diff --git a/libs/libcommon/include/common/find_symbols.h b/base/common/find_symbols.h similarity index 100% rename from libs/libcommon/include/common/find_symbols.h rename to base/common/find_symbols.h diff --git a/libs/libcommon/src/getMemoryAmount.cpp b/base/common/getMemoryAmount.cpp similarity index 85% rename from libs/libcommon/src/getMemoryAmount.cpp rename to base/common/getMemoryAmount.cpp index fb5592d3aa3..a16a701bd8f 100644 --- a/libs/libcommon/src/getMemoryAmount.cpp +++ b/base/common/getMemoryAmount.cpp @@ -33,7 +33,7 @@ uint64_t getMemoryAmountOrZero() /* New 64-bit MEMORYSTATUSEX isn't available. Use old 32.bit */ MEMORYSTATUS status; status.dwLength = sizeof(status); - GlobalMemoryStatus( &status ); + GlobalMemoryStatus(&status); return status.dwTotalPhys; #elif defined(WIN32) || defined(_WIN32) @@ -41,7 +41,7 @@ uint64_t getMemoryAmountOrZero() /* Use new 64-bit MEMORYSTATUSEX, not old 32-bit MEMORYSTATUS */ MEMORYSTATUSEX status; status.dwLength = sizeof(status); - GlobalMemoryStatusEx( &status ); + GlobalMemoryStatusEx(&status); return status.ullTotalPhys; #else @@ -58,24 +58,24 @@ uint64_t getMemoryAmountOrZero() #endif uint64_t size = 0; /* 64-bit */ size_t len = sizeof(size); - if ( sysctl( mib, 2, &size, &len, NULL, 0 ) == 0 ) { + if (sysctl(mib, 2, &size, &len, NULL, 0) == 0) return size; - } + return 0; /* Failed? */ #elif defined(_SC_AIX_REALMEM) /* AIX. ----------------------------------------------------- */ - return sysconf( _SC_AIX_REALMEM ) * 1024; + return sysconf(_SC_AIX_REALMEM) * 1024; #elif defined(_SC_PHYS_PAGES) && defined(_SC_PAGESIZE) /* FreeBSD, Linux, OpenBSD, and Solaris. -------------------- */ - return (uint64_t)sysconf( _SC_PHYS_PAGES ) - * (uint64_t)sysconf( _SC_PAGESIZE ); + return (uint64_t)sysconf(_SC_PHYS_PAGES) + * (uint64_t)sysconf(_SC_PAGESIZE); #elif defined(_SC_PHYS_PAGES) && defined(_SC_PAGE_SIZE) /* Legacy. -------------------------------------------------- */ - return (uint64_t)sysconf( _SC_PHYS_PAGES ) - * (uint64_t)sysconf( _SC_PAGE_SIZE ); + return (uint64_t)sysconf(_SC_PHYS_PAGES) + * (uint64_t)sysconf(_SC_PAGE_SIZE); #elif defined(CTL_HW) && (defined(HW_PHYSMEM) || defined(HW_REALMEM)) /* DragonFly BSD, FreeBSD, NetBSD, OpenBSD, and OSX. -------- */ @@ -87,10 +87,10 @@ uint64_t getMemoryAmountOrZero() mib[1] = HW_PHYSMEM; /* Others. ------------------ */ #endif unsigned int size = 0; /* 32-bit */ - size_t len = sizeof( size ); - if ( sysctl( mib, 2, &size, &len, NULL, 0 ) == 0 ) { + size_t len = sizeof(size); + if (sysctl(mib, 2, &size, &len, NULL, 0) == 0) return size; - } + return 0; /* Failed? */ #endif /* sysctl and sysconf variants */ diff --git a/libs/libcommon/include/common/getMemoryAmount.h b/base/common/getMemoryAmount.h similarity index 100% rename from libs/libcommon/include/common/getMemoryAmount.h rename to base/common/getMemoryAmount.h diff --git a/libs/libcommon/src/getThreadId.cpp b/base/common/getThreadId.cpp similarity index 100% rename from libs/libcommon/src/getThreadId.cpp rename to base/common/getThreadId.cpp diff --git a/libs/libcommon/include/common/getThreadId.h b/base/common/getThreadId.h similarity index 100% rename from libs/libcommon/include/common/getThreadId.h rename to base/common/getThreadId.h diff --git a/libs/libcommon/include/common/iostream_debug_helpers.h b/base/common/iostream_debug_helpers.h similarity index 100% rename from libs/libcommon/include/common/iostream_debug_helpers.h rename to base/common/iostream_debug_helpers.h diff --git a/libs/libcommon/include/common/itoa.h b/base/common/itoa.h similarity index 100% rename from libs/libcommon/include/common/itoa.h rename to base/common/itoa.h diff --git a/libs/libcommon/include/common/likely.h b/base/common/likely.h similarity index 100% rename from libs/libcommon/include/common/likely.h rename to base/common/likely.h diff --git a/libs/libcommon/include/common/logger_useful.h b/base/common/logger_useful.h similarity index 100% rename from libs/libcommon/include/common/logger_useful.h rename to base/common/logger_useful.h diff --git a/libs/libcommon/include/common/memory.h b/base/common/memory.h similarity index 100% rename from libs/libcommon/include/common/memory.h rename to base/common/memory.h diff --git a/libs/libcommon/src/mremap.cpp b/base/common/mremap.cpp similarity index 100% rename from libs/libcommon/src/mremap.cpp rename to base/common/mremap.cpp diff --git a/libs/libcommon/include/common/mremap.h b/base/common/mremap.h similarity index 100% rename from libs/libcommon/include/common/mremap.h rename to base/common/mremap.h diff --git a/libs/libcommon/src/phdr_cache.cpp b/base/common/phdr_cache.cpp similarity index 100% rename from libs/libcommon/src/phdr_cache.cpp rename to base/common/phdr_cache.cpp diff --git a/libs/libcommon/include/common/phdr_cache.h b/base/common/phdr_cache.h similarity index 100% rename from libs/libcommon/include/common/phdr_cache.h rename to base/common/phdr_cache.h diff --git a/libs/libcommon/src/preciseExp10.c b/base/common/preciseExp10.c similarity index 100% rename from libs/libcommon/src/preciseExp10.c rename to base/common/preciseExp10.c diff --git a/libs/libcommon/include/common/preciseExp10.h b/base/common/preciseExp10.h similarity index 100% rename from libs/libcommon/include/common/preciseExp10.h rename to base/common/preciseExp10.h diff --git a/libs/libcommon/src/setTerminalEcho.cpp b/base/common/setTerminalEcho.cpp similarity index 100% rename from libs/libcommon/src/setTerminalEcho.cpp rename to base/common/setTerminalEcho.cpp diff --git a/libs/libcommon/include/common/setTerminalEcho.h b/base/common/setTerminalEcho.h similarity index 100% rename from libs/libcommon/include/common/setTerminalEcho.h rename to base/common/setTerminalEcho.h diff --git a/libs/libcommon/src/shift10.cpp b/base/common/shift10.cpp similarity index 99% rename from libs/libcommon/src/shift10.cpp rename to base/common/shift10.cpp index d837fb064fb..45f5733bd76 100644 --- a/libs/libcommon/src/shift10.cpp +++ b/base/common/shift10.cpp @@ -1,7 +1,8 @@ #include + #include + #include -#include template diff --git a/libs/libcommon/include/common/shift10.h b/base/common/shift10.h similarity index 100% rename from libs/libcommon/include/common/shift10.h rename to base/common/shift10.h diff --git a/libs/libcommon/src/sleep.cpp b/base/common/sleep.cpp similarity index 100% rename from libs/libcommon/src/sleep.cpp rename to base/common/sleep.cpp diff --git a/libs/libcommon/include/common/sleep.h b/base/common/sleep.h similarity index 100% rename from libs/libcommon/include/common/sleep.h rename to base/common/sleep.h diff --git a/libs/libcommon/include/common/strong_typedef.h b/base/common/strong_typedef.h similarity index 100% rename from libs/libcommon/include/common/strong_typedef.h rename to base/common/strong_typedef.h diff --git a/libs/libcommon/src/tests/CMakeLists.txt b/base/common/tests/CMakeLists.txt similarity index 100% rename from libs/libcommon/src/tests/CMakeLists.txt rename to base/common/tests/CMakeLists.txt diff --git a/libs/libcommon/src/tests/allocator.cpp b/base/common/tests/allocator.cpp similarity index 100% rename from libs/libcommon/src/tests/allocator.cpp rename to base/common/tests/allocator.cpp diff --git a/libs/libcommon/src/tests/date_lut2.cpp b/base/common/tests/date_lut2.cpp similarity index 100% rename from libs/libcommon/src/tests/date_lut2.cpp rename to base/common/tests/date_lut2.cpp diff --git a/libs/libcommon/src/tests/date_lut3.cpp b/base/common/tests/date_lut3.cpp similarity index 100% rename from libs/libcommon/src/tests/date_lut3.cpp rename to base/common/tests/date_lut3.cpp diff --git a/libs/libcommon/src/tests/date_lut4.cpp b/base/common/tests/date_lut4.cpp similarity index 100% rename from libs/libcommon/src/tests/date_lut4.cpp rename to base/common/tests/date_lut4.cpp diff --git a/libs/libcommon/src/tests/date_lut_default_timezone.cpp b/base/common/tests/date_lut_default_timezone.cpp similarity index 100% rename from libs/libcommon/src/tests/date_lut_default_timezone.cpp rename to base/common/tests/date_lut_default_timezone.cpp diff --git a/libs/libcommon/src/tests/date_lut_init.cpp b/base/common/tests/date_lut_init.cpp similarity index 100% rename from libs/libcommon/src/tests/date_lut_init.cpp rename to base/common/tests/date_lut_init.cpp diff --git a/libs/libcommon/src/tests/dump_variable.cpp b/base/common/tests/dump_variable.cpp similarity index 100% rename from libs/libcommon/src/tests/dump_variable.cpp rename to base/common/tests/dump_variable.cpp diff --git a/libs/libcommon/src/tests/gtest_find_symbols.cpp b/base/common/tests/gtest_find_symbols.cpp similarity index 100% rename from libs/libcommon/src/tests/gtest_find_symbols.cpp rename to base/common/tests/gtest_find_symbols.cpp diff --git a/libs/libcommon/src/tests/gtest_json_test.cpp b/base/common/tests/gtest_json_test.cpp similarity index 100% rename from libs/libcommon/src/tests/gtest_json_test.cpp rename to base/common/tests/gtest_json_test.cpp diff --git a/libs/libcommon/src/tests/gtest_strong_typedef.cpp b/base/common/tests/gtest_strong_typedef.cpp similarity index 100% rename from libs/libcommon/src/tests/gtest_strong_typedef.cpp rename to base/common/tests/gtest_strong_typedef.cpp diff --git a/libs/libcommon/src/tests/local_date_time_comparison.cpp b/base/common/tests/local_date_time_comparison.cpp similarity index 100% rename from libs/libcommon/src/tests/local_date_time_comparison.cpp rename to base/common/tests/local_date_time_comparison.cpp diff --git a/base/common/time.h b/base/common/time.h new file mode 100644 index 00000000000..9a52d8e40b8 --- /dev/null +++ b/base/common/time.h @@ -0,0 +1,7 @@ +#pragma once + +#include + +#if defined (OS_DARWIN) +# define CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC +#endif diff --git a/libs/libcommon/include/common/unaligned.h b/base/common/unaligned.h similarity index 100% rename from libs/libcommon/include/common/unaligned.h rename to base/common/unaligned.h diff --git a/libs/consistent-hashing-sumbur/CMakeLists.txt b/base/consistent-hashing-sumbur/CMakeLists.txt similarity index 100% rename from libs/consistent-hashing-sumbur/CMakeLists.txt rename to base/consistent-hashing-sumbur/CMakeLists.txt diff --git a/libs/consistent-hashing-sumbur/sumbur.cpp b/base/consistent-hashing-sumbur/sumbur.cpp similarity index 100% rename from libs/consistent-hashing-sumbur/sumbur.cpp rename to base/consistent-hashing-sumbur/sumbur.cpp diff --git a/libs/consistent-hashing-sumbur/sumbur.h b/base/consistent-hashing-sumbur/sumbur.h similarity index 100% rename from libs/consistent-hashing-sumbur/sumbur.h rename to base/consistent-hashing-sumbur/sumbur.h diff --git a/libs/consistent-hashing/CMakeLists.txt b/base/consistent-hashing/CMakeLists.txt similarity index 100% rename from libs/consistent-hashing/CMakeLists.txt rename to base/consistent-hashing/CMakeLists.txt diff --git a/libs/consistent-hashing/bitops.h b/base/consistent-hashing/bitops.h similarity index 100% rename from libs/consistent-hashing/bitops.h rename to base/consistent-hashing/bitops.h diff --git a/libs/consistent-hashing/consistent_hashing.cpp b/base/consistent-hashing/consistent_hashing.cpp similarity index 100% rename from libs/consistent-hashing/consistent_hashing.cpp rename to base/consistent-hashing/consistent_hashing.cpp diff --git a/libs/consistent-hashing/consistent_hashing.h b/base/consistent-hashing/consistent_hashing.h similarity index 100% rename from libs/consistent-hashing/consistent_hashing.h rename to base/consistent-hashing/consistent_hashing.h diff --git a/libs/consistent-hashing/popcount.cpp b/base/consistent-hashing/popcount.cpp similarity index 100% rename from libs/consistent-hashing/popcount.cpp rename to base/consistent-hashing/popcount.cpp diff --git a/libs/consistent-hashing/popcount.h b/base/consistent-hashing/popcount.h similarity index 100% rename from libs/consistent-hashing/popcount.h rename to base/consistent-hashing/popcount.h diff --git a/libs/libdaemon/CMakeLists.txt b/base/daemon/CMakeLists.txt similarity index 100% rename from libs/libdaemon/CMakeLists.txt rename to base/daemon/CMakeLists.txt diff --git a/libs/libdaemon/include/daemon/BaseDaemon.h b/base/daemon/include/daemon/BaseDaemon.h similarity index 99% rename from libs/libdaemon/include/daemon/BaseDaemon.h rename to base/daemon/include/daemon/BaseDaemon.h index 6a2764db8c1..b7070c76e9b 100644 --- a/libs/libdaemon/include/daemon/BaseDaemon.h +++ b/base/daemon/include/daemon/BaseDaemon.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include #include #include #include diff --git a/libs/libdaemon/include/daemon/GraphiteWriter.h b/base/daemon/include/daemon/GraphiteWriter.h similarity index 100% rename from libs/libdaemon/include/daemon/GraphiteWriter.h rename to base/daemon/include/daemon/GraphiteWriter.h diff --git a/libs/libdaemon/src/BaseDaemon.cpp b/base/daemon/src/BaseDaemon.cpp similarity index 99% rename from libs/libdaemon/src/BaseDaemon.cpp rename to base/daemon/src/BaseDaemon.cpp index 9e614380722..b9e94d288d6 100644 --- a/libs/libdaemon/src/BaseDaemon.cpp +++ b/base/daemon/src/BaseDaemon.cpp @@ -382,7 +382,7 @@ enum class InstructionFail static std::string instructionFailToString(InstructionFail fail) { - switch(fail) + switch (fail) { case InstructionFail::NONE: return "NONE"; diff --git a/libs/libdaemon/src/GraphiteWriter.cpp b/base/daemon/src/GraphiteWriter.cpp similarity index 100% rename from libs/libdaemon/src/GraphiteWriter.cpp rename to base/daemon/src/GraphiteWriter.cpp diff --git a/libs/libcommon/include/ext/bit_cast.h b/base/ext/bit_cast.h similarity index 100% rename from libs/libcommon/include/ext/bit_cast.h rename to base/ext/bit_cast.h diff --git a/libs/libcommon/include/ext/chrono_io.h b/base/ext/chrono_io.h similarity index 100% rename from libs/libcommon/include/ext/chrono_io.h rename to base/ext/chrono_io.h diff --git a/libs/libcommon/include/ext/collection_cast.h b/base/ext/collection_cast.h similarity index 100% rename from libs/libcommon/include/ext/collection_cast.h rename to base/ext/collection_cast.h diff --git a/libs/libcommon/include/ext/enumerate.h b/base/ext/enumerate.h similarity index 100% rename from libs/libcommon/include/ext/enumerate.h rename to base/ext/enumerate.h diff --git a/libs/libcommon/include/ext/function_traits.h b/base/ext/function_traits.h similarity index 100% rename from libs/libcommon/include/ext/function_traits.h rename to base/ext/function_traits.h diff --git a/libs/libcommon/include/ext/identity.h b/base/ext/identity.h similarity index 100% rename from libs/libcommon/include/ext/identity.h rename to base/ext/identity.h diff --git a/libs/libcommon/include/ext/make_array_n.h b/base/ext/make_array_n.h similarity index 100% rename from libs/libcommon/include/ext/make_array_n.h rename to base/ext/make_array_n.h diff --git a/libs/libcommon/include/ext/map.h b/base/ext/map.h similarity index 100% rename from libs/libcommon/include/ext/map.h rename to base/ext/map.h diff --git a/libs/libcommon/include/ext/push_back.h b/base/ext/push_back.h similarity index 100% rename from libs/libcommon/include/ext/push_back.h rename to base/ext/push_back.h diff --git a/libs/libcommon/include/ext/range.h b/base/ext/range.h similarity index 100% rename from libs/libcommon/include/ext/range.h rename to base/ext/range.h diff --git a/libs/libcommon/include/ext/scope_guard.h b/base/ext/scope_guard.h similarity index 100% rename from libs/libcommon/include/ext/scope_guard.h rename to base/ext/scope_guard.h diff --git a/libs/libcommon/include/ext/shared_ptr_helper.h b/base/ext/shared_ptr_helper.h similarity index 100% rename from libs/libcommon/include/ext/shared_ptr_helper.h rename to base/ext/shared_ptr_helper.h diff --git a/libs/libcommon/include/ext/singleton.h b/base/ext/singleton.h similarity index 56% rename from libs/libcommon/include/ext/singleton.h rename to base/ext/singleton.h index ed4be05de09..8392ae7fc01 100644 --- a/libs/libcommon/include/ext/singleton.h +++ b/base/ext/singleton.h @@ -2,7 +2,15 @@ #include -namespace ext { +namespace ext +{ + +/** Thread-unsafe singleton. It works simply like a global variable. + * Supports deinitialization. + * + * In most of the cases, you don't need this class. + * Use "Meyers Singleton" instead: static T & instance() { static T x; return x; } + */ template class Singleton @@ -11,14 +19,7 @@ public: Singleton() { if (!instance) - instance.reset(new T); - } - - template - Singleton(const Args & ... args) - { - instance.reset(new T(args...)); - /// TODO: throw exception on double-creation. + instance = std::make_unique(); } T * operator->() diff --git a/libs/libcommon/include/ext/size.h b/base/ext/size.h similarity index 100% rename from libs/libcommon/include/ext/size.h rename to base/ext/size.h diff --git a/libs/libcommon/include/ext/unlock_guard.h b/base/ext/unlock_guard.h similarity index 100% rename from libs/libcommon/include/ext/unlock_guard.h rename to base/ext/unlock_guard.h diff --git a/libs/libglibc-compatibility/CMakeLists.txt b/base/glibc-compatibility/CMakeLists.txt similarity index 100% rename from libs/libglibc-compatibility/CMakeLists.txt rename to base/glibc-compatibility/CMakeLists.txt diff --git a/libs/libglibc-compatibility/glibc-compatibility.c b/base/glibc-compatibility/glibc-compatibility.c similarity index 100% rename from libs/libglibc-compatibility/glibc-compatibility.c rename to base/glibc-compatibility/glibc-compatibility.c diff --git a/libs/libglibc-compatibility/musl/COPYRIGHT b/base/glibc-compatibility/musl/COPYRIGHT similarity index 100% rename from libs/libglibc-compatibility/musl/COPYRIGHT rename to base/glibc-compatibility/musl/COPYRIGHT diff --git a/libs/libglibc-compatibility/musl/README b/base/glibc-compatibility/musl/README similarity index 100% rename from libs/libglibc-compatibility/musl/README rename to base/glibc-compatibility/musl/README diff --git a/libs/libglibc-compatibility/musl/__math_divzero.c b/base/glibc-compatibility/musl/__math_divzero.c similarity index 100% rename from libs/libglibc-compatibility/musl/__math_divzero.c rename to base/glibc-compatibility/musl/__math_divzero.c diff --git a/libs/libglibc-compatibility/musl/__math_divzerof.c b/base/glibc-compatibility/musl/__math_divzerof.c similarity index 100% rename from libs/libglibc-compatibility/musl/__math_divzerof.c rename to base/glibc-compatibility/musl/__math_divzerof.c diff --git a/libs/libglibc-compatibility/musl/__math_invalid.c b/base/glibc-compatibility/musl/__math_invalid.c similarity index 100% rename from libs/libglibc-compatibility/musl/__math_invalid.c rename to base/glibc-compatibility/musl/__math_invalid.c diff --git a/libs/libglibc-compatibility/musl/__math_invalidf.c b/base/glibc-compatibility/musl/__math_invalidf.c similarity index 100% rename from libs/libglibc-compatibility/musl/__math_invalidf.c rename to base/glibc-compatibility/musl/__math_invalidf.c diff --git a/libs/libglibc-compatibility/musl/__math_oflow.c b/base/glibc-compatibility/musl/__math_oflow.c similarity index 100% rename from libs/libglibc-compatibility/musl/__math_oflow.c rename to base/glibc-compatibility/musl/__math_oflow.c diff --git a/libs/libglibc-compatibility/musl/__math_oflowf.c b/base/glibc-compatibility/musl/__math_oflowf.c similarity index 100% rename from libs/libglibc-compatibility/musl/__math_oflowf.c rename to base/glibc-compatibility/musl/__math_oflowf.c diff --git a/libs/libglibc-compatibility/musl/__math_uflow.c b/base/glibc-compatibility/musl/__math_uflow.c similarity index 100% rename from libs/libglibc-compatibility/musl/__math_uflow.c rename to base/glibc-compatibility/musl/__math_uflow.c diff --git a/libs/libglibc-compatibility/musl/__math_uflowf.c b/base/glibc-compatibility/musl/__math_uflowf.c similarity index 100% rename from libs/libglibc-compatibility/musl/__math_uflowf.c rename to base/glibc-compatibility/musl/__math_uflowf.c diff --git a/libs/libglibc-compatibility/musl/__math_xflow.c b/base/glibc-compatibility/musl/__math_xflow.c similarity index 100% rename from libs/libglibc-compatibility/musl/__math_xflow.c rename to base/glibc-compatibility/musl/__math_xflow.c diff --git a/libs/libglibc-compatibility/musl/__math_xflowf.c b/base/glibc-compatibility/musl/__math_xflowf.c similarity index 100% rename from libs/libglibc-compatibility/musl/__math_xflowf.c rename to base/glibc-compatibility/musl/__math_xflowf.c diff --git a/libs/libglibc-compatibility/musl/aarch64/atomic_arch.h b/base/glibc-compatibility/musl/aarch64/atomic_arch.h similarity index 100% rename from libs/libglibc-compatibility/musl/aarch64/atomic_arch.h rename to base/glibc-compatibility/musl/aarch64/atomic_arch.h diff --git a/libs/libglibc-compatibility/musl/aarch64/longjmp.s b/base/glibc-compatibility/musl/aarch64/longjmp.s similarity index 100% rename from libs/libglibc-compatibility/musl/aarch64/longjmp.s rename to base/glibc-compatibility/musl/aarch64/longjmp.s diff --git a/libs/libglibc-compatibility/musl/aarch64/syscall.s b/base/glibc-compatibility/musl/aarch64/syscall.s similarity index 100% rename from libs/libglibc-compatibility/musl/aarch64/syscall.s rename to base/glibc-compatibility/musl/aarch64/syscall.s diff --git a/libs/libglibc-compatibility/musl/aarch64/syscall_arch.h b/base/glibc-compatibility/musl/aarch64/syscall_arch.h similarity index 100% rename from libs/libglibc-compatibility/musl/aarch64/syscall_arch.h rename to base/glibc-compatibility/musl/aarch64/syscall_arch.h diff --git a/libs/libglibc-compatibility/musl/atomic.h b/base/glibc-compatibility/musl/atomic.h similarity index 100% rename from libs/libglibc-compatibility/musl/atomic.h rename to base/glibc-compatibility/musl/atomic.h diff --git a/libs/libglibc-compatibility/musl/clock_gettime.c b/base/glibc-compatibility/musl/clock_gettime.c similarity index 100% rename from libs/libglibc-compatibility/musl/clock_gettime.c rename to base/glibc-compatibility/musl/clock_gettime.c diff --git a/libs/libglibc-compatibility/musl/clock_nanosleep.c b/base/glibc-compatibility/musl/clock_nanosleep.c similarity index 100% rename from libs/libglibc-compatibility/musl/clock_nanosleep.c rename to base/glibc-compatibility/musl/clock_nanosleep.c diff --git a/libs/libglibc-compatibility/musl/exp.c b/base/glibc-compatibility/musl/exp.c similarity index 100% rename from libs/libglibc-compatibility/musl/exp.c rename to base/glibc-compatibility/musl/exp.c diff --git a/libs/libglibc-compatibility/musl/exp2.c b/base/glibc-compatibility/musl/exp2.c similarity index 100% rename from libs/libglibc-compatibility/musl/exp2.c rename to base/glibc-compatibility/musl/exp2.c diff --git a/libs/libglibc-compatibility/musl/exp2f.c b/base/glibc-compatibility/musl/exp2f.c similarity index 100% rename from libs/libglibc-compatibility/musl/exp2f.c rename to base/glibc-compatibility/musl/exp2f.c diff --git a/libs/libglibc-compatibility/musl/exp2f_data.c b/base/glibc-compatibility/musl/exp2f_data.c similarity index 100% rename from libs/libglibc-compatibility/musl/exp2f_data.c rename to base/glibc-compatibility/musl/exp2f_data.c diff --git a/libs/libglibc-compatibility/musl/exp2f_data.h b/base/glibc-compatibility/musl/exp2f_data.h similarity index 100% rename from libs/libglibc-compatibility/musl/exp2f_data.h rename to base/glibc-compatibility/musl/exp2f_data.h diff --git a/libs/libglibc-compatibility/musl/exp_data.c b/base/glibc-compatibility/musl/exp_data.c similarity index 100% rename from libs/libglibc-compatibility/musl/exp_data.c rename to base/glibc-compatibility/musl/exp_data.c diff --git a/libs/libglibc-compatibility/musl/exp_data.h b/base/glibc-compatibility/musl/exp_data.h similarity index 100% rename from libs/libglibc-compatibility/musl/exp_data.h rename to base/glibc-compatibility/musl/exp_data.h diff --git a/libs/libglibc-compatibility/musl/fallocate.c b/base/glibc-compatibility/musl/fallocate.c similarity index 100% rename from libs/libglibc-compatibility/musl/fallocate.c rename to base/glibc-compatibility/musl/fallocate.c diff --git a/libs/libglibc-compatibility/musl/fcntl.c b/base/glibc-compatibility/musl/fcntl.c similarity index 100% rename from libs/libglibc-compatibility/musl/fcntl.c rename to base/glibc-compatibility/musl/fcntl.c diff --git a/libs/libglibc-compatibility/musl/futimens.c b/base/glibc-compatibility/musl/futimens.c similarity index 100% rename from libs/libglibc-compatibility/musl/futimens.c rename to base/glibc-compatibility/musl/futimens.c diff --git a/libs/libglibc-compatibility/musl/getentropy.c b/base/glibc-compatibility/musl/getentropy.c similarity index 100% rename from libs/libglibc-compatibility/musl/getentropy.c rename to base/glibc-compatibility/musl/getentropy.c diff --git a/libs/libglibc-compatibility/musl/getrandom.c b/base/glibc-compatibility/musl/getrandom.c similarity index 100% rename from libs/libglibc-compatibility/musl/getrandom.c rename to base/glibc-compatibility/musl/getrandom.c diff --git a/libs/libglibc-compatibility/musl/glob.c b/base/glibc-compatibility/musl/glob.c similarity index 100% rename from libs/libglibc-compatibility/musl/glob.c rename to base/glibc-compatibility/musl/glob.c diff --git a/libs/libglibc-compatibility/musl/lgamma.c b/base/glibc-compatibility/musl/lgamma.c similarity index 100% rename from libs/libglibc-compatibility/musl/lgamma.c rename to base/glibc-compatibility/musl/lgamma.c diff --git a/libs/libglibc-compatibility/musl/libm.h b/base/glibc-compatibility/musl/libm.h similarity index 100% rename from libs/libglibc-compatibility/musl/libm.h rename to base/glibc-compatibility/musl/libm.h diff --git a/libs/libglibc-compatibility/musl/log.c b/base/glibc-compatibility/musl/log.c similarity index 100% rename from libs/libglibc-compatibility/musl/log.c rename to base/glibc-compatibility/musl/log.c diff --git a/libs/libglibc-compatibility/musl/log2.c b/base/glibc-compatibility/musl/log2.c similarity index 100% rename from libs/libglibc-compatibility/musl/log2.c rename to base/glibc-compatibility/musl/log2.c diff --git a/libs/libglibc-compatibility/musl/log2_data.c b/base/glibc-compatibility/musl/log2_data.c similarity index 100% rename from libs/libglibc-compatibility/musl/log2_data.c rename to base/glibc-compatibility/musl/log2_data.c diff --git a/libs/libglibc-compatibility/musl/log2_data.h b/base/glibc-compatibility/musl/log2_data.h similarity index 100% rename from libs/libglibc-compatibility/musl/log2_data.h rename to base/glibc-compatibility/musl/log2_data.h diff --git a/libs/libglibc-compatibility/musl/log2f.c b/base/glibc-compatibility/musl/log2f.c similarity index 100% rename from libs/libglibc-compatibility/musl/log2f.c rename to base/glibc-compatibility/musl/log2f.c diff --git a/libs/libglibc-compatibility/musl/log2f_data.c b/base/glibc-compatibility/musl/log2f_data.c similarity index 100% rename from libs/libglibc-compatibility/musl/log2f_data.c rename to base/glibc-compatibility/musl/log2f_data.c diff --git a/libs/libglibc-compatibility/musl/log2f_data.h b/base/glibc-compatibility/musl/log2f_data.h similarity index 100% rename from libs/libglibc-compatibility/musl/log2f_data.h rename to base/glibc-compatibility/musl/log2f_data.h diff --git a/libs/libglibc-compatibility/musl/log_data.c b/base/glibc-compatibility/musl/log_data.c similarity index 100% rename from libs/libglibc-compatibility/musl/log_data.c rename to base/glibc-compatibility/musl/log_data.c diff --git a/libs/libglibc-compatibility/musl/log_data.h b/base/glibc-compatibility/musl/log_data.h similarity index 100% rename from libs/libglibc-compatibility/musl/log_data.h rename to base/glibc-compatibility/musl/log_data.h diff --git a/libs/libglibc-compatibility/musl/logf.c b/base/glibc-compatibility/musl/logf.c similarity index 100% rename from libs/libglibc-compatibility/musl/logf.c rename to base/glibc-compatibility/musl/logf.c diff --git a/libs/libglibc-compatibility/musl/logf_data.c b/base/glibc-compatibility/musl/logf_data.c similarity index 100% rename from libs/libglibc-compatibility/musl/logf_data.c rename to base/glibc-compatibility/musl/logf_data.c diff --git a/libs/libglibc-compatibility/musl/logf_data.h b/base/glibc-compatibility/musl/logf_data.h similarity index 100% rename from libs/libglibc-compatibility/musl/logf_data.h rename to base/glibc-compatibility/musl/logf_data.h diff --git a/libs/libglibc-compatibility/musl/musl_features.h b/base/glibc-compatibility/musl/musl_features.h similarity index 100% rename from libs/libglibc-compatibility/musl/musl_features.h rename to base/glibc-compatibility/musl/musl_features.h diff --git a/libs/libglibc-compatibility/musl/pipe2.c b/base/glibc-compatibility/musl/pipe2.c similarity index 100% rename from libs/libglibc-compatibility/musl/pipe2.c rename to base/glibc-compatibility/musl/pipe2.c diff --git a/libs/libglibc-compatibility/musl/posix_spawn.c b/base/glibc-compatibility/musl/posix_spawn.c similarity index 100% rename from libs/libglibc-compatibility/musl/posix_spawn.c rename to base/glibc-compatibility/musl/posix_spawn.c diff --git a/libs/libglibc-compatibility/musl/pow.c b/base/glibc-compatibility/musl/pow.c similarity index 100% rename from libs/libglibc-compatibility/musl/pow.c rename to base/glibc-compatibility/musl/pow.c diff --git a/libs/libglibc-compatibility/musl/pow_data.c b/base/glibc-compatibility/musl/pow_data.c similarity index 100% rename from libs/libglibc-compatibility/musl/pow_data.c rename to base/glibc-compatibility/musl/pow_data.c diff --git a/libs/libglibc-compatibility/musl/pow_data.h b/base/glibc-compatibility/musl/pow_data.h similarity index 100% rename from libs/libglibc-compatibility/musl/pow_data.h rename to base/glibc-compatibility/musl/pow_data.h diff --git a/libs/libglibc-compatibility/musl/pwritev.c b/base/glibc-compatibility/musl/pwritev.c similarity index 100% rename from libs/libglibc-compatibility/musl/pwritev.c rename to base/glibc-compatibility/musl/pwritev.c diff --git a/libs/libglibc-compatibility/musl/sched_cpucount.c b/base/glibc-compatibility/musl/sched_cpucount.c similarity index 100% rename from libs/libglibc-compatibility/musl/sched_cpucount.c rename to base/glibc-compatibility/musl/sched_cpucount.c diff --git a/libs/libglibc-compatibility/musl/sched_getcpu.c b/base/glibc-compatibility/musl/sched_getcpu.c similarity index 100% rename from libs/libglibc-compatibility/musl/sched_getcpu.c rename to base/glibc-compatibility/musl/sched_getcpu.c diff --git a/libs/libglibc-compatibility/musl/syscall.h b/base/glibc-compatibility/musl/syscall.h similarity index 100% rename from libs/libglibc-compatibility/musl/syscall.h rename to base/glibc-compatibility/musl/syscall.h diff --git a/libs/libglibc-compatibility/musl/syscall_ret.c b/base/glibc-compatibility/musl/syscall_ret.c similarity index 100% rename from libs/libglibc-compatibility/musl/syscall_ret.c rename to base/glibc-compatibility/musl/syscall_ret.c diff --git a/libs/libglibc-compatibility/musl/timespec_get.c b/base/glibc-compatibility/musl/timespec_get.c similarity index 100% rename from libs/libglibc-compatibility/musl/timespec_get.c rename to base/glibc-compatibility/musl/timespec_get.c diff --git a/libs/libglibc-compatibility/musl/utimensat.c b/base/glibc-compatibility/musl/utimensat.c similarity index 100% rename from libs/libglibc-compatibility/musl/utimensat.c rename to base/glibc-compatibility/musl/utimensat.c diff --git a/libs/libglibc-compatibility/musl/vasprintf.c b/base/glibc-compatibility/musl/vasprintf.c similarity index 100% rename from libs/libglibc-compatibility/musl/vasprintf.c rename to base/glibc-compatibility/musl/vasprintf.c diff --git a/libs/libglibc-compatibility/musl/vdso.c b/base/glibc-compatibility/musl/vdso.c similarity index 100% rename from libs/libglibc-compatibility/musl/vdso.c rename to base/glibc-compatibility/musl/vdso.c diff --git a/libs/libglibc-compatibility/musl/x86_64/atomic_arch.h b/base/glibc-compatibility/musl/x86_64/atomic_arch.h similarity index 100% rename from libs/libglibc-compatibility/musl/x86_64/atomic_arch.h rename to base/glibc-compatibility/musl/x86_64/atomic_arch.h diff --git a/libs/libglibc-compatibility/musl/x86_64/longjmp.s b/base/glibc-compatibility/musl/x86_64/longjmp.s similarity index 100% rename from libs/libglibc-compatibility/musl/x86_64/longjmp.s rename to base/glibc-compatibility/musl/x86_64/longjmp.s diff --git a/libs/libglibc-compatibility/musl/x86_64/syscall.s b/base/glibc-compatibility/musl/x86_64/syscall.s similarity index 100% rename from libs/libglibc-compatibility/musl/x86_64/syscall.s rename to base/glibc-compatibility/musl/x86_64/syscall.s diff --git a/libs/libglibc-compatibility/musl/x86_64/syscall_arch.h b/base/glibc-compatibility/musl/x86_64/syscall_arch.h similarity index 100% rename from libs/libglibc-compatibility/musl/x86_64/syscall_arch.h rename to base/glibc-compatibility/musl/x86_64/syscall_arch.h diff --git a/libs/libloggers/CMakeLists.txt b/base/loggers/CMakeLists.txt similarity index 100% rename from libs/libloggers/CMakeLists.txt rename to base/loggers/CMakeLists.txt diff --git a/libs/libloggers/loggers/CMakeLists.txt b/base/loggers/loggers/CMakeLists.txt similarity index 100% rename from libs/libloggers/loggers/CMakeLists.txt rename to base/loggers/loggers/CMakeLists.txt diff --git a/libs/libloggers/loggers/ExtendedLogChannel.cpp b/base/loggers/loggers/ExtendedLogChannel.cpp similarity index 100% rename from libs/libloggers/loggers/ExtendedLogChannel.cpp rename to base/loggers/loggers/ExtendedLogChannel.cpp diff --git a/libs/libloggers/loggers/ExtendedLogChannel.h b/base/loggers/loggers/ExtendedLogChannel.h similarity index 100% rename from libs/libloggers/loggers/ExtendedLogChannel.h rename to base/loggers/loggers/ExtendedLogChannel.h diff --git a/libs/libloggers/loggers/Loggers.cpp b/base/loggers/loggers/Loggers.cpp similarity index 100% rename from libs/libloggers/loggers/Loggers.cpp rename to base/loggers/loggers/Loggers.cpp diff --git a/libs/libloggers/loggers/Loggers.h b/base/loggers/loggers/Loggers.h similarity index 100% rename from libs/libloggers/loggers/Loggers.h rename to base/loggers/loggers/Loggers.h diff --git a/libs/libloggers/loggers/OwnFormattingChannel.cpp b/base/loggers/loggers/OwnFormattingChannel.cpp similarity index 100% rename from libs/libloggers/loggers/OwnFormattingChannel.cpp rename to base/loggers/loggers/OwnFormattingChannel.cpp diff --git a/libs/libloggers/loggers/OwnFormattingChannel.h b/base/loggers/loggers/OwnFormattingChannel.h similarity index 100% rename from libs/libloggers/loggers/OwnFormattingChannel.h rename to base/loggers/loggers/OwnFormattingChannel.h diff --git a/libs/libloggers/loggers/OwnPatternFormatter.cpp b/base/loggers/loggers/OwnPatternFormatter.cpp similarity index 100% rename from libs/libloggers/loggers/OwnPatternFormatter.cpp rename to base/loggers/loggers/OwnPatternFormatter.cpp diff --git a/libs/libloggers/loggers/OwnPatternFormatter.h b/base/loggers/loggers/OwnPatternFormatter.h similarity index 100% rename from libs/libloggers/loggers/OwnPatternFormatter.h rename to base/loggers/loggers/OwnPatternFormatter.h diff --git a/libs/libloggers/loggers/OwnSplitChannel.cpp b/base/loggers/loggers/OwnSplitChannel.cpp similarity index 100% rename from libs/libloggers/loggers/OwnSplitChannel.cpp rename to base/loggers/loggers/OwnSplitChannel.cpp diff --git a/libs/libloggers/loggers/OwnSplitChannel.h b/base/loggers/loggers/OwnSplitChannel.h similarity index 100% rename from libs/libloggers/loggers/OwnSplitChannel.h rename to base/loggers/loggers/OwnSplitChannel.h diff --git a/libs/libmemcpy/CMakeLists.txt b/base/memcpy/CMakeLists.txt similarity index 100% rename from libs/libmemcpy/CMakeLists.txt rename to base/memcpy/CMakeLists.txt diff --git a/libs/libmemcpy/README.md b/base/memcpy/README.md similarity index 100% rename from libs/libmemcpy/README.md rename to base/memcpy/README.md diff --git a/libs/libmemcpy/impl/FastMemcpy.h b/base/memcpy/impl/FastMemcpy.h similarity index 100% rename from libs/libmemcpy/impl/FastMemcpy.h rename to base/memcpy/impl/FastMemcpy.h diff --git a/libs/libmemcpy/impl/LICENSE b/base/memcpy/impl/LICENSE similarity index 100% rename from libs/libmemcpy/impl/LICENSE rename to base/memcpy/impl/LICENSE diff --git a/libs/libmemcpy/impl/README.md b/base/memcpy/impl/README.md similarity index 100% rename from libs/libmemcpy/impl/README.md rename to base/memcpy/impl/README.md diff --git a/libs/libmemcpy/memcpy.c b/base/memcpy/memcpy.c similarity index 100% rename from libs/libmemcpy/memcpy.c rename to base/memcpy/memcpy.c diff --git a/libs/libmemcpy/memcpy.h b/base/memcpy/memcpy.h similarity index 100% rename from libs/libmemcpy/memcpy.h rename to base/memcpy/memcpy.h diff --git a/libs/libmysqlxx/CMakeLists.txt b/base/mysqlxx/CMakeLists.txt similarity index 100% rename from libs/libmysqlxx/CMakeLists.txt rename to base/mysqlxx/CMakeLists.txt diff --git a/libs/libmysqlxx/include/mysqlxx/Connection.h b/base/mysqlxx/include/mysqlxx/Connection.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/Connection.h rename to base/mysqlxx/include/mysqlxx/Connection.h diff --git a/libs/libmysqlxx/include/mysqlxx/Exception.h b/base/mysqlxx/include/mysqlxx/Exception.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/Exception.h rename to base/mysqlxx/include/mysqlxx/Exception.h diff --git a/libs/libmysqlxx/include/mysqlxx/Null.h b/base/mysqlxx/include/mysqlxx/Null.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/Null.h rename to base/mysqlxx/include/mysqlxx/Null.h diff --git a/libs/libmysqlxx/include/mysqlxx/Pool.h b/base/mysqlxx/include/mysqlxx/Pool.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/Pool.h rename to base/mysqlxx/include/mysqlxx/Pool.h diff --git a/libs/libmysqlxx/include/mysqlxx/PoolWithFailover.h b/base/mysqlxx/include/mysqlxx/PoolWithFailover.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/PoolWithFailover.h rename to base/mysqlxx/include/mysqlxx/PoolWithFailover.h diff --git a/libs/libmysqlxx/include/mysqlxx/Query.h b/base/mysqlxx/include/mysqlxx/Query.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/Query.h rename to base/mysqlxx/include/mysqlxx/Query.h diff --git a/libs/libmysqlxx/include/mysqlxx/ResultBase.h b/base/mysqlxx/include/mysqlxx/ResultBase.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/ResultBase.h rename to base/mysqlxx/include/mysqlxx/ResultBase.h diff --git a/libs/libmysqlxx/include/mysqlxx/Row.h b/base/mysqlxx/include/mysqlxx/Row.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/Row.h rename to base/mysqlxx/include/mysqlxx/Row.h diff --git a/libs/libmysqlxx/include/mysqlxx/StoreQueryResult.h b/base/mysqlxx/include/mysqlxx/StoreQueryResult.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/StoreQueryResult.h rename to base/mysqlxx/include/mysqlxx/StoreQueryResult.h diff --git a/libs/libmysqlxx/include/mysqlxx/Transaction.h b/base/mysqlxx/include/mysqlxx/Transaction.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/Transaction.h rename to base/mysqlxx/include/mysqlxx/Transaction.h diff --git a/libs/libmysqlxx/include/mysqlxx/Types.h b/base/mysqlxx/include/mysqlxx/Types.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/Types.h rename to base/mysqlxx/include/mysqlxx/Types.h diff --git a/libs/libmysqlxx/include/mysqlxx/UseQueryResult.h b/base/mysqlxx/include/mysqlxx/UseQueryResult.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/UseQueryResult.h rename to base/mysqlxx/include/mysqlxx/UseQueryResult.h diff --git a/libs/libmysqlxx/include/mysqlxx/Value.h b/base/mysqlxx/include/mysqlxx/Value.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/Value.h rename to base/mysqlxx/include/mysqlxx/Value.h diff --git a/libs/libmysqlxx/include/mysqlxx/mysqlxx.h b/base/mysqlxx/include/mysqlxx/mysqlxx.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/mysqlxx.h rename to base/mysqlxx/include/mysqlxx/mysqlxx.h diff --git a/libs/libmysqlxx/src/Connection.cpp b/base/mysqlxx/src/Connection.cpp similarity index 100% rename from libs/libmysqlxx/src/Connection.cpp rename to base/mysqlxx/src/Connection.cpp diff --git a/libs/libmysqlxx/src/Exception.cpp b/base/mysqlxx/src/Exception.cpp similarity index 100% rename from libs/libmysqlxx/src/Exception.cpp rename to base/mysqlxx/src/Exception.cpp diff --git a/libs/libmysqlxx/src/Pool.cpp b/base/mysqlxx/src/Pool.cpp similarity index 100% rename from libs/libmysqlxx/src/Pool.cpp rename to base/mysqlxx/src/Pool.cpp diff --git a/libs/libmysqlxx/src/PoolWithFailover.cpp b/base/mysqlxx/src/PoolWithFailover.cpp similarity index 100% rename from libs/libmysqlxx/src/PoolWithFailover.cpp rename to base/mysqlxx/src/PoolWithFailover.cpp diff --git a/libs/libmysqlxx/src/Query.cpp b/base/mysqlxx/src/Query.cpp similarity index 100% rename from libs/libmysqlxx/src/Query.cpp rename to base/mysqlxx/src/Query.cpp diff --git a/libs/libmysqlxx/src/ResultBase.cpp b/base/mysqlxx/src/ResultBase.cpp similarity index 100% rename from libs/libmysqlxx/src/ResultBase.cpp rename to base/mysqlxx/src/ResultBase.cpp diff --git a/libs/libmysqlxx/src/Row.cpp b/base/mysqlxx/src/Row.cpp similarity index 100% rename from libs/libmysqlxx/src/Row.cpp rename to base/mysqlxx/src/Row.cpp diff --git a/libs/libmysqlxx/src/StoreQueryResult.cpp b/base/mysqlxx/src/StoreQueryResult.cpp similarity index 100% rename from libs/libmysqlxx/src/StoreQueryResult.cpp rename to base/mysqlxx/src/StoreQueryResult.cpp diff --git a/libs/libmysqlxx/src/UseQueryResult.cpp b/base/mysqlxx/src/UseQueryResult.cpp similarity index 100% rename from libs/libmysqlxx/src/UseQueryResult.cpp rename to base/mysqlxx/src/UseQueryResult.cpp diff --git a/libs/libmysqlxx/src/Value.cpp b/base/mysqlxx/src/Value.cpp similarity index 100% rename from libs/libmysqlxx/src/Value.cpp rename to base/mysqlxx/src/Value.cpp diff --git a/libs/libmysqlxx/src/tests/CMakeLists.txt b/base/mysqlxx/src/tests/CMakeLists.txt similarity index 100% rename from libs/libmysqlxx/src/tests/CMakeLists.txt rename to base/mysqlxx/src/tests/CMakeLists.txt diff --git a/libs/libmysqlxx/src/tests/failover.xml b/base/mysqlxx/src/tests/failover.xml similarity index 100% rename from libs/libmysqlxx/src/tests/failover.xml rename to base/mysqlxx/src/tests/failover.xml diff --git a/libs/libmysqlxx/src/tests/mysqlxx_test.cpp b/base/mysqlxx/src/tests/mysqlxx_test.cpp similarity index 100% rename from libs/libmysqlxx/src/tests/mysqlxx_test.cpp rename to base/mysqlxx/src/tests/mysqlxx_test.cpp diff --git a/libs/libwidechar_width/CMakeLists.txt b/base/widechar_width/CMakeLists.txt similarity index 100% rename from libs/libwidechar_width/CMakeLists.txt rename to base/widechar_width/CMakeLists.txt diff --git a/libs/libwidechar_width/LICENSE b/base/widechar_width/LICENSE similarity index 100% rename from libs/libwidechar_width/LICENSE rename to base/widechar_width/LICENSE diff --git a/libs/libwidechar_width/README.md b/base/widechar_width/README.md similarity index 100% rename from libs/libwidechar_width/README.md rename to base/widechar_width/README.md diff --git a/libs/libwidechar_width/widechar_width.cpp b/base/widechar_width/widechar_width.cpp similarity index 100% rename from libs/libwidechar_width/widechar_width.cpp rename to base/widechar_width/widechar_width.cpp diff --git a/libs/libwidechar_width/widechar_width.h b/base/widechar_width/widechar_width.h similarity index 100% rename from libs/libwidechar_width/widechar_width.h rename to base/widechar_width/widechar_width.h diff --git a/cmake/add_warning.cmake b/cmake/add_warning.cmake index 9bf2b1b5e93..3a776c98ab6 100644 --- a/cmake/add_warning.cmake +++ b/cmake/add_warning.cmake @@ -1,15 +1,26 @@ include (CheckCXXCompilerFlag) +include (CheckCCompilerFlag) # Try to add -Wflag if compiler supports it macro (add_warning flag) string (REPLACE "-" "_" underscored_flag ${flag}) string (REPLACE "+" "x" underscored_flag ${underscored_flag}) - check_cxx_compiler_flag("-W${flag}" SUPPORTS_FLAG_${underscored_flag}) - if (SUPPORTS_FLAG_${underscored_flag}) + + check_cxx_compiler_flag("-W${flag}" SUPPORTS_CXXFLAG_${underscored_flag}) + check_c_compiler_flag("-W${flag}" SUPPORTS_CFLAG_${underscored_flag}) + + if (SUPPORTS_CXXFLAG_${underscored_flag}) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W${flag}") else () message (WARNING "Flag -W${flag} is unsupported") endif () + + if (SUPPORTS_CFLAG_${underscored_flag}) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W${flag}") + else () + message (WARNING "Flag -W${flag} is unsupported") + endif () + endmacro () # Try to add -Wno flag if compiler supports it diff --git a/libs/libcommon/cmake/find_cctz.cmake b/cmake/find/cctz.cmake similarity index 100% rename from libs/libcommon/cmake/find_cctz.cmake rename to cmake/find/cctz.cmake diff --git a/libs/libcommon/cmake/find_jemalloc.cmake b/cmake/find/jemalloc.cmake similarity index 100% rename from libs/libcommon/cmake/find_jemalloc.cmake rename to cmake/find/jemalloc.cmake diff --git a/libs/libmysqlxx/cmake/find_mysqlclient.cmake b/cmake/find/mysqlclient.cmake similarity index 100% rename from libs/libmysqlxx/cmake/find_mysqlclient.cmake rename to cmake/find/mysqlclient.cmake diff --git a/cmake/find/rt.cmake b/cmake/find/rt.cmake deleted file mode 100644 index 25614fe55eb..00000000000 --- a/cmake/find/rt.cmake +++ /dev/null @@ -1,10 +0,0 @@ -if (APPLE) - # lib from libs/libcommon - set (RT_LIBRARY "apple_rt") -elseif (OS_FREEBSD) - find_library (RT_LIBRARY rt) -else () - set (RT_LIBRARY "") -endif () - -message(STATUS "Using rt: ${RT_LIBRARY}") diff --git a/cmake/lib_name.cmake b/cmake/lib_name.cmake index 847efb15fc5..51a424cb4e2 100644 --- a/cmake/lib_name.cmake +++ b/cmake/lib_name.cmake @@ -1,5 +1,4 @@ set(DIVIDE_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/libdivide) -set(COMMON_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/libs/libcommon/include ${ClickHouse_BINARY_DIR}/libs/libcommon/include) set(DBMS_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/dbms/src ${ClickHouse_BINARY_DIR}/dbms/src) set(DOUBLE_CONVERSION_CONTRIB_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/double-conversion) set(METROHASH_CONTRIB_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/libmetrohash/src) diff --git a/cmake/linux/default_libs.cmake b/cmake/linux/default_libs.cmake index 6ecc3e96593..d18a996e2c9 100644 --- a/cmake/linux/default_libs.cmake +++ b/cmake/linux/default_libs.cmake @@ -35,7 +35,7 @@ add_library(global-libs INTERFACE) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -add_subdirectory(libs/libglibc-compatibility) +add_subdirectory(base/glibc-compatibility) include (cmake/find/unwind.cmake) include (cmake/find/cxx.cmake) diff --git a/dbms/CMakeLists.txt b/dbms/CMakeLists.txt index eeda7aa6a1f..0af6955eab0 100644 --- a/dbms/CMakeLists.txt +++ b/dbms/CMakeLists.txt @@ -36,11 +36,6 @@ if (NOT MSVC) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra") endif () -if (NOT NO_WERROR) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") -endif () - # Add some warnings that are not available even with -Wall -Wextra -Wpedantic. option (WEVERYTHING "Enables -Weverything option with some exceptions. This is intended for exploration of new compiler warnings that may be found to be useful. Only makes sense for clang." ON) @@ -190,11 +185,6 @@ elseif (COMPILER_GCC) add_cxx_compile_options(-Wvector-operation-performance) endif () -if (USE_DEBUG_HELPERS) - set (INCLUDE_DEBUG_HELPERS "-I${ClickHouse_SOURCE_DIR}/libs/libcommon/include -include ${ClickHouse_SOURCE_DIR}/dbms/src/Core/iostream_debug_helpers.h") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${INCLUDE_DEBUG_HELPERS}") -endif () - if (COMPILER_GCC) # If we leave this optimization enabled, gcc-7 replaces a pair of SSE intrinsics (16 byte load, store) with a call to memcpy. # It leads to slow code. This is compiler bug. It looks like this: @@ -394,8 +384,6 @@ target_link_libraries(clickhouse_common_io PUBLIC ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} - PRIVATE - apple_rt PUBLIC roaring ) @@ -577,9 +565,6 @@ target_include_directories (clickhouse_common_io PUBLIC ${DBMS_INCLUDE_DIR}) target_include_directories (clickhouse_common_io SYSTEM BEFORE PUBLIC ${DOUBLE_CONVERSION_INCLUDE_DIR}) -# also for copy_headers.sh: -target_include_directories (clickhouse_common_io BEFORE PRIVATE ${COMMON_INCLUDE_DIR}) - add_subdirectory (programs) add_subdirectory (tests) diff --git a/dbms/programs/CMakeLists.txt b/dbms/programs/CMakeLists.txt index 48fb30a8058..eea7a5f4fbe 100644 --- a/dbms/programs/CMakeLists.txt +++ b/dbms/programs/CMakeLists.txt @@ -112,7 +112,6 @@ if (CLICKHOUSE_SPLIT_BINARY) else () add_executable (clickhouse main.cpp) target_link_libraries (clickhouse PRIVATE clickhouse_common_io string_utils) - target_include_directories (clickhouse BEFORE PRIVATE ${COMMON_INCLUDE_DIR}) target_include_directories (clickhouse PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) if (ENABLE_CLICKHOUSE_SERVER) diff --git a/dbms/programs/benchmark/Benchmark.cpp b/dbms/programs/benchmark/Benchmark.cpp index 3dd89cd1710..440d07f8ad3 100644 --- a/dbms/programs/benchmark/Benchmark.cpp +++ b/dbms/programs/benchmark/Benchmark.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/dbms/programs/obfuscator/Obfuscator.cpp b/dbms/programs/obfuscator/Obfuscator.cpp index 83aa43ab2d2..d86ba1ee7a3 100644 --- a/dbms/programs/obfuscator/Obfuscator.cpp +++ b/dbms/programs/obfuscator/Obfuscator.cpp @@ -108,6 +108,9 @@ public: /// Call generate: pass source data column to obtain a column with anonymized data as a result. virtual ColumnPtr generate(const IColumn & column); + /// Deterministically change seed to some other value. This can be used to generate more values than were in source. + virtual void updateSeed(); + virtual ~IModel() {} }; @@ -175,7 +178,7 @@ static UInt64 transform(UInt64 x, UInt64 seed) class UnsignedIntegerModel : public IModel { private: - const UInt64 seed; + UInt64 seed; public: UnsignedIntegerModel(UInt64 seed_) : seed(seed_) {} @@ -195,6 +198,11 @@ public: return res; } + + void updateSeed() override + { + seed = hash(seed); + } }; @@ -211,7 +219,7 @@ static Int64 transformSigned(Int64 x, UInt64 seed) class SignedIntegerModel : public IModel { private: - const UInt64 seed; + UInt64 seed; public: SignedIntegerModel(UInt64 seed_) : seed(seed_) {} @@ -231,6 +239,11 @@ public: return res; } + + void updateSeed() override + { + seed = hash(seed); + } }; @@ -253,7 +266,7 @@ template class FloatModel : public IModel { private: - const UInt64 seed; + UInt64 seed; Float src_prev_value = 0; Float res_prev_value = 0; @@ -280,6 +293,11 @@ public: return res_column; } + + void updateSeed() override + { + seed = hash(seed); + } }; @@ -294,6 +312,10 @@ public: { return column.cloneResized(column.size()); } + + void updateSeed() override + { + } }; @@ -347,7 +369,7 @@ static void transformFixedString(const UInt8 * src, UInt8 * dst, size_t size, UI class FixedStringModel : public IModel { private: - const UInt64 seed; + UInt64 seed; public: FixedStringModel(UInt64 seed_) : seed(seed_) {} @@ -373,6 +395,11 @@ public: return res_column; } + + void updateSeed() override + { + seed = hash(seed); + } }; @@ -380,7 +407,7 @@ public: class DateTimeModel : public IModel { private: - const UInt64 seed; + UInt64 seed; UInt32 src_prev_value = 0; UInt32 res_prev_value = 0; @@ -418,6 +445,11 @@ public: return res_column; } + + void updateSeed() override + { + seed = hash(seed); + } }; @@ -790,6 +822,11 @@ public: return res_column; } + + void updateSeed() override + { + seed = hash(seed); + } }; @@ -823,6 +860,11 @@ public: return ColumnArray::create((*std::move(new_nested_column)).mutate(), (*std::move(column_array.getOffsetsPtr())).mutate()); } + + void updateSeed() override + { + nested_model->updateSeed(); + } }; @@ -856,6 +898,11 @@ public: return ColumnNullable::create((*std::move(new_nested_column)).mutate(), (*std::move(column_nullable.getNullMapColumnPtr())).mutate()); } + + void updateSeed() override + { + nested_model->updateSeed(); + } }; @@ -939,6 +986,12 @@ public: res[i] = models[i]->generate(*columns[i]); return res; } + + void updateSeed() + { + for (auto & model : models) + model->updateSeed(); + } }; } @@ -993,7 +1046,7 @@ try std::string input_format = options["input-format"].as(); std::string output_format = options["output-format"].as(); - std::optional limit; + UInt64 limit = 0; if (options.count("limit")) limit = options["limit"].as(); @@ -1045,27 +1098,32 @@ try UInt64 max_block_size = 8192; /// Train step + UInt64 source_rows = 0; { if (!silent) std::cerr << "Training models\n"; BlockInputStreamPtr input = context.getInputFormat(input_format, file_in, header, max_block_size); - UInt64 processed_rows = 0; input->readPrefix(); while (Block block = input->read()) { obfuscator.train(block.getColumns()); - processed_rows += block.rows(); + source_rows += block.rows(); if (!silent) - std::cerr << "Processed " << processed_rows << " rows\n"; + std::cerr << "Processed " << source_rows << " rows\n"; } input->readSuffix(); } obfuscator.finalize(); + if (!limit) + limit = source_rows; + /// Generation step + UInt64 processed_rows = 0; + while (processed_rows < limit) { if (!silent) std::cerr << "Generating data\n"; @@ -1075,10 +1133,9 @@ try BlockInputStreamPtr input = context.getInputFormat(input_format, file_in, header, max_block_size); BlockOutputStreamPtr output = context.getOutputFormat(output_format, file_out, header); - if (limit) - input = std::make_shared(input, *limit, 0); + if (processed_rows + source_rows > limit) + input = std::make_shared(input, limit - processed_rows, 0); - UInt64 processed_rows = 0; input->readPrefix(); output->writePrefix(); while (Block block = input->read()) @@ -1091,6 +1148,8 @@ try } output->writeSuffix(); input->readSuffix(); + + obfuscator.updateSeed(); } return 0; diff --git a/dbms/programs/performance-test/PerformanceTestSuite.cpp b/dbms/programs/performance-test/PerformanceTestSuite.cpp index fbf43bfa29f..73ae2ae90ed 100644 --- a/dbms/programs/performance-test/PerformanceTestSuite.cpp +++ b/dbms/programs/performance-test/PerformanceTestSuite.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/dbms/src/AggregateFunctions/CMakeLists.txt b/dbms/src/AggregateFunctions/CMakeLists.txt index dbbccc3bc7a..f0abc99811e 100644 --- a/dbms/src/AggregateFunctions/CMakeLists.txt +++ b/dbms/src/AggregateFunctions/CMakeLists.txt @@ -21,7 +21,6 @@ list(REMOVE_ITEM clickhouse_aggregate_functions_headers add_library(clickhouse_aggregate_functions ${clickhouse_aggregate_functions_sources}) target_link_libraries(clickhouse_aggregate_functions PRIVATE dbms PUBLIC ${CITYHASH_LIBRARIES}) -target_include_directories(clickhouse_aggregate_functions PRIVATE ${COMMON_INCLUDE_DIR}) if(ENABLE_TESTS) add_subdirectory(tests) diff --git a/dbms/src/Common/ShellCommand.cpp b/dbms/src/Common/ShellCommand.cpp index dd99221d4f7..706d5bfbece 100644 --- a/dbms/src/Common/ShellCommand.cpp +++ b/dbms/src/Common/ShellCommand.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include namespace diff --git a/dbms/src/Common/Stopwatch.h b/dbms/src/Common/Stopwatch.h index 6db345c219a..db337355e2d 100644 --- a/dbms/src/Common/Stopwatch.h +++ b/dbms/src/Common/Stopwatch.h @@ -1,9 +1,9 @@ #pragma once -#include -#include +#include #include -#include + +#include namespace StopWatchDetail diff --git a/dbms/src/Common/Throttler.h b/dbms/src/Common/Throttler.h index a23b0f9db22..172cce783d8 100644 --- a/dbms/src/Common/Throttler.h +++ b/dbms/src/Common/Throttler.h @@ -1,6 +1,5 @@ #pragma once -#include /// nanosleep #include #include #include @@ -8,7 +7,6 @@ #include #include #include -#include namespace ProfileEvents diff --git a/dbms/src/Common/ZooKeeper/ZooKeeper.h b/dbms/src/Common/ZooKeeper/ZooKeeper.h index 5bae272102d..c553d162c2b 100644 --- a/dbms/src/Common/ZooKeeper/ZooKeeper.h +++ b/dbms/src/Common/ZooKeeper/ZooKeeper.h @@ -11,7 +11,7 @@ #include #include #include -#include +#include namespace ProfileEvents diff --git a/dbms/src/Common/ZooKeeper/tests/zkutil_test_commands.cpp b/dbms/src/Common/ZooKeeper/tests/zkutil_test_commands.cpp index a49a5cf1a6d..490c834eab9 100644 --- a/dbms/src/Common/ZooKeeper/tests/zkutil_test_commands.cpp +++ b/dbms/src/Common/ZooKeeper/tests/zkutil_test_commands.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include using namespace zkutil; diff --git a/dbms/src/Common/randomSeed.cpp b/dbms/src/Common/randomSeed.cpp index 8402fa4acf8..4d466d283c9 100644 --- a/dbms/src/Common/randomSeed.cpp +++ b/dbms/src/Common/randomSeed.cpp @@ -1,11 +1,10 @@ #include -#include +#include #include #include #include #include #include -#include namespace DB diff --git a/dbms/src/Common/tests/Random.cpp b/dbms/src/Common/tests/Random.cpp index d926b21c133..5264a2d9adc 100644 --- a/dbms/src/Common/tests/Random.cpp +++ b/dbms/src/Common/tests/Random.cpp @@ -1,6 +1,5 @@ /// Taken from SMHasher. #include "Random.h" -#include Rand g_rand1(1); Rand g_rand2(2); diff --git a/dbms/src/Common/tests/compact_array.cpp b/dbms/src/Common/tests/compact_array.cpp index e238263c801..91fb59d543f 100644 --- a/dbms/src/Common/tests/compact_array.cpp +++ b/dbms/src/Common/tests/compact_array.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include namespace fs = std::filesystem; diff --git a/dbms/src/Common/tests/int_hashes_perf.cpp b/dbms/src/Common/tests/int_hashes_perf.cpp index 5f028cbbde8..69020178bd4 100644 --- a/dbms/src/Common/tests/int_hashes_perf.cpp +++ b/dbms/src/Common/tests/int_hashes_perf.cpp @@ -1,5 +1,5 @@ -#if !defined(__APPLE__) && !defined(__FreeBSD__) -#include +#if defined (OS_LINUX) +# include #endif #include @@ -9,7 +9,6 @@ #include #include #include "AvalancheTest.h" /// Taken from SMHasher. -#include static void setAffinity() diff --git a/dbms/src/Compression/CachedCompressedReadBuffer.h b/dbms/src/Compression/CachedCompressedReadBuffer.h index 52ef750ff19..8821a824a0f 100644 --- a/dbms/src/Compression/CachedCompressedReadBuffer.h +++ b/dbms/src/Compression/CachedCompressedReadBuffer.h @@ -5,7 +5,6 @@ #include #include "CompressedReadBufferBase.h" #include -#include namespace DB diff --git a/dbms/src/Functions/FunctionBitTestMany.h b/dbms/src/Functions/FunctionBitTestMany.h index 7c4d6abd172..87a10946dc4 100644 --- a/dbms/src/Functions/FunctionBitTestMany.h +++ b/dbms/src/Functions/FunctionBitTestMany.h @@ -142,8 +142,9 @@ private: { if (auto pos_col_const = checkAndGetColumnConst>(block.getByPosition(arguments[i]).column.get())) { - const auto pos = pos_col_const->template getValue(); - mask = mask | (1 << pos); + const auto pos = pos_col_const->getUInt(0); + if (pos < 8 * sizeof(ValueType)) + mask = mask | (ValueType(1) << pos); } else { @@ -175,21 +176,22 @@ private: } template - bool addToMaskImpl(PaddedPODArray & mask, const IColumn * const pos_col_untyped) + bool NO_SANITIZE_UNDEFINED addToMaskImpl(PaddedPODArray & mask, const IColumn * const pos_col_untyped) { if (const auto pos_col = checkAndGetColumn>(pos_col_untyped)) { const auto & pos = pos_col->getData(); for (const auto i : ext::range(0, mask.size())) - mask[i] = mask[i] | (1 << pos[i]); + if (pos[i] < 8 * sizeof(ValueType)) + mask[i] = mask[i] | (ValueType(1) << pos[i]); return true; } else if (const auto pos_col_const = checkAndGetColumnConst>(pos_col_untyped)) { const auto & pos = pos_col_const->template getValue(); - const auto new_mask = 1 << pos; + const auto new_mask = pos < 8 * sizeof(ValueType) ? ValueType(1) << pos : 0; for (const auto i : ext::range(0, mask.size())) mask[i] = mask[i] | new_mask; diff --git a/dbms/src/IO/ReadBuffer.h b/dbms/src/IO/ReadBuffer.h index 805c6445ebf..664e2567006 100644 --- a/dbms/src/IO/ReadBuffer.h +++ b/dbms/src/IO/ReadBuffer.h @@ -26,7 +26,7 @@ namespace ErrorCodes * This causes inconveniences - for example, when using ReadBuffer to read from a chunk of memory const char *, * you have to use const_cast. * - * successors must implement the nextImpl() method. + * Derived classes must implement the nextImpl() method. */ class ReadBuffer : public BufferBase { @@ -157,7 +157,7 @@ public: throw Exception("Cannot read all data. Bytes read: " + std::to_string(read_bytes) + ". Bytes expected: " + std::to_string(n) + ".", ErrorCodes::CANNOT_READ_ALL_DATA); } - /** A method that can be more efficiently implemented in successors, in the case of reading large enough blocks. + /** A method that can be more efficiently implemented in derived classes, in the case of reading large enough blocks. * The implementation can read data directly into `to`, without superfluous copying, if in `to` there is enough space for work. * For example, a CompressedReadBuffer can decompress the data directly into `to`, if the entire decompressed block fits there. * By default - the same as read. diff --git a/dbms/src/IO/ReadBufferFromFileBase.h b/dbms/src/IO/ReadBufferFromFileBase.h index 58f54904e85..767f0a3b2b0 100644 --- a/dbms/src/IO/ReadBufferFromFileBase.h +++ b/dbms/src/IO/ReadBufferFromFileBase.h @@ -1,13 +1,14 @@ #pragma once -#include +#include +#include +#include + #include #include + #include -#include -#include -#include -#include "SeekableReadBuffer.h" + namespace DB { diff --git a/dbms/src/IO/ReadBufferFromFileDescriptor.h b/dbms/src/IO/ReadBufferFromFileDescriptor.h index dc2d581ebf1..bb170d472f1 100644 --- a/dbms/src/IO/ReadBufferFromFileDescriptor.h +++ b/dbms/src/IO/ReadBufferFromFileDescriptor.h @@ -1,8 +1,8 @@ #pragma once -#include #include -#include + +#include namespace DB diff --git a/dbms/src/IO/WriteBufferFromFileDescriptor.cpp b/dbms/src/IO/WriteBufferFromFileDescriptor.cpp index bfa1e9582d3..2891c1b7076 100644 --- a/dbms/src/IO/WriteBufferFromFileDescriptor.cpp +++ b/dbms/src/IO/WriteBufferFromFileDescriptor.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/dbms/src/IO/tests/gtest_aio_seek_back_after_eof.cpp b/dbms/src/IO/tests/gtest_aio_seek_back_after_eof.cpp index 35c2db70564..22cfffdda05 100644 --- a/dbms/src/IO/tests/gtest_aio_seek_back_after_eof.cpp +++ b/dbms/src/IO/tests/gtest_aio_seek_back_after_eof.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include #include diff --git a/dbms/src/IO/tests/read_buffer_aio.cpp b/dbms/src/IO/tests/read_buffer_aio.cpp index 04aafd1fee2..8c99ed26179 100644 --- a/dbms/src/IO/tests/read_buffer_aio.cpp +++ b/dbms/src/IO/tests/read_buffer_aio.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include namespace @@ -670,4 +670,3 @@ int main() run(); return 0; } - diff --git a/dbms/src/Interpreters/ClientInfo.cpp b/dbms/src/Interpreters/ClientInfo.cpp index 3fbc015afe2..743fe934dc3 100644 --- a/dbms/src/Interpreters/ClientInfo.cpp +++ b/dbms/src/Interpreters/ClientInfo.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include namespace DB diff --git a/dbms/src/Interpreters/tests/users.cpp b/dbms/src/Interpreters/tests/users.cpp index 93b1f6c27f1..ca96d6f4568 100644 --- a/dbms/src/Interpreters/tests/users.cpp +++ b/dbms/src/Interpreters/tests/users.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include namespace { diff --git a/dbms/src/Processors/Formats/Impl/PrettyBlockOutputFormat.cpp b/dbms/src/Processors/Formats/Impl/PrettyBlockOutputFormat.cpp index c0b1b2e4ffc..6a3a34278fe 100644 --- a/dbms/src/Processors/Formats/Impl/PrettyBlockOutputFormat.cpp +++ b/dbms/src/Processors/Formats/Impl/PrettyBlockOutputFormat.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/dbms/src/Storages/MergeTree/MergeTreeReader.h b/dbms/src/Storages/MergeTree/MergeTreeReader.h index 65485f950c6..1505b71ef53 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeReader.h +++ b/dbms/src/Storages/MergeTree/MergeTreeReader.h @@ -2,7 +2,6 @@ #include #include -#include namespace DB diff --git a/dbms/src/Storages/tests/remove_symlink_directory.cpp b/dbms/src/Storages/tests/remove_symlink_directory.cpp index b455357863e..ae5fa72fa66 100644 --- a/dbms/src/Storages/tests/remove_symlink_directory.cpp +++ b/dbms/src/Storages/tests/remove_symlink_directory.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/dbms/src/Storages/tests/transform_part_zk_nodes.cpp b/dbms/src/Storages/tests/transform_part_zk_nodes.cpp index 2a03e9b9746..b496158ea99 100644 --- a/dbms/src/Storages/tests/transform_part_zk_nodes.cpp +++ b/dbms/src/Storages/tests/transform_part_zk_nodes.cpp @@ -88,6 +88,9 @@ try && !endsWith(it->path, "/columns") && !endsWith(it->path, "/checksums")) { + /// The node is related to part. + + /// If it is the part in old format (the node contains children) - convert it to the new format. if (!children_response.names.empty()) { auto part_header = DB::ReplicatedMergeTreePartHeader::fromColumnsAndChecksumsZNodes( @@ -103,6 +106,7 @@ try } else { + /// Recursively add children to the queue. for (const auto & name : children_response.names) { std::string child_path = it->path == "/" ? it->path + name : it->path + '/' + name; diff --git a/dbms/tests/queries/0_stateless/01082_bit_test_out_of_bound.reference b/dbms/tests/queries/0_stateless/01082_bit_test_out_of_bound.reference new file mode 100644 index 00000000000..708c5d9d994 --- /dev/null +++ b/dbms/tests/queries/0_stateless/01082_bit_test_out_of_bound.reference @@ -0,0 +1,200 @@ +0 1 +1 0 +2 1 +3 0 +4 1 +5 0 +6 1 +7 0 +8 0 +9 0 +10 0 +11 0 +12 0 +13 0 +14 0 +15 0 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 +25 0 +26 0 +27 0 +28 0 +29 0 +30 0 +31 0 +32 0 +33 0 +34 0 +35 0 +36 0 +37 0 +38 0 +39 0 +40 0 +41 0 +42 0 +43 0 +44 0 +45 0 +46 0 +47 0 +48 0 +49 0 +50 0 +51 0 +52 0 +53 0 +54 0 +55 0 +56 0 +57 0 +58 0 +59 0 +60 0 +61 0 +62 0 +63 0 +64 0 +65 0 +66 0 +67 0 +68 0 +69 0 +70 0 +71 0 +72 0 +73 0 +74 0 +75 0 +76 0 +77 0 +78 0 +79 0 +80 0 +81 0 +82 0 +83 0 +84 0 +85 0 +86 0 +87 0 +88 0 +89 0 +90 0 +91 0 +92 0 +93 0 +94 0 +95 0 +96 0 +97 0 +98 0 +99 0 +0 1 +1 0 +2 1 +3 0 +4 1 +5 0 +6 1 +7 0 +8 1 +9 1 +10 1 +11 1 +12 1 +13 1 +14 1 +15 1 +16 1 +17 1 +18 1 +19 1 +20 1 +21 1 +22 1 +23 1 +24 1 +25 1 +26 1 +27 1 +28 1 +29 1 +30 1 +31 1 +32 1 +33 1 +34 1 +35 1 +36 1 +37 1 +38 1 +39 1 +40 1 +41 1 +42 1 +43 1 +44 1 +45 1 +46 1 +47 1 +48 1 +49 1 +50 1 +51 1 +52 1 +53 1 +54 1 +55 1 +56 1 +57 1 +58 1 +59 1 +60 1 +61 1 +62 1 +63 1 +64 1 +65 1 +66 1 +67 1 +68 1 +69 1 +70 1 +71 1 +72 1 +73 1 +74 1 +75 1 +76 1 +77 1 +78 1 +79 1 +80 1 +81 1 +82 1 +83 1 +84 1 +85 1 +86 1 +87 1 +88 1 +89 1 +90 1 +91 1 +92 1 +93 1 +94 1 +95 1 +96 1 +97 1 +98 1 +99 1 diff --git a/dbms/tests/queries/0_stateless/01082_bit_test_out_of_bound.sql b/dbms/tests/queries/0_stateless/01082_bit_test_out_of_bound.sql new file mode 100644 index 00000000000..82e2c5a2380 --- /dev/null +++ b/dbms/tests/queries/0_stateless/01082_bit_test_out_of_bound.sql @@ -0,0 +1,2 @@ +SELECT number, bitTestAny(toUInt8(1 + 4 + 16 + 64), number) FROM numbers(100); +SELECT number, bitTestAll(toUInt8(1 + 4 + 16 + 64), number) FROM numbers(100); diff --git a/dbms/tests/queries/1_stateful/00092_obfuscator.reference b/dbms/tests/queries/1_stateful/00092_obfuscator.reference new file mode 100644 index 00000000000..a16ab4879a5 --- /dev/null +++ b/dbms/tests/queries/1_stateful/00092_obfuscator.reference @@ -0,0 +1,3 @@ +1000 320 171 23 +1000 251 164 11 +2500 569 354 13 diff --git a/dbms/tests/queries/1_stateful/00092_obfuscator.sh b/dbms/tests/queries/1_stateful/00092_obfuscator.sh new file mode 100755 index 00000000000..5608a0ce2a2 --- /dev/null +++ b/dbms/tests/queries/1_stateful/00092_obfuscator.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. $CURDIR/../shell_config.sh + +$CLICKHOUSE_CLIENT --max_threads 1 --query="SELECT URL, Title, SearchPhrase FROM test.hits LIMIT 1000" > ${CLICKHOUSE_TMP}/data.tsv + +$CLICKHOUSE_OBFUSCATOR --structure "URL String, Title String, SearchPhrase String" --input-format TSV --output-format TSV --seed hello < ${CLICKHOUSE_TMP}/data.tsv > ${CLICKHOUSE_TMP}/data1000.tsv 2>/dev/null +$CLICKHOUSE_OBFUSCATOR --structure "URL String, Title String, SearchPhrase String" --input-format TSV --output-format TSV --seed hello --limit 2500 < ${CLICKHOUSE_TMP}/data.tsv > ${CLICKHOUSE_TMP}/data2500.tsv 2>/dev/null + +$CLICKHOUSE_LOCAL --structure "URL String, Title String, SearchPhrase String" --input-format TSV --output-format TSV --query "SELECT count(), uniq(URL), uniq(Title), uniq(SearchPhrase) FROM table" < ${CLICKHOUSE_TMP}/data.tsv +$CLICKHOUSE_LOCAL --structure "URL String, Title String, SearchPhrase String" --input-format TSV --output-format TSV --query "SELECT count(), uniq(URL), uniq(Title), uniq(SearchPhrase) FROM table" < ${CLICKHOUSE_TMP}/data1000.tsv +$CLICKHOUSE_LOCAL --structure "URL String, Title String, SearchPhrase String" --input-format TSV --output-format TSV --query "SELECT count(), uniq(URL), uniq(Title), uniq(SearchPhrase) FROM table" < ${CLICKHOUSE_TMP}/data2500.tsv + +rm ${CLICKHOUSE_TMP}/data.tsv +rm ${CLICKHOUSE_TMP}/data1000.tsv +rm ${CLICKHOUSE_TMP}/data2500.tsv diff --git a/dbms/tests/queries/shell_config.sh b/dbms/tests/queries/shell_config.sh index da047025407..658432e9001 100644 --- a/dbms/tests/queries/shell_config.sh +++ b/dbms/tests/queries/shell_config.sh @@ -14,6 +14,7 @@ export CLICKHOUSE_CLIENT=${CLICKHOUSE_CLIENT:="$CLICKHOUSE_CLIENT_BINARY ${CLICK [ -x "${CLICKHOUSE_BINARY}-local" ] && CLICKHOUSE_LOCAL=${CLICKHOUSE_LOCAL:="${CLICKHOUSE_BINARY}-local"} [ -x "${CLICKHOUSE_BINARY}" ] && CLICKHOUSE_LOCAL=${CLICKHOUSE_LOCAL:="${CLICKHOUSE_BINARY} local"} export CLICKHOUSE_LOCAL=${CLICKHOUSE_LOCAL:="${CLICKHOUSE_BINARY}-local"} +export CLICKHOUSE_OBFUSCATOR=${CLICKHOUSE_OBFUSCATOR:="${CLICKHOUSE_BINARY}-obfuscator"} export CLICKHOUSE_CONFIG=${CLICKHOUSE_CONFIG:="/etc/clickhouse-server/config.xml"} export CLICKHOUSE_CONFIG_CLIENT=${CLICKHOUSE_CONFIG_CLIENT:="/etc/clickhouse-client/config.xml"} diff --git a/docker/test/performance-comparison/Dockerfile b/docker/test/performance-comparison/Dockerfile index 2710c386ac7..24ccb517b98 100644 --- a/docker/test/performance-comparison/Dockerfile +++ b/docker/test/performance-comparison/Dockerfile @@ -11,6 +11,7 @@ RUN apt-get update \ curl \ g++ \ git \ + libc6-dbg \ moreutils \ ncdu \ p7zip-full \ diff --git a/docker/test/performance-comparison/compare.sh b/docker/test/performance-comparison/compare.sh index 8271c2950eb..533a5963423 100755 --- a/docker/test/performance-comparison/compare.sh +++ b/docker/test/performance-comparison/compare.sh @@ -66,6 +66,7 @@ EOF 10000000 0 1 + 1 @@ -203,8 +204,11 @@ function get_profiles right/clickhouse client --port 9001 --query "set query_profiler_cpu_time_period_ns = 0" right/clickhouse client --port 9001 --query "set query_profiler_real_time_period_ns = 0" + left/clickhouse client --port 9001 --query "select * from system.query_log where type = 2 format TSVWithNamesAndTypes" > left-query-log.tsv ||: & left/clickhouse client --port 9001 --query "select * from system.trace_log format TSVWithNamesAndTypes" > left-trace-log.tsv ||: & left/clickhouse client --port 9001 --query "select arrayJoin(trace) addr, concat(splitByChar('/', addressToLine(addr))[-1], '#', demangle(addressToSymbol(addr)) ) name from system.trace_log group by addr format TSVWithNamesAndTypes" > left-addresses.tsv ||: & + + right/clickhouse client --port 9002 --query "select * from system.query_log where type = 2 format TSVWithNamesAndTypes" > right-query-log.tsv ||: & right/clickhouse client --port 9002 --query "select * from system.trace_log format TSVWithNamesAndTypes" > right-trace-log.tsv ||: & right/clickhouse client --port 9002 --query "select arrayJoin(trace) addr, concat(splitByChar('/', addressToLine(addr))[-1], '#', demangle(addressToSymbol(addr)) ) name from system.trace_log group by addr format TSVWithNamesAndTypes" > right-addresses.tsv ||: & @@ -214,8 +218,19 @@ function get_profiles # Analyze results function report { -result_structure="left float, right float, diff float, rd Array(float), query text" -rm test-times.tsv test-dump.tsv unstable.tsv changed-perf.tsv unstable-tests.tsv unstable-queries.tsv bad-tests.tsv slow-on-client.tsv all-queries.tsv ||: + +for x in *.tsv +do + # FIXME This loop builds column definitons from TSVWithNamesAndTypes in an + # absolutely atrocious way. This should be done by the file() function itself. + paste -d' ' \ + <(sed -n '1s/\t/\n/gp' "$x" | sed 's/\(^.*$\)/"\1"/') \ + <(sed -n '2s/\t/\n/gp' "$x" ) \ + | tr '\n' ', ' | sed 's/,$//' > "$x.columns" +done + +rm *.rep test-times.tsv test-dump.tsv unstable.tsv unstable-query-ids.tsv unstable-query-metrics.tsv changed-perf.tsv unstable-tests.tsv unstable-queries.tsv bad-tests.tsv slow-on-client.tsv all-queries.tsv ||: + right/clickhouse local --query " create table queries engine Memory as select replaceAll(_file, '-report.tsv', '') test, @@ -275,6 +290,48 @@ create table test_times_tsv engine File(TSV, 'test-times.tsv') as create table all_queries_tsv engine File(TSV, 'all-queries.tsv') as select left, right, diff, rd, test, query from queries order by rd[3] desc; + +create view right_query_log as select * + from file('right-query-log.tsv', TSVWithNamesAndTypes, '$(cat right-query-log.tsv.columns)'); + +create view right_trace_log as select * + from file('right-trace-log.tsv', TSVWithNamesAndTypes, '$(cat right-trace-log.tsv.columns)'); + +create view right_addresses as select * + from file('right-addresses.tsv', TSVWithNamesAndTypes, '$(cat right-addresses.tsv.columns)'); + +create table unstable_query_ids engine File(TSVWithNamesAndTypes, 'unstable-query-ids.rep') as + select query_id from right_query_log + join unstable_queries_tsv using query + ; + +create table unstable_query_metrics engine File(TSVWithNamesAndTypes, 'unstable-query-metrics.rep') as + select ProfileEvents.Values value, ProfileEvents.Names metric, query_id, query + from right_query_log array join ProfileEvents + where query_id in (unstable_query_ids) + ; + +create table unstable_query_traces engine File(TSVWithNamesAndTypes, 'unstable-query-traces.rep') as + select count() value, right_addresses.name metric, + unstable_query_ids.query_id, any(right_query_log.query) query + from unstable_query_ids + join right_query_log on right_query_log.query_id = unstable_query_ids.query_id + join right_trace_log on right_trace_log.query_id = unstable_query_ids.query_id + join right_addresses on addr = arrayJoin(trace) + group by unstable_query_ids.query_id, metric + order by count() desc + ; + +create table metric_devation engine File(TSVWithNamesAndTypes, 'metric-deviation.rep') as + select floor((q[3] - q[1])/q[2], 3) d, + quantilesExact(0.05, 0.5, 0.95)(value) q, metric, query + from (select * from unstable_query_metrics + union all select * from unstable_query_traces) + join queries using query + group by query, metric + having d > 0.5 + order by any(rd[3]) desc, d desc + ; " # Remember that grep sets error code when nothing is found, hence the bayan diff --git a/docker/test/performance-comparison/entrypoint.sh b/docker/test/performance-comparison/entrypoint.sh index 153daf205dd..31ca70f91ef 100755 --- a/docker/test/performance-comparison/entrypoint.sh +++ b/docker/test/performance-comparison/entrypoint.sh @@ -46,7 +46,7 @@ done export PYTHONIOENCODING=utf-8 # Use a default number of runs if not told otherwise -export CHPC_RUNS=${CHPC_RUNS:-15} +export CHPC_RUNS=${CHPC_RUNS:-17} # Even if we have some errors, try our best to save the logs. set +e @@ -57,5 +57,5 @@ set -m time ../compare.sh 0 $ref_sha $PR_TO_TEST $SHA_TO_TEST 2>&1 | ts "$(printf '%%Y-%%m-%%d %%H:%%M:%%S\t')" | tee compare.log set +m -7z a /output/output.7z *.log *.tsv *.html *.txt +7z a /output/output.7z *.log *.tsv *.html *.txt *.rep cp compare.log /output diff --git a/docs/en/getting_started/tutorial.md b/docs/en/getting_started/tutorial.md index b81f7787559..b4c446424d9 100644 --- a/docs/en/getting_started/tutorial.md +++ b/docs/en/getting_started/tutorial.md @@ -602,7 +602,7 @@ ZooKeeper is not a strict requirement: in some simple cases you can duplicate th ZooKeeper locations need to be specified in configuration file: ``` xml - + zoo01.yandex.ru 2181 @@ -615,7 +615,7 @@ ZooKeeper locations need to be specified in configuration file: zoo03.yandex.ru 2181 - + ``` Also we need to set macros for identifying each shard and replica, it will be used on table creation: diff --git a/docs/en/images/logo.svg b/docs/en/images/logo.svg index 70662da887e..865b96d98c7 100644 --- a/docs/en/images/logo.svg +++ b/docs/en/images/logo.svg @@ -1,12 +1 @@ - - - - - - - - - + \ No newline at end of file diff --git a/docs/fa/images/logo.svg b/docs/fa/images/logo.svg index 70662da887e..865b96d98c7 100644 --- a/docs/fa/images/logo.svg +++ b/docs/fa/images/logo.svg @@ -1,12 +1 @@ - - - - - - - - - + \ No newline at end of file diff --git a/docs/ja/images/logo.svg b/docs/ja/images/logo.svg index 70662da887e..865b96d98c7 100644 --- a/docs/ja/images/logo.svg +++ b/docs/ja/images/logo.svg @@ -1,12 +1 @@ - - - - - - - - - + \ No newline at end of file diff --git a/docs/ru/images/logo.svg b/docs/ru/images/logo.svg index 70662da887e..865b96d98c7 100644 --- a/docs/ru/images/logo.svg +++ b/docs/ru/images/logo.svg @@ -1,12 +1 @@ - - - - - - - - - + \ No newline at end of file diff --git a/docs/tools/mkdocs-material-theme/assets/flags/en.svg b/docs/tools/mkdocs-material-theme/assets/flags/en.svg index 7cabb5e9071..b1dab887bcf 100644 --- a/docs/tools/mkdocs-material-theme/assets/flags/en.svg +++ b/docs/tools/mkdocs-material-theme/assets/flags/en.svg @@ -1,10 +1 @@ - - - - - - - - - - + \ No newline at end of file diff --git a/docs/tools/mkdocs-material-theme/assets/flags/fa.svg b/docs/tools/mkdocs-material-theme/assets/flags/fa.svg index de467f133d9..35cd83dded2 100644 --- a/docs/tools/mkdocs-material-theme/assets/flags/fa.svg +++ b/docs/tools/mkdocs-material-theme/assets/flags/fa.svg @@ -1,31 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/docs/tools/mkdocs-material-theme/assets/flags/ja.svg b/docs/tools/mkdocs-material-theme/assets/flags/ja.svg index a666c272523..ad8286de8f8 100644 --- a/docs/tools/mkdocs-material-theme/assets/flags/ja.svg +++ b/docs/tools/mkdocs-material-theme/assets/flags/ja.svg @@ -1,8 +1 @@ - - - - - - - - + \ No newline at end of file diff --git a/docs/tools/mkdocs-material-theme/assets/flags/ru.svg b/docs/tools/mkdocs-material-theme/assets/flags/ru.svg index 76e92a1015e..1733cc42728 100644 --- a/docs/tools/mkdocs-material-theme/assets/flags/ru.svg +++ b/docs/tools/mkdocs-material-theme/assets/flags/ru.svg @@ -1,5 +1 @@ - - - - - + \ No newline at end of file diff --git a/docs/tools/mkdocs-material-theme/assets/flags/zh.svg b/docs/tools/mkdocs-material-theme/assets/flags/zh.svg index 7681b350400..903b1eca640 100644 --- a/docs/tools/mkdocs-material-theme/assets/flags/zh.svg +++ b/docs/tools/mkdocs-material-theme/assets/flags/zh.svg @@ -1,11 +1 @@ - - - - - - - - - - - + \ No newline at end of file diff --git a/docs/zh/images/logo.svg b/docs/zh/images/logo.svg index 70662da887e..865b96d98c7 100644 --- a/docs/zh/images/logo.svg +++ b/docs/zh/images/logo.svg @@ -1,12 +1 @@ - - - - - - - - - + \ No newline at end of file diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt deleted file mode 100644 index b5bcbd804be..00000000000 --- a/libs/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -if (NOT NO_WERROR) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") -endif () - -if (USE_DEBUG_HELPERS) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include ${CMAKE_CURRENT_SOURCE_DIR}/libcommon/include/common/iostream_debug_helpers.h") -endif () - -add_subdirectory (libcommon) -add_subdirectory (libloggers) -add_subdirectory (libdaemon) - -if (USE_INTERNAL_MEMCPY) - add_subdirectory (libmemcpy) -endif() - -if (USE_MYSQL) - add_subdirectory (libmysqlxx) -endif () - -if (USE_INTERNAL_CONSISTENT_HASHING_LIBRARY) - add_subdirectory (consistent-hashing) -endif () -add_subdirectory (consistent-hashing-sumbur) -add_subdirectory (libwidechar_width) diff --git a/libs/libcommon/CMakeLists.txt b/libs/libcommon/CMakeLists.txt deleted file mode 100644 index 765ab99bfee..00000000000 --- a/libs/libcommon/CMakeLists.txt +++ /dev/null @@ -1,128 +0,0 @@ -set (CONFIG_COMMON ${CMAKE_CURRENT_BINARY_DIR}/include/common/config_common.h) -configure_file (${CMAKE_CURRENT_SOURCE_DIR}/include/common/config_common.h.in ${CONFIG_COMMON}) - -add_library(apple_rt - src/apple_rt.cpp - include/port/clock.h -) -target_include_directories (apple_rt PUBLIC ${COMMON_INCLUDE_DIR}) -if (DEFINED APPLE_HAVE_CLOCK_GETTIME) - target_compile_definitions(apple_rt PUBLIC -DAPPLE_HAVE_CLOCK_GETTIME=${APPLE_HAVE_CLOCK_GETTIME}) -endif () - -set (COMMON_SRCS - src/argsToConfig.cpp - src/coverage.cpp - src/DateLUT.cpp - src/DateLUTImpl.cpp - src/demangle.cpp - src/getMemoryAmount.cpp - src/getThreadId.cpp - src/JSON.cpp - src/LineReader.cpp - src/mremap.cpp - src/phdr_cache.cpp - src/preciseExp10.c - src/setTerminalEcho.cpp - src/shift10.cpp - src/sleep.cpp - - include/common/constexpr_helpers.h - include/common/coverage.h - include/common/DateLUT.h - include/common/DateLUTImpl.h - include/common/DayNum.h - include/common/demangle.h - include/common/ErrorHandlers.h - include/common/find_symbols.h - include/common/getMemoryAmount.h - include/common/getThreadId.h - include/common/JSON.h - include/common/likely.h - include/common/LineReader.h - include/common/LocalDate.h - include/common/LocalDateTime.h - include/common/logger_useful.h - include/common/mremap.h - include/common/phdr_cache.h - include/common/preciseExp10.h - include/common/setTerminalEcho.h - include/common/shift10.h - include/common/SimpleCache.h - include/common/SimpleCache.h - include/common/sleep.h - include/common/strong_typedef.h - include/common/Types.h - - include/ext/bit_cast.h - include/ext/chrono_io.h - include/ext/collection_cast.h - include/ext/enumerate.h - include/ext/function_traits.h - include/ext/identity.h - include/ext/map.h - include/ext/push_back.h - include/ext/range.h - include/ext/scope_guard.h - include/ext/size.h - include/ext/unlock_guard.h -) - -if (ENABLE_REPLXX) - set (COMMON_SRCS - src/ReplxxLineReader.cpp - include/common/ReplxxLineReader.h - - ${COMMON_SRCS} - ) -endif () - -add_library (common - ${COMMON_SRCS} - ${CONFIG_COMMON}) - -if (USE_INTERNAL_MEMCPY) - set (MEMCPY_LIBRARIES memcpy) -endif () - -find_package (Threads) - -if(CCTZ_INCLUDE_DIR) - target_include_directories(common BEFORE PRIVATE ${CCTZ_INCLUDE_DIR}) -endif() - -target_include_directories (common PUBLIC ${COMMON_INCLUDE_DIR}) - -if (NOT USE_INTERNAL_BOOST_LIBRARY) - target_include_directories (common SYSTEM BEFORE PUBLIC ${Boost_INCLUDE_DIRS}) -endif () - -if(NOT USE_INTERNAL_POCO_LIBRARY) - target_include_directories (common SYSTEM BEFORE PUBLIC ${Poco_Foundation_INCLUDE_DIR}) -endif() - -if(CCTZ_LIBRARY) - target_link_libraries(common PRIVATE ${CCTZ_LIBRARY}) -endif() - -if (ENABLE_REPLXX) - target_link_libraries(common PUBLIC replxx) -endif () - -target_link_libraries (common - PUBLIC - ${Poco_Util_LIBRARY} - ${Poco_Foundation_LIBRARY} - ${CITYHASH_LIBRARIES} - PUBLIC - ${Boost_SYSTEM_LIBRARY} - PRIVATE - ${MEMCPY_LIBRARIES}) - -if (RT_LIBRARY) - target_link_libraries (common PRIVATE ${RT_LIBRARY}) -endif () - -if (ENABLE_TESTS) - add_subdirectory (src/tests) -endif () diff --git a/libs/libcommon/include/port/clock.h b/libs/libcommon/include/port/clock.h deleted file mode 100644 index 552d56ede0d..00000000000 --- a/libs/libcommon/include/port/clock.h +++ /dev/null @@ -1,49 +0,0 @@ -#pragma once -/** Allows to build on MacOS X - * - * Highly experimental, not recommended, disabled by default. - * - * To use, include this file with -include compiler parameter. - */ - -#include - -#ifdef __APPLE__ - -# if !defined(APPLE_HAVE_CLOCK_GETTIME) -# include -# if !defined(MAC_OS_X_VERSION_10_12) -# define MAC_OS_X_VERSION_10_12 101200 -# endif -# define APPLE_HAVE_CLOCK_GETTIME MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 -# endif - -# if !APPLE_HAVE_CLOCK_GETTIME || !defined(CLOCK_MONOTONIC) -/** - * MacOS X doesn't support different clock sources - * - * Mapping all of them to 0, except for - * CLOCK_THREAD_CPUTIME_ID, because there is a way - * to implement it using in-kernel stats about threads - */ -# if !defined(CLOCK_MONOTONIC) -# define CLOCK_MONOTONIC 0 -# endif -# if !defined(CLOCK_REALTIME) -# define CLOCK_REALTIME CLOCK_MONOTONIC -# endif -# if !defined(CLOCK_THREAD_CPUTIME_ID) -# define CLOCK_THREAD_CPUTIME_ID 3 -# endif - -typedef int clockid_t; -int clock_gettime(int clk_id, struct timespec* t); -# else - -# endif - -# if !defined(CLOCK_MONOTONIC_COARSE) -# define CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC -# endif - -#endif diff --git a/libs/libcommon/include/port/ssize_t.h b/libs/libcommon/include/port/ssize_t.h deleted file mode 100644 index 62199bbe1f0..00000000000 --- a/libs/libcommon/include/port/ssize_t.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#ifdef _MSC_VER - #include - typedef SSIZE_T ssize_t; -#else - #include -#endif diff --git a/libs/libcommon/include/port/unistd.h b/libs/libcommon/include/port/unistd.h deleted file mode 100644 index 2c08bd0bcd2..00000000000 --- a/libs/libcommon/include/port/unistd.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -// https://stackoverflow.com/questions/341817/is-there-a-replacement-for-unistd-h-for-windows-visual-c - -#ifdef _MSC_VER - #include -#else - #include -#endif - -#include "ssize_t.h" diff --git a/libs/libcommon/src/apple_rt.cpp b/libs/libcommon/src/apple_rt.cpp deleted file mode 100644 index cf260cce604..00000000000 --- a/libs/libcommon/src/apple_rt.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/** Allows to build on MacOS X - * - * Highly experimental, not recommended, disabled by default. - * - * To use, include this file with -include compiler parameter. - */ - -#include - -#ifdef __APPLE__ -#if !APPLE_HAVE_CLOCK_GETTIME - -#include -#include -#include -#include -#include -#include - - -int clock_gettime_thread(timespec *spec) { - thread_port_t thread = mach_thread_self(); - - mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT; - thread_basic_info_data_t info; - if (KERN_SUCCESS != thread_info(thread, THREAD_BASIC_INFO, reinterpret_cast(&info), &count)) - return -1; - - spec->tv_sec = info.user_time.seconds + info.system_time.seconds; - spec->tv_nsec = info.user_time.microseconds * 1000 + info.system_time.microseconds * 1000; - mach_port_deallocate(mach_task_self(), thread); - - return 0; -} - -int clock_gettime(int clk_id, struct timespec* t) { - if (clk_id == CLOCK_THREAD_CPUTIME_ID) - return clock_gettime_thread(t); - - struct timeval now; - int rv = gettimeofday(&now, NULL); - - if (rv) - return rv; - t->tv_sec = now.tv_sec; - t->tv_nsec = now.tv_usec * 1000; - - return 0; -} - -#endif -#endif diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index fcf56e82b52..44ff7d6e828 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -1,8 +1,3 @@ -if (NOT NO_WERROR) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") -endif () - if(MAKE_STATIC_LIBRARIES) set(MAX_LINKER_MEMORY 3500) else() diff --git a/utils/check-style/check-include b/utils/check-style/check-include index 1b1bf3d56e0..3ced75d19d5 100755 --- a/utils/check-style/check-include +++ b/utils/check-style/check-include @@ -45,13 +45,12 @@ inc="-I. \ -I./contrib/capnproto/c++/src \ -I./contrib/unixodbc/include \ -I./contrib/unixodbc-cmake/linux_x86_64 \ --I./libs/libmysqlxx/include \ --I./libs/libcommon/include \ --I${BUILD_DIR}/libs/libcommon/include \ --I./libs/libzkutil/include \ --I./libs/libdaemon/include \ --I./libs/consistent-hashing \ --I./libs/consistent-hashing-sumbur \ +-I./base/mysqlxx \ +-I./base \ +-I${BUILD_DIR}/base \ +-I./base/daemon \ +-I./base/consistent-hashing \ +-I./base/consistent-hashing-sumbur \ -I./contrib/libhdfs3/include \ -I./contrib/base64/include \ -I./contrib/protobuf/src \ @@ -65,7 +64,7 @@ inc="-I. \ if [ -z $1 ]; then cd ${ROOT_DIR=${CUR_DIR}../..} - find dbms libs utils \( -name *.h -and -not -name *.inl.h \) -print0 | xargs -0 -n1 sh $CUR_DIR`basename $0` + find base dbms utils \( -name *.h -and -not -name *.inl.h \) -print0 | xargs -0 -n1 sh $CUR_DIR`basename $0` else echo -n "$1 " echo -n `grep "#include" $1| wc -l` " " diff --git a/utils/check-style/check-style b/utils/check-style/check-style index deed481f043..6848b8510de 100755 --- a/utils/check-style/check-style +++ b/utils/check-style/check-style @@ -13,21 +13,22 @@ # and then to run formatter only for the specified files. ROOT_PATH=$(git rev-parse --show-toplevel) +EXCLUDE_DIRS='build/|integration/|widechar_width/|glibc-compatibility/|memcpy/|consistent-hashing' -find $ROOT_PATH/dbms -name '*.h' -or -name '*.cpp' | - grep -vP 'Compiler|build' | +find $ROOT_PATH/{dbms,base} -name '*.h' -or -name '*.cpp' 2>/dev/null | + grep -vP $EXCLUDE_DIRS | xargs grep $@ -P '((class|struct|namespace|enum|if|for|while|else|throw|switch).*|\)(\s*const)?(\s*override)?\s*)\{$|\s$|\t|^ {1,3}[^\* ]\S|\t|^\s*(if|else if|if constexpr|else if constexpr|for|while|catch|switch)\(|\( [^\s\\]|\S \)' | # a curly brace not in a new line, but not for the case of C++11 init or agg. initialization | trailing whitespace | number of ws not a multiple of 4, but not in the case of comment continuation | a tab character | missing whitespace after for/if/while... before opening brace | whitespaces inside braces grep -v -P '(//|:\s+\*|\$\(\()| \)"' # single-line comment | continuation of a multiline comment | a typical piece of embedded shell code | something like ending of raw string literal # // namespace comments are unneeded -find $ROOT_PATH/dbms -name '*.h' -or -name '*.cpp' | - grep -vP 'Compiler|build' | +find $ROOT_PATH/{dbms,base} -name '*.h' -or -name '*.cpp' 2>/dev/null | + grep -vP $EXCLUDE_DIRS | xargs grep $@ -P '}\s*//+\s*namespace\s*' # Broken symlinks -find -L $ROOT_PATH -type l | grep -v contrib && echo "^ Broken symlinks found" +find -L $ROOT_PATH -type l 2>/dev/null | grep -v contrib && echo "^ Broken symlinks found" # Double whitespaces -find $ROOT_PATH/dbms -name '*.h' -or -name '*.cpp' | while read i; do $ROOT_PATH/utils/check-style/double-whitespaces.pl < $i || echo -e "^ File $i contains double whitespaces\n"; done +find $ROOT_PATH/{dbms,base} -name '*.h' -or -name '*.cpp' 2>/dev/null | while read i; do $ROOT_PATH/utils/check-style/double-whitespaces.pl < $i || echo -e "^ File $i contains double whitespaces\n"; done diff --git a/utils/check-style/format.sh b/utils/check-style/format.sh index 0e7498fed03..4f8de342c8d 100755 --- a/utils/check-style/format.sh +++ b/utils/check-style/format.sh @@ -6,7 +6,7 @@ cd `readlink -f $(dirname $0)`/../.. clang_format=`bash -c "compgen -c clang-format | grep 'clang-format-[[:digit:]]' | sort --version-sort --reverse | head -n1"` if [ ! -z $clang_format ]; then - find dbms libs utils -name *.cpp -or -name *.h -exec $clang_format -i {} + ; + find base dbms utils -name *.cpp -or -name *.h -exec $clang_format -i {} + ; else echo clang-format missing. try to install: echo sudo apt install clang-format diff --git a/utils/iotest/iotest.cpp b/utils/iotest/iotest.cpp index 8c17163778e..ea7cd439838 100644 --- a/utils/iotest/iotest.cpp +++ b/utils/iotest/iotest.cpp @@ -1,21 +1,23 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include #include #include -#include -#include #include -#include +#include +#include + #include -#include +#include +#include +#include +#include + +#include +#include +#include +#include + namespace DB { diff --git a/utils/iotest/iotest_aio.cpp b/utils/iotest/iotest_aio.cpp index 038bc600ec6..800e605d62e 100644 --- a/utils/iotest/iotest_aio.cpp +++ b/utils/iotest/iotest_aio.cpp @@ -3,7 +3,7 @@ int main(int, char **) { return 0; } #else #include -#include +#include #include #include #include diff --git a/utils/iotest/iotest_nonblock.cpp b/utils/iotest/iotest_nonblock.cpp index 62871f6c162..3d6b8666043 100644 --- a/utils/iotest/iotest_nonblock.cpp +++ b/utils/iotest/iotest_nonblock.cpp @@ -1,24 +1,26 @@ -#include -#include -#include -#include -#include -#if !defined(__APPLE__) && !defined(__FreeBSD__) -#include -#endif -#include -#include -#include -#include -#include -#include #include +#include #include #include -#include -#include #include -#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#if defined (OS_LINUX) +# include +#endif + namespace DB { diff --git a/website/images/clickhouse-black.svg b/website/images/clickhouse-black.svg index 10c41aed68f..a0a607dc0b2 100644 --- a/website/images/clickhouse-black.svg +++ b/website/images/clickhouse-black.svg @@ -1 +1 @@ -ClickHouse \ No newline at end of file +ClickHouse \ No newline at end of file diff --git a/website/images/clickhouse-white.svg b/website/images/clickhouse-white.svg index 08ef457d8b2..2d4c795abe8 100644 --- a/website/images/clickhouse-white.svg +++ b/website/images/clickhouse-white.svg @@ -1 +1 @@ -ClickHouse white \ No newline at end of file +ClickHouse white \ No newline at end of file diff --git a/website/images/logo-400x240.png b/website/images/logo-400x240.png index bbce65bef84..9c39da97a87 100644 Binary files a/website/images/logo-400x240.png and b/website/images/logo-400x240.png differ diff --git a/website/images/logo.svg b/website/images/logo.svg index 70662da887e..865b96d98c7 100644 --- a/website/images/logo.svg +++ b/website/images/logo.svg @@ -1,12 +1 @@ - - - - - - - - - + \ No newline at end of file diff --git a/website/images/tutorial/2409f49d11fb4aa1b8b5ff34cf9ca75d.png b/website/images/tutorial/2409f49d11fb4aa1b8b5ff34cf9ca75d.png index 9bb274e3a9d..bdd48d619bd 100644 Binary files a/website/images/tutorial/2409f49d11fb4aa1b8b5ff34cf9ca75d.png and b/website/images/tutorial/2409f49d11fb4aa1b8b5ff34cf9ca75d.png differ diff --git a/website/images/tutorial/24956f1a2efc48d78212586958aa036c.png b/website/images/tutorial/24956f1a2efc48d78212586958aa036c.png index c5781d3b7bb..bedb478a1b7 100644 Binary files a/website/images/tutorial/24956f1a2efc48d78212586958aa036c.png and b/website/images/tutorial/24956f1a2efc48d78212586958aa036c.png differ diff --git a/website/images/tutorial/26b2c7aae21a4c76800cb1c7a33a374d.png b/website/images/tutorial/26b2c7aae21a4c76800cb1c7a33a374d.png index 47314aac2a8..097698838e2 100644 Binary files a/website/images/tutorial/26b2c7aae21a4c76800cb1c7a33a374d.png and b/website/images/tutorial/26b2c7aae21a4c76800cb1c7a33a374d.png differ diff --git a/website/images/tutorial/49c332e3d93146ba8f46beef6b2b02b0.png b/website/images/tutorial/49c332e3d93146ba8f46beef6b2b02b0.png index 7b4b0d8fefa..64d13226766 100644 Binary files a/website/images/tutorial/49c332e3d93146ba8f46beef6b2b02b0.png and b/website/images/tutorial/49c332e3d93146ba8f46beef6b2b02b0.png differ diff --git a/website/images/tutorial/7b3c2e685832439b8c373bf2015131d2.png b/website/images/tutorial/7b3c2e685832439b8c373bf2015131d2.png index b5bc1a10fe4..72c665c1574 100644 Binary files a/website/images/tutorial/7b3c2e685832439b8c373bf2015131d2.png and b/website/images/tutorial/7b3c2e685832439b8c373bf2015131d2.png differ diff --git a/website/images/tutorial/885e507930e34b7c8f788d25e7ca2bcf.png b/website/images/tutorial/885e507930e34b7c8f788d25e7ca2bcf.png index ed9e04e1dca..949e98d377c 100644 Binary files a/website/images/tutorial/885e507930e34b7c8f788d25e7ca2bcf.png and b/website/images/tutorial/885e507930e34b7c8f788d25e7ca2bcf.png differ diff --git a/website/images/tutorial/a8518a200d6d405a95ee80ea1c8e1c90.png b/website/images/tutorial/a8518a200d6d405a95ee80ea1c8e1c90.png index 72022c85d28..011056d71cb 100644 Binary files a/website/images/tutorial/a8518a200d6d405a95ee80ea1c8e1c90.png and b/website/images/tutorial/a8518a200d6d405a95ee80ea1c8e1c90.png differ diff --git a/website/images/tutorial/ac292656d03946d0aba35c75783a31f2.png b/website/images/tutorial/ac292656d03946d0aba35c75783a31f2.png index e3f2268e6f8..bab7983420c 100644 Binary files a/website/images/tutorial/ac292656d03946d0aba35c75783a31f2.png and b/website/images/tutorial/ac292656d03946d0aba35c75783a31f2.png differ diff --git a/website/images/tutorial/d3578db55e304bd7b5eba818abdb53f5.png b/website/images/tutorial/d3578db55e304bd7b5eba818abdb53f5.png index c749ae56fbc..a4438c56113 100644 Binary files a/website/images/tutorial/d3578db55e304bd7b5eba818abdb53f5.png and b/website/images/tutorial/d3578db55e304bd7b5eba818abdb53f5.png differ diff --git a/website/images/tutorial/ece020129fdf4a18a6e75daf2e699cb9.png b/website/images/tutorial/ece020129fdf4a18a6e75daf2e699cb9.png index 4f27588a134..fb7ee33a42b 100644 Binary files a/website/images/tutorial/ece020129fdf4a18a6e75daf2e699cb9.png and b/website/images/tutorial/ece020129fdf4a18a6e75daf2e699cb9.png differ diff --git a/website/images/tutorial/ef4141f348234773a5349c4bd3e8f804.png b/website/images/tutorial/ef4141f348234773a5349c4bd3e8f804.png index 65d505fb4c3..5030f9c7f6b 100644 Binary files a/website/images/tutorial/ef4141f348234773a5349c4bd3e8f804.png and b/website/images/tutorial/ef4141f348234773a5349c4bd3e8f804.png differ diff --git a/website/images/tutorial/f3132f4d1c0d42eab26d9111afe7771a.png b/website/images/tutorial/f3132f4d1c0d42eab26d9111afe7771a.png index 9b937811a5d..cdcc8e2097c 100644 Binary files a/website/images/tutorial/f3132f4d1c0d42eab26d9111afe7771a.png and b/website/images/tutorial/f3132f4d1c0d42eab26d9111afe7771a.png differ diff --git a/website/images/yandex-black-button.png b/website/images/yandex-black-button.png index 1f4f1a3fa08..b6022bf1610 100644 Binary files a/website/images/yandex-black-button.png and b/website/images/yandex-black-button.png differ diff --git a/website/images/yandex-white-button.png b/website/images/yandex-white-button.png index 6f134cad733..31bae8ebb8e 100644 Binary files a/website/images/yandex-white-button.png and b/website/images/yandex-white-button.png differ