diff options
author | Daniil Cherednik <dan.cherednik@gmail.com> | 2023-06-02 18:26:46 +0300 |
---|---|---|
committer | Daniil Cherednik <dan.cherednik@gmail.com> | 2023-06-02 18:32:58 +0300 |
commit | 7e7de263d4acbc6eacf92b618bcb5f9049bccc9b (patch) | |
tree | d25ff63925cbcc5e0f80fe4d1514b4cb48a9f686 | |
parent | 10ba5cc0c3d130ce4b33d307d265b937dd572c39 (diff) | |
download | ydb-7e7de263d4acbc6eacf92b618bcb5f9049bccc9b.tar.gz |
add library/cpp/actors to github export
x-stable-origin-commit: 0e951cfb44430a0ed33bec779c8a790f73c31b91
95 files changed, 3049 insertions, 3 deletions
diff --git a/CMakeLists.darwin.txt b/CMakeLists.darwin.txt index cd6d87e652..5873a8f978 100644 --- a/CMakeLists.darwin.txt +++ b/CMakeLists.darwin.txt @@ -10,5 +10,5 @@ add_subdirectory(tools) add_subdirectory(contrib) add_subdirectory(util) add_subdirectory(library) -add_subdirectory(ydb) add_subdirectory(certs) +add_subdirectory(ydb) diff --git a/CMakeLists.linux-aarch64.txt b/CMakeLists.linux-aarch64.txt index cd6d87e652..5873a8f978 100644 --- a/CMakeLists.linux-aarch64.txt +++ b/CMakeLists.linux-aarch64.txt @@ -10,5 +10,5 @@ add_subdirectory(tools) add_subdirectory(contrib) add_subdirectory(util) add_subdirectory(library) -add_subdirectory(ydb) add_subdirectory(certs) +add_subdirectory(ydb) diff --git a/CMakeLists.linux.txt b/CMakeLists.linux.txt index cd6d87e652..5873a8f978 100644 --- a/CMakeLists.linux.txt +++ b/CMakeLists.linux.txt @@ -10,5 +10,5 @@ add_subdirectory(tools) add_subdirectory(contrib) add_subdirectory(util) add_subdirectory(library) -add_subdirectory(ydb) add_subdirectory(certs) +add_subdirectory(ydb) diff --git a/library/cpp/actors/CMakeLists.txt b/library/cpp/actors/CMakeLists.txt index b19b18f7a9..a136ca2bf9 100644 --- a/library/cpp/actors/CMakeLists.txt +++ b/library/cpp/actors/CMakeLists.txt @@ -9,9 +9,11 @@ add_subdirectory(core) add_subdirectory(dnscachelib) add_subdirectory(dnsresolver) +add_subdirectory(examples) add_subdirectory(helpers) add_subdirectory(http) add_subdirectory(interconnect) +add_subdirectory(log_backend) add_subdirectory(memory_log) add_subdirectory(prof) add_subdirectory(protos) diff --git a/library/cpp/actors/core/CMakeLists.darwin.txt b/library/cpp/actors/core/CMakeLists.darwin.txt index 7bbf9297c2..19e76f65ee 100644 --- a/library/cpp/actors/core/CMakeLists.darwin.txt +++ b/library/cpp/actors/core/CMakeLists.darwin.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(ut) add_library(cpp-actors-core) target_link_libraries(cpp-actors-core PUBLIC diff --git a/library/cpp/actors/core/CMakeLists.linux-aarch64.txt b/library/cpp/actors/core/CMakeLists.linux-aarch64.txt index 54c3427d28..c12e12d15f 100644 --- a/library/cpp/actors/core/CMakeLists.linux-aarch64.txt +++ b/library/cpp/actors/core/CMakeLists.linux-aarch64.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(ut) add_library(cpp-actors-core) target_link_libraries(cpp-actors-core PUBLIC diff --git a/library/cpp/actors/core/CMakeLists.linux.txt b/library/cpp/actors/core/CMakeLists.linux.txt index 54c3427d28..c12e12d15f 100644 --- a/library/cpp/actors/core/CMakeLists.linux.txt +++ b/library/cpp/actors/core/CMakeLists.linux.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(ut) add_library(cpp-actors-core) target_link_libraries(cpp-actors-core PUBLIC diff --git a/library/cpp/actors/core/ut/CMakeLists.darwin.txt b/library/cpp/actors/core/ut/CMakeLists.darwin.txt new file mode 100644 index 0000000000..b5b88433b5 --- /dev/null +++ b/library/cpp/actors/core/ut/CMakeLists.darwin.txt @@ -0,0 +1,57 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-core-ut) +target_include_directories(library-cpp-actors-core-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core +) +target_link_libraries(library-cpp-actors-core-ut PUBLIC + contrib-libs-cxxsupp + yutil + library-cpp-cpuid_check + cpp-testing-unittest_main + cpp-actors-core + cpp-actors-interconnect + cpp-actors-testlib +) +target_link_options(library-cpp-actors-core-ut PRIVATE + -Wl,-no_deduplicate + -Wl,-sdk_version,10.15 + -fPIC + -fPIC + -framework + CoreFoundation +) +target_sources(library-cpp-actors-core-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/actor_coroutine_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/actor_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/actorsystem_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/performance_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/ask_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/balancer_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/event_pb_payload_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/event_pb_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/executor_pool_basic_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/executor_pool_united_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/log_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/mon_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/scheduler_actor_ut.cpp +) +add_test( + NAME + library-cpp-actors-core-ut + COMMAND + library-cpp-actors-core-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-core-ut) diff --git a/library/cpp/actors/core/ut/CMakeLists.linux-aarch64.txt b/library/cpp/actors/core/ut/CMakeLists.linux-aarch64.txt new file mode 100644 index 0000000000..a7e146d294 --- /dev/null +++ b/library/cpp/actors/core/ut/CMakeLists.linux-aarch64.txt @@ -0,0 +1,60 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-core-ut) +target_include_directories(library-cpp-actors-core-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core +) +target_link_libraries(library-cpp-actors-core-ut PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + library-cpp-lfalloc + cpp-testing-unittest_main + cpp-actors-core + cpp-actors-interconnect + cpp-actors-testlib +) +target_link_options(library-cpp-actors-core-ut PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(library-cpp-actors-core-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/actor_coroutine_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/actor_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/actorsystem_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/performance_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/ask_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/balancer_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/event_pb_payload_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/event_pb_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/executor_pool_basic_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/executor_pool_united_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/log_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/mon_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/scheduler_actor_ut.cpp +) +add_test( + NAME + library-cpp-actors-core-ut + COMMAND + library-cpp-actors-core-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-core-ut) diff --git a/library/cpp/actors/core/ut/CMakeLists.linux.txt b/library/cpp/actors/core/ut/CMakeLists.linux.txt new file mode 100644 index 0000000000..12dd79e38a --- /dev/null +++ b/library/cpp/actors/core/ut/CMakeLists.linux.txt @@ -0,0 +1,62 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-core-ut) +target_include_directories(library-cpp-actors-core-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core +) +target_link_libraries(library-cpp-actors-core-ut PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + cpp-malloc-tcmalloc + libs-tcmalloc-no_percpu_cache + library-cpp-cpuid_check + cpp-testing-unittest_main + cpp-actors-core + cpp-actors-interconnect + cpp-actors-testlib +) +target_link_options(library-cpp-actors-core-ut PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(library-cpp-actors-core-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/actor_coroutine_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/actor_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/actorsystem_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/performance_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/ask_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/balancer_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/event_pb_payload_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/event_pb_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/executor_pool_basic_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/executor_pool_united_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/log_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/mon_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/core/scheduler_actor_ut.cpp +) +add_test( + NAME + library-cpp-actors-core-ut + COMMAND + library-cpp-actors-core-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-core-ut) diff --git a/library/cpp/actors/core/ut/CMakeLists.txt b/library/cpp/actors/core/ut/CMakeLists.txt new file mode 100644 index 0000000000..3e0811fb22 --- /dev/null +++ b/library/cpp/actors/core/ut/CMakeLists.txt @@ -0,0 +1,15 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux-aarch64.txt) +elseif (APPLE) + include(CMakeLists.darwin.txt) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux.txt) +endif() diff --git a/library/cpp/actors/dnsresolver/CMakeLists.darwin.txt b/library/cpp/actors/dnsresolver/CMakeLists.darwin.txt index f4a0909db2..e3c3852edf 100644 --- a/library/cpp/actors/dnsresolver/CMakeLists.darwin.txt +++ b/library/cpp/actors/dnsresolver/CMakeLists.darwin.txt @@ -7,6 +7,7 @@ find_package(c-ares REQUIRED) +add_subdirectory(ut) add_library(cpp-actors-dnsresolver) target_include_directories(cpp-actors-dnsresolver PRIVATE diff --git a/library/cpp/actors/dnsresolver/CMakeLists.linux-aarch64.txt b/library/cpp/actors/dnsresolver/CMakeLists.linux-aarch64.txt index 7e622c1693..746f221a05 100644 --- a/library/cpp/actors/dnsresolver/CMakeLists.linux-aarch64.txt +++ b/library/cpp/actors/dnsresolver/CMakeLists.linux-aarch64.txt @@ -7,6 +7,7 @@ find_package(c-ares REQUIRED) +add_subdirectory(ut) add_library(cpp-actors-dnsresolver) target_include_directories(cpp-actors-dnsresolver PRIVATE diff --git a/library/cpp/actors/dnsresolver/CMakeLists.linux.txt b/library/cpp/actors/dnsresolver/CMakeLists.linux.txt index 7e622c1693..746f221a05 100644 --- a/library/cpp/actors/dnsresolver/CMakeLists.linux.txt +++ b/library/cpp/actors/dnsresolver/CMakeLists.linux.txt @@ -7,6 +7,7 @@ find_package(c-ares REQUIRED) +add_subdirectory(ut) add_library(cpp-actors-dnsresolver) target_include_directories(cpp-actors-dnsresolver PRIVATE diff --git a/library/cpp/actors/dnsresolver/ut/CMakeLists.darwin.txt b/library/cpp/actors/dnsresolver/ut/CMakeLists.darwin.txt new file mode 100644 index 0000000000..5c4c5e2c7a --- /dev/null +++ b/library/cpp/actors/dnsresolver/ut/CMakeLists.darwin.txt @@ -0,0 +1,47 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-dnsresolver-ut) +target_include_directories(library-cpp-actors-dnsresolver-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/dnsresolver + ${CMAKE_SOURCE_DIR}/contrib/libs/c-ares/include +) +target_link_libraries(library-cpp-actors-dnsresolver-ut PUBLIC + contrib-libs-cxxsupp + yutil + library-cpp-cpuid_check + cpp-testing-unittest_main + cpp-actors-dnsresolver + cpp-actors-testlib +) +target_link_options(library-cpp-actors-dnsresolver-ut PRIVATE + -Wl,-no_deduplicate + -Wl,-sdk_version,10.15 + -fPIC + -fPIC + -framework + CoreFoundation +) +target_sources(library-cpp-actors-dnsresolver-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/dnsresolver/dnsresolver_caching_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/dnsresolver/dnsresolver_ondemand_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/dnsresolver/dnsresolver_ut.cpp +) +add_test( + NAME + library-cpp-actors-dnsresolver-ut + COMMAND + library-cpp-actors-dnsresolver-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-dnsresolver-ut) diff --git a/library/cpp/actors/dnsresolver/ut/CMakeLists.linux-aarch64.txt b/library/cpp/actors/dnsresolver/ut/CMakeLists.linux-aarch64.txt new file mode 100644 index 0000000000..54180a8a80 --- /dev/null +++ b/library/cpp/actors/dnsresolver/ut/CMakeLists.linux-aarch64.txt @@ -0,0 +1,50 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-dnsresolver-ut) +target_include_directories(library-cpp-actors-dnsresolver-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/dnsresolver + ${CMAKE_SOURCE_DIR}/contrib/libs/c-ares/include +) +target_link_libraries(library-cpp-actors-dnsresolver-ut PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + library-cpp-lfalloc + cpp-testing-unittest_main + cpp-actors-dnsresolver + cpp-actors-testlib +) +target_link_options(library-cpp-actors-dnsresolver-ut PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(library-cpp-actors-dnsresolver-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/dnsresolver/dnsresolver_caching_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/dnsresolver/dnsresolver_ondemand_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/dnsresolver/dnsresolver_ut.cpp +) +add_test( + NAME + library-cpp-actors-dnsresolver-ut + COMMAND + library-cpp-actors-dnsresolver-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-dnsresolver-ut) diff --git a/library/cpp/actors/dnsresolver/ut/CMakeLists.linux.txt b/library/cpp/actors/dnsresolver/ut/CMakeLists.linux.txt new file mode 100644 index 0000000000..2a2a18bfd2 --- /dev/null +++ b/library/cpp/actors/dnsresolver/ut/CMakeLists.linux.txt @@ -0,0 +1,52 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-dnsresolver-ut) +target_include_directories(library-cpp-actors-dnsresolver-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/dnsresolver + ${CMAKE_SOURCE_DIR}/contrib/libs/c-ares/include +) +target_link_libraries(library-cpp-actors-dnsresolver-ut PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + cpp-malloc-tcmalloc + libs-tcmalloc-no_percpu_cache + library-cpp-cpuid_check + cpp-testing-unittest_main + cpp-actors-dnsresolver + cpp-actors-testlib +) +target_link_options(library-cpp-actors-dnsresolver-ut PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(library-cpp-actors-dnsresolver-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/dnsresolver/dnsresolver_caching_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/dnsresolver/dnsresolver_ondemand_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/dnsresolver/dnsresolver_ut.cpp +) +add_test( + NAME + library-cpp-actors-dnsresolver-ut + COMMAND + library-cpp-actors-dnsresolver-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-dnsresolver-ut) diff --git a/library/cpp/actors/dnsresolver/ut/CMakeLists.txt b/library/cpp/actors/dnsresolver/ut/CMakeLists.txt new file mode 100644 index 0000000000..3e0811fb22 --- /dev/null +++ b/library/cpp/actors/dnsresolver/ut/CMakeLists.txt @@ -0,0 +1,15 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux-aarch64.txt) +elseif (APPLE) + include(CMakeLists.darwin.txt) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux.txt) +endif() diff --git a/library/cpp/actors/examples/01_ping_pong/CMakeLists.darwin.txt b/library/cpp/actors/examples/01_ping_pong/CMakeLists.darwin.txt new file mode 100644 index 0000000000..976336a931 --- /dev/null +++ b/library/cpp/actors/examples/01_ping_pong/CMakeLists.darwin.txt @@ -0,0 +1,29 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(example_01_ping_pong) +target_link_libraries(example_01_ping_pong PUBLIC + contrib-libs-cxxsupp + yutil + library-cpp-lfalloc + library-cpp-cpuid_check + cpp-actors-core +) +target_link_options(example_01_ping_pong PRIVATE + -Wl,-no_deduplicate + -Wl,-sdk_version,10.15 + -fPIC + -fPIC + -framework + CoreFoundation +) +target_sources(example_01_ping_pong PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/examples/01_ping_pong/main.cpp +) +vcs_info(example_01_ping_pong) diff --git a/library/cpp/actors/examples/01_ping_pong/CMakeLists.linux-aarch64.txt b/library/cpp/actors/examples/01_ping_pong/CMakeLists.linux-aarch64.txt new file mode 100644 index 0000000000..eefbbcfc99 --- /dev/null +++ b/library/cpp/actors/examples/01_ping_pong/CMakeLists.linux-aarch64.txt @@ -0,0 +1,31 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(example_01_ping_pong) +target_link_libraries(example_01_ping_pong PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + library-cpp-lfalloc + cpp-actors-core +) +target_link_options(example_01_ping_pong PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(example_01_ping_pong PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/examples/01_ping_pong/main.cpp +) +vcs_info(example_01_ping_pong) diff --git a/library/cpp/actors/examples/01_ping_pong/CMakeLists.linux.txt b/library/cpp/actors/examples/01_ping_pong/CMakeLists.linux.txt new file mode 100644 index 0000000000..54c6d44eb3 --- /dev/null +++ b/library/cpp/actors/examples/01_ping_pong/CMakeLists.linux.txt @@ -0,0 +1,32 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(example_01_ping_pong) +target_link_libraries(example_01_ping_pong PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + library-cpp-lfalloc + library-cpp-cpuid_check + cpp-actors-core +) +target_link_options(example_01_ping_pong PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(example_01_ping_pong PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/examples/01_ping_pong/main.cpp +) +vcs_info(example_01_ping_pong) diff --git a/library/cpp/actors/examples/01_ping_pong/CMakeLists.txt b/library/cpp/actors/examples/01_ping_pong/CMakeLists.txt new file mode 100644 index 0000000000..3e0811fb22 --- /dev/null +++ b/library/cpp/actors/examples/01_ping_pong/CMakeLists.txt @@ -0,0 +1,15 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux-aarch64.txt) +elseif (APPLE) + include(CMakeLists.darwin.txt) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux.txt) +endif() diff --git a/library/cpp/actors/examples/01_ping_pong/main.cpp b/library/cpp/actors/examples/01_ping_pong/main.cpp new file mode 100644 index 0000000000..ccb73f7d45 --- /dev/null +++ b/library/cpp/actors/examples/01_ping_pong/main.cpp @@ -0,0 +1,131 @@ +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/scheduler_basic.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/util/should_continue.h> +#include <util/system/sigset.h> +#include <util/generic/xrange.h> + +using namespace NActors; + +static TProgramShouldContinue ShouldContinue; + +void OnTerminate(int) { + ShouldContinue.ShouldStop(); +} + +class TPingActor : public TActorBootstrapped<TPingActor> { + const TActorId Target; + ui64 HandledEvents; + TInstant PeriodStart; + + void Handle(TEvents::TEvPing::TPtr &ev) { + Send(ev->Sender, new TEvents::TEvPong()); + Send(ev->Sender, new TEvents::TEvPing()); + Become(&TThis::StatePing); + } + + void Handle(TEvents::TEvPong::TPtr &ev) { + Y_UNUSED(ev); + Become(&TThis::StateWait); + } + + void PrintStats() { + const i64 ms = (TInstant::Now() - PeriodStart).MilliSeconds(); + Cout << "Handled " << 2 * HandledEvents << " over " << ms << "ms" << Endl; + ScheduleStats(); + } + + void ScheduleStats() { + HandledEvents = 0; + PeriodStart = TInstant::Now(); + Schedule(TDuration::Seconds(1), new TEvents::TEvWakeup()); + } + +public: + TPingActor(TActorId target) + : Target(target) + , HandledEvents(0) + , PeriodStart(TInstant::Now()) + {} + + STFUNC(StateWait) { + Y_UNUSED(ctx); + switch (ev->GetTypeRewrite()) { + hFunc(TEvents::TEvPing, Handle); + cFunc(TEvents::TEvWakeup::EventType, PrintStats); + } + + ++HandledEvents; + } + + STFUNC(StatePing) { + Y_UNUSED(ctx); + switch (ev->GetTypeRewrite()) { + hFunc(TEvents::TEvPong, Handle); + cFunc(TEvents::TEvWakeup::EventType, PrintStats); + } + + ++HandledEvents; + } + + void Bootstrap() { + if (Target) { + Become(&TThis::StatePing); + Send(Target, new TEvents::TEvPing()); + ScheduleStats(); + } + else { + Become(&TThis::StateWait); + }; + } +}; + +THolder<TActorSystemSetup> BuildActorSystemSetup(ui32 threads, ui32 pools) { + Y_VERIFY(threads > 0 && threads < 100); + Y_VERIFY(pools > 0 && pools < 10); + + auto setup = MakeHolder<TActorSystemSetup>(); + + setup->NodeId = 1; + + setup->ExecutorsCount = pools; + setup->Executors.Reset(new TAutoPtr<IExecutorPool>[pools]); + for (ui32 idx : xrange(pools)) { + setup->Executors[idx] = new TBasicExecutorPool(idx, threads, 50); + } + + setup->Scheduler = new TBasicSchedulerThread(TSchedulerConfig(512, 0)); + + return setup; +} + +int main(int argc, char **argv) { + Y_UNUSED(argc); + Y_UNUSED(argv); + +#ifdef _unix_ + signal(SIGPIPE, SIG_IGN); +#endif + signal(SIGINT, &OnTerminate); + signal(SIGTERM, &OnTerminate); + + THolder<TActorSystemSetup> actorSystemSetup = BuildActorSystemSetup(2, 1); + TActorSystem actorSystem(actorSystemSetup); + + actorSystem.Start(); + + const TActorId a = actorSystem.Register(new TPingActor(TActorId())); + const TActorId b = actorSystem.Register(new TPingActor(a)); + Y_UNUSED(b); + + while (ShouldContinue.PollState() == TProgramShouldContinue::Continue) { + Sleep(TDuration::MilliSeconds(200)); + } + + actorSystem.Stop(); + actorSystem.Cleanup(); + + return ShouldContinue.GetReturnCode(); +} diff --git a/library/cpp/actors/examples/02_discovery/CMakeLists.darwin.txt b/library/cpp/actors/examples/02_discovery/CMakeLists.darwin.txt new file mode 100644 index 0000000000..2eaa6534d8 --- /dev/null +++ b/library/cpp/actors/examples/02_discovery/CMakeLists.darwin.txt @@ -0,0 +1,53 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(example_02_discovery) +target_link_libraries(example_02_discovery PUBLIC + contrib-libs-cxxsupp + yutil + library-cpp-lfalloc + library-cpp-cpuid_check + cpp-actors-core + cpp-actors-dnsresolver + cpp-actors-interconnect + cpp-actors-http + contrib-libs-protobuf +) +target_link_options(example_02_discovery PRIVATE + -Wl,-no_deduplicate + -Wl,-sdk_version,10.15 + -fPIC + -fPIC + -framework + CoreFoundation +) +target_proto_messages(example_02_discovery PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/examples/02_discovery/protocol.proto +) +target_sources(example_02_discovery PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/examples/02_discovery/endpoint.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/examples/02_discovery/lookup.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/examples/02_discovery/main.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/examples/02_discovery/publish.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/examples/02_discovery/replica.cpp +) +target_proto_addincls(example_02_discovery + ./ + ${CMAKE_SOURCE_DIR}/ + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src +) +target_proto_outs(example_02_discovery + --cpp_out=${CMAKE_BINARY_DIR}/ + --cpp_styleguide_out=${CMAKE_BINARY_DIR}/ +) +vcs_info(example_02_discovery) diff --git a/library/cpp/actors/examples/02_discovery/CMakeLists.linux-aarch64.txt b/library/cpp/actors/examples/02_discovery/CMakeLists.linux-aarch64.txt new file mode 100644 index 0000000000..1883d9ddad --- /dev/null +++ b/library/cpp/actors/examples/02_discovery/CMakeLists.linux-aarch64.txt @@ -0,0 +1,55 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(example_02_discovery) +target_link_libraries(example_02_discovery PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + library-cpp-lfalloc + cpp-actors-core + cpp-actors-dnsresolver + cpp-actors-interconnect + cpp-actors-http + contrib-libs-protobuf +) +target_link_options(example_02_discovery PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_proto_messages(example_02_discovery PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/examples/02_discovery/protocol.proto +) +target_sources(example_02_discovery PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/examples/02_discovery/endpoint.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/examples/02_discovery/lookup.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/examples/02_discovery/main.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/examples/02_discovery/publish.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/examples/02_discovery/replica.cpp +) +target_proto_addincls(example_02_discovery + ./ + ${CMAKE_SOURCE_DIR}/ + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src +) +target_proto_outs(example_02_discovery + --cpp_out=${CMAKE_BINARY_DIR}/ + --cpp_styleguide_out=${CMAKE_BINARY_DIR}/ +) +vcs_info(example_02_discovery) diff --git a/library/cpp/actors/examples/02_discovery/CMakeLists.linux.txt b/library/cpp/actors/examples/02_discovery/CMakeLists.linux.txt new file mode 100644 index 0000000000..855362b4ab --- /dev/null +++ b/library/cpp/actors/examples/02_discovery/CMakeLists.linux.txt @@ -0,0 +1,56 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(example_02_discovery) +target_link_libraries(example_02_discovery PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + library-cpp-lfalloc + library-cpp-cpuid_check + cpp-actors-core + cpp-actors-dnsresolver + cpp-actors-interconnect + cpp-actors-http + contrib-libs-protobuf +) +target_link_options(example_02_discovery PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_proto_messages(example_02_discovery PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/examples/02_discovery/protocol.proto +) +target_sources(example_02_discovery PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/examples/02_discovery/endpoint.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/examples/02_discovery/lookup.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/examples/02_discovery/main.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/examples/02_discovery/publish.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/examples/02_discovery/replica.cpp +) +target_proto_addincls(example_02_discovery + ./ + ${CMAKE_SOURCE_DIR}/ + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src +) +target_proto_outs(example_02_discovery + --cpp_out=${CMAKE_BINARY_DIR}/ + --cpp_styleguide_out=${CMAKE_BINARY_DIR}/ +) +vcs_info(example_02_discovery) diff --git a/library/cpp/actors/examples/02_discovery/CMakeLists.txt b/library/cpp/actors/examples/02_discovery/CMakeLists.txt new file mode 100644 index 0000000000..3e0811fb22 --- /dev/null +++ b/library/cpp/actors/examples/02_discovery/CMakeLists.txt @@ -0,0 +1,15 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux-aarch64.txt) +elseif (APPLE) + include(CMakeLists.darwin.txt) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux.txt) +endif() diff --git a/library/cpp/actors/examples/02_discovery/endpoint.cpp b/library/cpp/actors/examples/02_discovery/endpoint.cpp new file mode 100644 index 0000000000..97780e8b4c --- /dev/null +++ b/library/cpp/actors/examples/02_discovery/endpoint.cpp @@ -0,0 +1,118 @@ +#include "services.h" + +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <library/cpp/actors/protos/services_common.pb.h> + +#include <library/cpp/actors/http/http.h> +#include <library/cpp/actors/http/http_proxy.h> + +#include <util/system/hostname.h> +#include <util/string/builder.h> + +class TExampleHttpRequest : public TActor<TExampleHttpRequest> { + TIntrusivePtr<TExampleStorageConfig> Config; + const TString PublishKey; + + TActorId HttpProxy; + NHttp::THttpIncomingRequestPtr Request; + + void Handle(NHttp::TEvHttpProxy::TEvHttpIncomingRequest::TPtr &ev) { + Request = std::move(ev->Get()->Request); + HttpProxy = ev->Sender; + + Register(CreateLookupActor(Config.Get(), PublishKey, SelfId())); + } + + void Handle(TEvExample::TEvInfo::TPtr &ev) { + auto *msg = ev->Get(); + + TStringBuilder body; + for (const auto &x : msg->Payloads) + body << x << Endl; + + auto response = Request->CreateResponseOK(body, "application/text; charset=utf-8"); + Send(HttpProxy, new NHttp::TEvHttpProxy::TEvHttpOutgoingResponse(response)); + + PassAway(); + } +public: + static constexpr IActor::EActivityType ActorActivityType() { + // define app-specific activity tag to track elapsed cpu | handled events | actor count in Solomon + return EActorActivity::ACTORLIB_COMMON; + } + + TExampleHttpRequest(TExampleStorageConfig *config, const TString &publishKey) + : TActor(&TThis::StateWork) + , Config(config) + , PublishKey(publishKey) + {} + + STFUNC(StateWork) { + Y_UNUSED(ctx); + switch (ev->GetTypeRewrite()) { + hFunc(NHttp::TEvHttpProxy::TEvHttpIncomingRequest, Handle); + hFunc(TEvExample::TEvInfo, Handle); + } + } +}; + +class TExampleHttpEndpoint : public TActorBootstrapped<TExampleHttpEndpoint> { + TIntrusivePtr<TExampleStorageConfig> Config; + const TString PublishKey; + const ui16 HttpPort; + + TActorId PublishActor; + TActorId HttpProxy; + + std::shared_ptr<NMonitoring::TMetricRegistry> SensorsRegistry = std::make_shared<NMonitoring::TMetricRegistry>(); + + void PassAway() override { + Send(PublishActor, new TEvents::TEvPoison()); + Send(HttpProxy, new TEvents::TEvPoison()); + + return TActor::PassAway(); + } + + void Handle(NHttp::TEvHttpProxy::TEvHttpIncomingRequest::TPtr &ev) { + const TActorId reqActor = Register(new TExampleHttpRequest(Config.Get(), PublishKey)); + TlsActivationContext->Send(ev->Forward(reqActor)); + } + +public: + static constexpr IActor::EActivityType ActorActivityType() { + // define app-specific activity tag to track elapsed cpu | handled events | actor count in Solomon + return EActorActivity::ACTORLIB_COMMON; + } + + TExampleHttpEndpoint(TExampleStorageConfig *config, const TString &publishKey, ui16 port) + : Config(config) + , PublishKey(publishKey) + , HttpPort(port) + { + } + + void Bootstrap() { + const TString publishPayload = ToString(HttpPort); + PublishActor = Register(CreatePublishActor(Config.Get(), PublishKey, publishPayload)); + HttpProxy = Register(NHttp::CreateHttpProxy(SensorsRegistry)); + + Send(HttpProxy, new NHttp::TEvHttpProxy::TEvAddListeningPort(HttpPort, FQDNHostName())); + Send(HttpProxy, new NHttp::TEvHttpProxy::TEvRegisterHandler("/list", SelfId())); + + Become(&TThis::StateWork); + } + + STFUNC(StateWork) { + Y_UNUSED(ctx); + switch (ev->GetTypeRewrite()) { + hFunc(NHttp::TEvHttpProxy::TEvHttpIncomingRequest, Handle); + default: + break; + } + } +}; + +IActor* CreateEndpointActor(TExampleStorageConfig *config, const TString &publishKey, ui16 port) { + return new TExampleHttpEndpoint(config, publishKey, port); +} diff --git a/library/cpp/actors/examples/02_discovery/lookup.cpp b/library/cpp/actors/examples/02_discovery/lookup.cpp new file mode 100644 index 0000000000..979a38d215 --- /dev/null +++ b/library/cpp/actors/examples/02_discovery/lookup.cpp @@ -0,0 +1,134 @@ +#include "services.h" + +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <util/generic/set.h> +#include <util/generic/vector.h> + +class TExampleLookupRequestActor : public TActor<TExampleLookupRequestActor> { + const TActorId Owner; + const TActorId Replica; + const TString Key; + + void Registered(TActorSystem* sys, const TActorId&) override { + const auto flags = IEventHandle::FlagTrackDelivery | IEventHandle::FlagSubscribeOnSession; + sys->Send(new IEventHandle(Replica, SelfId(), new TEvExample::TEvReplicaLookup(Key), flags)); + } + + void PassAway() override { + const ui32 replicaNode = Replica.NodeId(); + if (replicaNode != SelfId().NodeId()) { + const TActorId &interconnectProxy = TlsActivationContext->ExecutorThread.ActorSystem->InterconnectProxy(Replica.NodeId()); + Send(interconnectProxy, new TEvents::TEvUnsubscribe()); + } + return IActor::PassAway(); + } + + void Handle(TEvExample::TEvReplicaInfo::TPtr &ev) { + Send(Owner, ev->Release().Release()); + return PassAway(); + } + + void HandleUndelivered() { + Send(Owner, new TEvExample::TEvReplicaInfo(Key)); + return PassAway(); + } +public: + static constexpr IActor::EActivityType ActorActivityType() { + // define app-specific activity tag to track elapsed cpu | handled events | actor count in Solomon + return EActorActivity::ACTORLIB_COMMON; + } + + TExampleLookupRequestActor(TActorId owner, TActorId replica, const TString &key) + : TActor(&TThis::StateWork) + , Owner(owner) + , Replica(replica) + , Key(key) + {} + + STFUNC(StateWork) { + Y_UNUSED(ctx); + switch (ev->GetTypeRewrite()) { + hFunc(TEvExample::TEvReplicaInfo, Handle); + cFunc(TEvents::TEvUndelivered::EventType, HandleUndelivered); + cFunc(TEvInterconnect::TEvNodeDisconnected::EventType, HandleUndelivered); + default: + break; + } + } +}; + +class TExampleLookupActor : public TActorBootstrapped<TExampleLookupActor> { + TIntrusiveConstPtr<TExampleStorageConfig> Config; + const TString Key; + const TActorId ReplyTo; + TVector<TActorId> RequestActors; + + ui32 TotalReplicas = 0; + ui32 RepliedSuccess = 0; + ui32 RepliedError = 0; + + TSet<TString> Payloads; + + void Handle(TEvExample::TEvReplicaInfo::TPtr &ev) { + NActorsExample::TEvReplicaInfo &record = ev->Get()->Record; + if (record.PayloadSize()) { + ++RepliedSuccess; + for (const TString &payload : record.GetPayload()) { + Payloads.insert(payload); + } + } + else { + ++RepliedError; + } + + const ui32 majority = (TotalReplicas / 2 + 1); + if (RepliedSuccess == majority || (RepliedSuccess + RepliedError == TotalReplicas)) + return ReplyAndDie(); + } + + void ReplyAndDie() { + TVector<TString> replyPayloads(Payloads.begin(), Payloads.end()); + Send(ReplyTo, new TEvExample::TEvInfo(Key, std::move(replyPayloads))); + return PassAway(); + } +public: + static constexpr IActor::EActivityType ActorActivityType() { + // define app-specific activity tag to track elapsed cpu | handled events | actor count in Solomon + return EActorActivity::ACTORLIB_COMMON; + } + + TExampleLookupActor(TExampleStorageConfig *config, const TString &key, TActorId replyTo) + : Config(config) + , Key(key) + , ReplyTo(replyTo) + {} + + void Bootstrap() { + Y_VERIFY(Config->Replicas.size() > 0); + + TotalReplicas = Config->Replicas.size(); + RequestActors.reserve(TotalReplicas); + for (const auto &replica : Config->Replicas) { + const TActorId requestActor = Register(new TExampleLookupRequestActor(SelfId(), replica, Key)); + RequestActors.emplace_back(requestActor); + } + + Become(&TThis::StateWork); + } + + STFUNC(StateWork) { + Y_UNUSED(ctx); + switch (ev->GetTypeRewrite()) { + hFunc(TEvExample::TEvReplicaInfo, Handle); + default: + break; + } + } +}; + +IActor* CreateLookupActor(TExampleStorageConfig *config, const TString &key, TActorId replyTo) { + return new TExampleLookupActor(config, key, replyTo); +} diff --git a/library/cpp/actors/examples/02_discovery/main.cpp b/library/cpp/actors/examples/02_discovery/main.cpp new file mode 100644 index 0000000000..379fd6de84 --- /dev/null +++ b/library/cpp/actors/examples/02_discovery/main.cpp @@ -0,0 +1,136 @@ +#include "services.h" + +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/executor_pool_basic.h> +#include <library/cpp/actors/core/scheduler_basic.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/actors/dnsresolver/dnsresolver.h> +#include <library/cpp/actors/interconnect/interconnect.h> +#include <library/cpp/actors/interconnect/interconnect_common.h> +#include <library/cpp/actors/interconnect/interconnect_tcp_proxy.h> +#include <library/cpp/actors/interconnect/interconnect_tcp_server.h> +#include <library/cpp/actors/interconnect/poller_actor.h> +#include <library/cpp/actors/interconnect/poller_tcp.h> +#include <library/cpp/actors/util/should_continue.h> + +#include <util/system/sigset.h> +#include <util/generic/xrange.h> + +using namespace NActors; +using namespace NActors::NDnsResolver; + +static const ui32 CfgTotalReplicaNodes = 5; +static const ui16 CfgBasePort = 13300; +static const ui16 CfgHttpPort = 8881; +static const TString PublishKey = "endpoint"; + +static TProgramShouldContinue ShouldContinue; + +void OnTerminate(int) { + ShouldContinue.ShouldStop(); +} + +THolder<TActorSystemSetup> BuildActorSystemSetup(ui32 nodeId, ui32 threads, NMonitoring::TDynamicCounters &counters) { + Y_VERIFY(threads > 0 && threads < 100); + + auto setup = MakeHolder<TActorSystemSetup>(); + + setup->NodeId = nodeId; + + setup->ExecutorsCount = 1; + setup->Executors.Reset(new TAutoPtr<IExecutorPool>[1]); + setup->Executors[0] = new TBasicExecutorPool(0, threads, 50); + setup->Scheduler = new TBasicSchedulerThread(TSchedulerConfig(512, 0)); + + setup->LocalServices.emplace_back(MakePollerActorId(), TActorSetupCmd(CreatePollerActor(), TMailboxType::ReadAsFilled, 0)); + + TIntrusivePtr<TTableNameserverSetup> nameserverTable = new TTableNameserverSetup(); + for (ui32 xnode : xrange<ui32>(1, CfgTotalReplicaNodes + 1)) { + nameserverTable->StaticNodeTable[xnode] = std::make_pair("127.0.0.1", CfgBasePort + xnode); + } + + setup->LocalServices.emplace_back( + MakeDnsResolverActorId(), + TActorSetupCmd(CreateOnDemandDnsResolver(), TMailboxType::ReadAsFilled, 0) + ); + + setup->LocalServices.emplace_back( + GetNameserviceActorId(), + TActorSetupCmd(CreateNameserverTable(nameserverTable), TMailboxType::ReadAsFilled, 0) + ); + + TIntrusivePtr<TInterconnectProxyCommon> icCommon = new TInterconnectProxyCommon(); + icCommon->NameserviceId = GetNameserviceActorId(); + icCommon->MonCounters = counters.GetSubgroup("counters", "interconnect"); + icCommon->TechnicalSelfHostName = "127.0.0.1"; + + setup->Interconnect.ProxyActors.resize(CfgTotalReplicaNodes + 1); + for (ui32 xnode : xrange<ui32>(1, CfgTotalReplicaNodes + 1)) { + if (xnode != nodeId) { + IActor *actor = new TInterconnectProxyTCP(xnode, icCommon); + setup->Interconnect.ProxyActors[xnode] = TActorSetupCmd(actor, TMailboxType::ReadAsFilled, 0); + } + else { + IActor *listener = new TInterconnectListenerTCP("127.0.0.1", CfgBasePort + xnode, icCommon); + setup->LocalServices.emplace_back( + MakeInterconnectListenerActorId(false), + TActorSetupCmd(listener, TMailboxType::ReadAsFilled, 0) + ); + } + } + + return setup; +} + +int main(int argc, char **argv) { + Y_UNUSED(argc); + Y_UNUSED(argv); + +#ifdef _unix_ + signal(SIGPIPE, SIG_IGN); +#endif + signal(SIGINT, &OnTerminate); + signal(SIGTERM, &OnTerminate); + + TIntrusivePtr<TExampleStorageConfig> config = new TExampleStorageConfig(); + for (ui32 nodeid : xrange<ui32>(1, CfgTotalReplicaNodes + 1)) { + config->Replicas.push_back(MakeReplicaId(nodeid)); + } + + TVector<THolder<TActorSystem>> actorSystemHolder; + TVector<TIntrusivePtr<NMonitoring::TDynamicCounters>> countersHolder; + for (ui32 nodeid : xrange<ui32>(1, CfgTotalReplicaNodes + 1)) { + countersHolder.emplace_back(new NMonitoring::TDynamicCounters()); + THolder<TActorSystemSetup> actorSystemSetup = BuildActorSystemSetup(nodeid, 2, *countersHolder.back()); + actorSystemSetup->LocalServices.emplace_back( + TActorId(), + TActorSetupCmd(CreateEndpointActor(config.Get(), PublishKey, CfgHttpPort + nodeid), TMailboxType::HTSwap, 0) + ); + + actorSystemSetup->LocalServices.emplace_back( + MakeReplicaId(nodeid), + TActorSetupCmd(CreateReplica(), TMailboxType::ReadAsFilled, 0) + ); + + actorSystemHolder.emplace_back(new TActorSystem(actorSystemSetup)); + } + + for (auto &xh : actorSystemHolder) + xh->Start(); + + while (ShouldContinue.PollState() == TProgramShouldContinue::Continue) { + Sleep(TDuration::MilliSeconds(200)); + } + + // stop actorsystem to not generate new reqeusts for external services + // no events would be processed anymore + for (auto &xh : actorSystemHolder) + xh->Stop(); + + // and then cleanup actorsystem + // from this moment working with actorsystem prohibited + for (auto &xh : actorSystemHolder) + xh->Cleanup(); + + return ShouldContinue.GetReturnCode(); +} diff --git a/library/cpp/actors/examples/02_discovery/protocol.proto b/library/cpp/actors/examples/02_discovery/protocol.proto new file mode 100644 index 0000000000..41cc2cc9c8 --- /dev/null +++ b/library/cpp/actors/examples/02_discovery/protocol.proto @@ -0,0 +1,19 @@ +package NActorsExample; + +message TEvReplicaInfo { + optional string Key = 1; + repeated string Payload = 2; +}; + +message TEvReplicaPublishAck { + optional string Key = 1; +}; + +message TEvReplicaPublish { + optional string Key = 1; + optional string Payload = 2; +}; + +message TEvReplicaLookup { + optional string Key = 1; +}; diff --git a/library/cpp/actors/examples/02_discovery/publish.cpp b/library/cpp/actors/examples/02_discovery/publish.cpp new file mode 100644 index 0000000000..8dc5fbcea4 --- /dev/null +++ b/library/cpp/actors/examples/02_discovery/publish.cpp @@ -0,0 +1,113 @@ +#include "services.h" + +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/interconnect.h> +#include <library/cpp/actors/core/actor_bootstrapped.h> +#include <util/generic/set.h> +#include <util/generic/vector.h> + +class TExamplePublishReplicaActor : public TActorBootstrapped<TExamplePublishReplicaActor> { + const TActorId Owner; + const TActorId Replica; + const TString Key; + const TString Payload; + + void PassAway() override { + const ui32 replicaNode = Replica.NodeId(); + if (replicaNode != SelfId().NodeId()) { + const TActorId &interconnectProxy = TlsActivationContext->ExecutorThread.ActorSystem->InterconnectProxy(Replica.NodeId()); + Send(interconnectProxy, new TEvents::TEvUnsubscribe()); + } + return IActor::PassAway(); + } + + void SomeSleep() { + Become(&TThis::StateSleep, TDuration::MilliSeconds(250), new TEvents::TEvWakeup()); + } +public: + static constexpr IActor::EActivityType ActorActivityType() { + // define app-specific activity tag to track elapsed cpu | handled events | actor count in Solomon + return EActorActivity::ACTORLIB_COMMON; + } + + TExamplePublishReplicaActor(TActorId owner, TActorId replica, const TString &key, const TString &payload) + : Owner(owner) + , Replica(replica) + , Key(key) + , Payload(payload) + {} + + void Bootstrap() { + const ui32 flags = IEventHandle::FlagTrackDelivery | IEventHandle::FlagSubscribeOnSession; + Send(Replica, new TEvExample::TEvReplicaPublish(Key, Payload), flags); + Become(&TThis::StatePublish); + } + + STFUNC(StatePublish) { + Y_UNUSED(ctx); + switch (ev->GetTypeRewrite()) { + cFunc(TEvents::TEvPoison::EventType, PassAway); + cFunc(TEvents::TEvUndelivered::EventType, SomeSleep); + cFunc(TEvInterconnect::TEvNodeDisconnected::EventType, SomeSleep); + default: + break; + } + } + + STFUNC(StateSleep) { + Y_UNUSED(ctx); + switch (ev->GetTypeRewrite()) { + cFunc(TEvents::TEvPoison::EventType, PassAway); + cFunc(TEvents::TEvWakeup::EventType, Bootstrap); + default: + break; + } + } +}; + +class TExamplePublishActor : public TActorBootstrapped<TExamplePublishActor> { + TIntrusiveConstPtr<TExampleStorageConfig> Config; + const TString Key; + const TString Payload; + TVector<TActorId> PublishActors; + + void PassAway() override { + for (const auto &x : PublishActors) + Send(x, new TEvents::TEvPoison()); + return IActor::PassAway(); + } +public: + static constexpr IActor::EActivityType ActorActivityType() { + // define app-specific activity tag to track elapsed cpu | handled events | actor count in Solomon + return EActorActivity::ACTORLIB_COMMON; + } + + TExamplePublishActor(TExampleStorageConfig *config, const TString &key, const TString &what) + : Config(config) + , Key(key) + , Payload(what) + {} + + void Bootstrap() { + for (auto &replica : Config->Replicas) { + const TActorId x = Register(new TExamplePublishReplicaActor(SelfId(), replica, Key, Payload)); + PublishActors.emplace_back(x); + } + + Become(&TThis::StateWork); + } + + STFUNC(StateWork) { + Y_UNUSED(ctx); + switch (ev->GetTypeRewrite()) { + cFunc(TEvents::TEvPoison::EventType, PassAway); + default: + break; + } + } +}; + +IActor* CreatePublishActor(TExampleStorageConfig *config, const TString &key, const TString &what) { + return new TExamplePublishActor(config, key, what); +} diff --git a/library/cpp/actors/examples/02_discovery/replica.cpp b/library/cpp/actors/examples/02_discovery/replica.cpp new file mode 100644 index 0000000000..74fdfc1910 --- /dev/null +++ b/library/cpp/actors/examples/02_discovery/replica.cpp @@ -0,0 +1,182 @@ +#include "services.h" +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/hfunc.h> +#include <library/cpp/actors/core/interconnect.h> +#include <util/generic/set.h> +#include <util/generic/hash_set.h> +#include <util/generic/vector.h> + +class TExampleReplicaActor : public TActor<TExampleReplicaActor> { + using TOwnerIndex = TMap<TActorId, ui32, TActorId::TOrderedCmp>; + using TKeyIndex = THashMap<TString, TSet<ui32>>; + + struct TEntry { + TString Payload; + TActorId Owner; + TOwnerIndex::iterator OwnerIt; + TKeyIndex::iterator KeyIt; + }; + + TVector<TEntry> Entries; + TVector<ui32> AvailableEntries; + + TOwnerIndex IndexOwner; + TKeyIndex IndexKey; + + ui32 AllocateEntry() { + ui32 ret; + if (AvailableEntries) { + ret = AvailableEntries.back(); + AvailableEntries.pop_back(); + } + else { + ret = Entries.size(); + Entries.emplace_back(); + } + + return ret; + } + + bool IsLastEntryOnNode(TOwnerIndex::iterator ownerIt) { + const ui32 ownerNodeId = ownerIt->first.NodeId(); + if (ownerIt != IndexOwner.begin()) { + auto x = ownerIt; + --x; + if (x->first.NodeId() == ownerNodeId) + return false; + } + + ++ownerIt; + if (ownerIt != IndexOwner.end()) { + if (ownerIt->first.NodeId() == ownerNodeId) + return false; + } + + return true; + } + + void CleanupEntry(ui32 entryIndex) { + TEntry &entry = Entries[entryIndex]; + entry.KeyIt->second.erase(entryIndex); + if (entry.KeyIt->second.empty()) + IndexKey.erase(entry.KeyIt); + + if (IsLastEntryOnNode(entry.OwnerIt)) + Send(TlsActivationContext->ExecutorThread.ActorSystem->InterconnectProxy(entry.OwnerIt->first.NodeId()), new TEvents::TEvUnsubscribe()); + + IndexOwner.erase(entry.OwnerIt); + + TString().swap(entry.Payload); + entry.Owner = TActorId(); + entry.KeyIt = IndexKey.end(); + entry.OwnerIt = IndexOwner.end(); + + AvailableEntries.emplace_back(entryIndex); + } + + void Handle(TEvExample::TEvReplicaLookup::TPtr &ev) { + auto &record = ev->Get()->Record; + const auto &key = record.GetKey(); + + auto keyIt = IndexKey.find(key); + if (keyIt == IndexKey.end()) { + Send(ev->Sender, new TEvExample::TEvReplicaInfo(key), 0, ev->Cookie); + return; + } + + auto reply = MakeHolder<TEvExample::TEvReplicaInfo>(key); + reply->Record.MutablePayload()->Reserve(keyIt->second.size()); + for (ui32 entryIndex : keyIt->second) { + const TEntry &entry = Entries[entryIndex]; + reply->Record.AddPayload(entry.Payload); + } + + Send(ev->Sender, std::move(reply), 0, ev->Cookie); + } + + void Handle(TEvExample::TEvReplicaPublish::TPtr &ev) { + auto &record = ev->Get()->Record; + const TString &key = record.GetKey(); + const TString &payload = record.GetPayload(); + const TActorId &owner = ev->Sender; + + auto ownerIt = IndexOwner.find(owner); + if (ownerIt != IndexOwner.end()) { + const ui32 entryIndex = ownerIt->second; + TEntry &entry = Entries[entryIndex]; + if (entry.KeyIt->first != key) { + // reply nothing, request suspicious + return; + } + + entry.Payload = payload; + } + else { + const ui32 entryIndex = AllocateEntry(); + TEntry &entry = Entries[entryIndex]; + + entry.Payload = payload; + entry.Owner = owner; + + entry.OwnerIt = IndexOwner.emplace(owner, entryIndex).first; + entry.KeyIt = IndexKey.emplace(std::make_pair(key, TSet<ui32>())).first; + entry.KeyIt->second.emplace(entryIndex); + + Send(owner, new TEvExample::TEvReplicaPublishAck(), IEventHandle::FlagTrackDelivery | IEventHandle::FlagSubscribeOnSession, ev->Cookie); + } + } + + void Handle(TEvents::TEvUndelivered::TPtr &ev) { + auto ownerIt = IndexOwner.find(ev->Sender); + if (ownerIt == IndexOwner.end()) + return; + + CleanupEntry(ownerIt->second); + } + + void Handle(TEvInterconnect::TEvNodeDisconnected::TPtr &ev) { + auto *msg = ev->Get(); + const ui32 nodeId = msg->NodeId; + auto ownerIt = IndexOwner.lower_bound(TActorId(nodeId, 0, 0, 0)); + while (ownerIt != IndexOwner.end() && ownerIt->first.NodeId() == nodeId) { + const ui32 idx = ownerIt->second; + ++ownerIt; + CleanupEntry(idx); + } + } + +public: + static constexpr IActor::EActivityType ActorActivityType() { + // define app-specific activity tag to track elapsed cpu | handled events | actor count in Solomon + return EActorActivity::ACTORLIB_COMMON; + } + + TExampleReplicaActor() + : TActor(&TThis::StateWork) + {} + + STFUNC(StateWork) { + Y_UNUSED(ctx); + switch (ev->GetTypeRewrite()) { + hFunc(TEvExample::TEvReplicaLookup, Handle); + hFunc(TEvExample::TEvReplicaPublish, Handle); + hFunc(TEvents::TEvUndelivered, Handle); + hFunc(TEvInterconnect::TEvNodeDisconnected, Handle); + + IgnoreFunc(TEvInterconnect::TEvNodeConnected); + default: + // here is place to spam some log message on unknown events + break; + } + } +}; + +IActor* CreateReplica() { + return new TExampleReplicaActor(); +} + +TActorId MakeReplicaId(ui32 nodeid) { + char x[12] = { 'r', 'p', 'l' }; + memcpy(x + 5, &nodeid, sizeof(ui32)); + return TActorId(nodeid, TStringBuf(x, 12)); +} diff --git a/library/cpp/actors/examples/02_discovery/services.h b/library/cpp/actors/examples/02_discovery/services.h new file mode 100644 index 0000000000..266517c577 --- /dev/null +++ b/library/cpp/actors/examples/02_discovery/services.h @@ -0,0 +1,85 @@ +#pragma once +#include <library/cpp/actors/examples/02_discovery/protocol.pb.h> + +#include <library/cpp/actors/core/actor.h> +#include <library/cpp/actors/core/events.h> +#include <library/cpp/actors/core/event_pb.h> +#include <library/cpp/actors/core/event_local.h> + +#include <util/generic/vector.h> + +using namespace NActors; + +struct TExampleStorageConfig : public TThrRefBase { + TVector<TActorId> Replicas; +}; + +struct TEvExample { + enum EEv { + EvReplicaLookup = EventSpaceBegin(TEvents::ES_USERSPACE + 1), + EvReplicaPublish, + + EvReplicaInfo = EventSpaceBegin(TEvents::ES_USERSPACE + 2), + EvReplicaPublishAck, + + EvInfo = EventSpaceBegin(TEvents::ES_USERSPACE + 3), + }; + + struct TEvReplicaLookup : public TEventPB<TEvReplicaLookup, NActorsExample::TEvReplicaLookup, EvReplicaLookup> { + TEvReplicaLookup() + {} + + TEvReplicaLookup(const TString &key) + { + Record.SetKey(key); + } + }; + + struct TEvReplicaPublish : public TEventPB<TEvReplicaPublish, NActorsExample::TEvReplicaPublish, EvReplicaPublish> { + TEvReplicaPublish() + {} + + TEvReplicaPublish(const TString &key, const TString &payload) + { + Record.SetKey(key); + Record.SetPayload(payload); + } + }; + + struct TEvReplicaInfo : public TEventPB<TEvReplicaInfo, NActorsExample::TEvReplicaInfo, EvReplicaInfo> { + TEvReplicaInfo() + {} + + TEvReplicaInfo(const TString &key) + { + Record.SetKey(key); + } + }; + + struct TEvReplicaPublishAck : public TEventPB<TEvReplicaPublishAck, NActorsExample::TEvReplicaPublishAck, EvReplicaPublishAck> { + TEvReplicaPublishAck() + {} + + TEvReplicaPublishAck(const TString &key) + { + Record.SetKey(key); + } + }; + + struct TEvInfo : public TEventLocal<TEvInfo, EvInfo> { + const TString Key; + const TVector<TString> Payloads; + + TEvInfo(const TString &key, TVector<TString> &&payloads) + : Key(key) + , Payloads(payloads) + {} + }; +}; + +IActor* CreateReplica(); +IActor* CreatePublishActor(TExampleStorageConfig *config, const TString &key, const TString &what); +IActor* CreateLookupActor(TExampleStorageConfig *config, const TString &key, TActorId replyTo); +IActor* CreateEndpointActor(TExampleStorageConfig *config, const TString &publishKey, ui16 httpPort); + +TActorId MakeReplicaId(ui32 nodeid); diff --git a/library/cpp/actors/examples/CMakeLists.txt b/library/cpp/actors/examples/CMakeLists.txt new file mode 100644 index 0000000000..1ed75af808 --- /dev/null +++ b/library/cpp/actors/examples/CMakeLists.txt @@ -0,0 +1,10 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(01_ping_pong) +add_subdirectory(02_discovery) diff --git a/library/cpp/actors/helpers/CMakeLists.darwin.txt b/library/cpp/actors/helpers/CMakeLists.darwin.txt index a9e3e369eb..3a8027f2cc 100644 --- a/library/cpp/actors/helpers/CMakeLists.darwin.txt +++ b/library/cpp/actors/helpers/CMakeLists.darwin.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(ut) add_library(cpp-actors-helpers) target_link_libraries(cpp-actors-helpers PUBLIC diff --git a/library/cpp/actors/helpers/CMakeLists.linux-aarch64.txt b/library/cpp/actors/helpers/CMakeLists.linux-aarch64.txt index 52ef906f05..0a5b41f44d 100644 --- a/library/cpp/actors/helpers/CMakeLists.linux-aarch64.txt +++ b/library/cpp/actors/helpers/CMakeLists.linux-aarch64.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(ut) add_library(cpp-actors-helpers) target_link_libraries(cpp-actors-helpers PUBLIC diff --git a/library/cpp/actors/helpers/CMakeLists.linux.txt b/library/cpp/actors/helpers/CMakeLists.linux.txt index 52ef906f05..0a5b41f44d 100644 --- a/library/cpp/actors/helpers/CMakeLists.linux.txt +++ b/library/cpp/actors/helpers/CMakeLists.linux.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(ut) add_library(cpp-actors-helpers) target_link_libraries(cpp-actors-helpers PUBLIC diff --git a/library/cpp/actors/helpers/ut/CMakeLists.darwin.txt b/library/cpp/actors/helpers/ut/CMakeLists.darwin.txt new file mode 100644 index 0000000000..724bb405c1 --- /dev/null +++ b/library/cpp/actors/helpers/ut/CMakeLists.darwin.txt @@ -0,0 +1,46 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-helpers-ut) +target_include_directories(library-cpp-actors-helpers-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/helpers +) +target_link_libraries(library-cpp-actors-helpers-ut PUBLIC + contrib-libs-cxxsupp + yutil + library-cpp-cpuid_check + cpp-testing-unittest_main + cpp-actors-helpers + cpp-actors-interconnect + cpp-actors-testlib + cpp-actors-core +) +target_link_options(library-cpp-actors-helpers-ut PRIVATE + -Wl,-no_deduplicate + -Wl,-sdk_version,10.15 + -fPIC + -fPIC + -framework + CoreFoundation +) +target_sources(library-cpp-actors-helpers-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/helpers/selfping_actor_ut.cpp +) +add_test( + NAME + library-cpp-actors-helpers-ut + COMMAND + library-cpp-actors-helpers-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-helpers-ut) diff --git a/library/cpp/actors/helpers/ut/CMakeLists.linux-aarch64.txt b/library/cpp/actors/helpers/ut/CMakeLists.linux-aarch64.txt new file mode 100644 index 0000000000..134537eb3c --- /dev/null +++ b/library/cpp/actors/helpers/ut/CMakeLists.linux-aarch64.txt @@ -0,0 +1,49 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-helpers-ut) +target_include_directories(library-cpp-actors-helpers-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/helpers +) +target_link_libraries(library-cpp-actors-helpers-ut PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + library-cpp-lfalloc + cpp-testing-unittest_main + cpp-actors-helpers + cpp-actors-interconnect + cpp-actors-testlib + cpp-actors-core +) +target_link_options(library-cpp-actors-helpers-ut PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(library-cpp-actors-helpers-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/helpers/selfping_actor_ut.cpp +) +add_test( + NAME + library-cpp-actors-helpers-ut + COMMAND + library-cpp-actors-helpers-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-helpers-ut) diff --git a/library/cpp/actors/helpers/ut/CMakeLists.linux.txt b/library/cpp/actors/helpers/ut/CMakeLists.linux.txt new file mode 100644 index 0000000000..f4a0d60ae9 --- /dev/null +++ b/library/cpp/actors/helpers/ut/CMakeLists.linux.txt @@ -0,0 +1,51 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-helpers-ut) +target_include_directories(library-cpp-actors-helpers-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/helpers +) +target_link_libraries(library-cpp-actors-helpers-ut PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + cpp-malloc-tcmalloc + libs-tcmalloc-no_percpu_cache + library-cpp-cpuid_check + cpp-testing-unittest_main + cpp-actors-helpers + cpp-actors-interconnect + cpp-actors-testlib + cpp-actors-core +) +target_link_options(library-cpp-actors-helpers-ut PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(library-cpp-actors-helpers-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/helpers/selfping_actor_ut.cpp +) +add_test( + NAME + library-cpp-actors-helpers-ut + COMMAND + library-cpp-actors-helpers-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-helpers-ut) diff --git a/library/cpp/actors/helpers/ut/CMakeLists.txt b/library/cpp/actors/helpers/ut/CMakeLists.txt new file mode 100644 index 0000000000..3e0811fb22 --- /dev/null +++ b/library/cpp/actors/helpers/ut/CMakeLists.txt @@ -0,0 +1,15 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux-aarch64.txt) +elseif (APPLE) + include(CMakeLists.darwin.txt) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux.txt) +endif() diff --git a/library/cpp/actors/http/CMakeLists.darwin.txt b/library/cpp/actors/http/CMakeLists.darwin.txt index 277ffc4560..59fdab0b5f 100644 --- a/library/cpp/actors/http/CMakeLists.darwin.txt +++ b/library/cpp/actors/http/CMakeLists.darwin.txt @@ -8,6 +8,7 @@ find_package(OpenSSL REQUIRED) find_package(ZLIB REQUIRED) +add_subdirectory(ut) add_library(cpp-actors-http) target_link_libraries(cpp-actors-http PUBLIC diff --git a/library/cpp/actors/http/CMakeLists.linux-aarch64.txt b/library/cpp/actors/http/CMakeLists.linux-aarch64.txt index 66011d9355..5c289c5aa6 100644 --- a/library/cpp/actors/http/CMakeLists.linux-aarch64.txt +++ b/library/cpp/actors/http/CMakeLists.linux-aarch64.txt @@ -8,6 +8,7 @@ find_package(OpenSSL REQUIRED) find_package(ZLIB REQUIRED) +add_subdirectory(ut) add_library(cpp-actors-http) target_link_libraries(cpp-actors-http PUBLIC diff --git a/library/cpp/actors/http/CMakeLists.linux.txt b/library/cpp/actors/http/CMakeLists.linux.txt index 66011d9355..5c289c5aa6 100644 --- a/library/cpp/actors/http/CMakeLists.linux.txt +++ b/library/cpp/actors/http/CMakeLists.linux.txt @@ -8,6 +8,7 @@ find_package(OpenSSL REQUIRED) find_package(ZLIB REQUIRED) +add_subdirectory(ut) add_library(cpp-actors-http) target_link_libraries(cpp-actors-http PUBLIC diff --git a/library/cpp/actors/http/ut/CMakeLists.darwin.txt b/library/cpp/actors/http/ut/CMakeLists.darwin.txt new file mode 100644 index 0000000000..2db53c0cae --- /dev/null +++ b/library/cpp/actors/http/ut/CMakeLists.darwin.txt @@ -0,0 +1,44 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-http-ut) +target_include_directories(library-cpp-actors-http-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/http +) +target_link_libraries(library-cpp-actors-http-ut PUBLIC + contrib-libs-cxxsupp + yutil + library-cpp-cpuid_check + cpp-testing-unittest_main + cpp-actors-http + cpp-actors-testlib +) +target_link_options(library-cpp-actors-http-ut PRIVATE + -Wl,-no_deduplicate + -Wl,-sdk_version,10.15 + -fPIC + -fPIC + -framework + CoreFoundation +) +target_sources(library-cpp-actors-http-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/http/http_ut.cpp +) +add_test( + NAME + library-cpp-actors-http-ut + COMMAND + library-cpp-actors-http-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-http-ut) diff --git a/library/cpp/actors/http/ut/CMakeLists.linux-aarch64.txt b/library/cpp/actors/http/ut/CMakeLists.linux-aarch64.txt new file mode 100644 index 0000000000..de4d0cd2d6 --- /dev/null +++ b/library/cpp/actors/http/ut/CMakeLists.linux-aarch64.txt @@ -0,0 +1,47 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-http-ut) +target_include_directories(library-cpp-actors-http-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/http +) +target_link_libraries(library-cpp-actors-http-ut PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + library-cpp-lfalloc + cpp-testing-unittest_main + cpp-actors-http + cpp-actors-testlib +) +target_link_options(library-cpp-actors-http-ut PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(library-cpp-actors-http-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/http/http_ut.cpp +) +add_test( + NAME + library-cpp-actors-http-ut + COMMAND + library-cpp-actors-http-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-http-ut) diff --git a/library/cpp/actors/http/ut/CMakeLists.linux.txt b/library/cpp/actors/http/ut/CMakeLists.linux.txt new file mode 100644 index 0000000000..698a3c7bb9 --- /dev/null +++ b/library/cpp/actors/http/ut/CMakeLists.linux.txt @@ -0,0 +1,49 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-http-ut) +target_include_directories(library-cpp-actors-http-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/http +) +target_link_libraries(library-cpp-actors-http-ut PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + cpp-malloc-tcmalloc + libs-tcmalloc-no_percpu_cache + library-cpp-cpuid_check + cpp-testing-unittest_main + cpp-actors-http + cpp-actors-testlib +) +target_link_options(library-cpp-actors-http-ut PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(library-cpp-actors-http-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/http/http_ut.cpp +) +add_test( + NAME + library-cpp-actors-http-ut + COMMAND + library-cpp-actors-http-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-http-ut) diff --git a/library/cpp/actors/http/ut/CMakeLists.txt b/library/cpp/actors/http/ut/CMakeLists.txt new file mode 100644 index 0000000000..3e0811fb22 --- /dev/null +++ b/library/cpp/actors/http/ut/CMakeLists.txt @@ -0,0 +1,15 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux-aarch64.txt) +elseif (APPLE) + include(CMakeLists.darwin.txt) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux.txt) +endif() diff --git a/library/cpp/actors/interconnect/CMakeLists.darwin.txt b/library/cpp/actors/interconnect/CMakeLists.darwin.txt index f73af2defe..c0b4981c37 100644 --- a/library/cpp/actors/interconnect/CMakeLists.darwin.txt +++ b/library/cpp/actors/interconnect/CMakeLists.darwin.txt @@ -8,6 +8,8 @@ find_package(OpenSSL REQUIRED) add_subdirectory(mock) +add_subdirectory(ut) +add_subdirectory(ut_fat) add_library(cpp-actors-interconnect) target_link_libraries(cpp-actors-interconnect PUBLIC diff --git a/library/cpp/actors/interconnect/CMakeLists.linux-aarch64.txt b/library/cpp/actors/interconnect/CMakeLists.linux-aarch64.txt index b5201f16a0..ada1e68d25 100644 --- a/library/cpp/actors/interconnect/CMakeLists.linux-aarch64.txt +++ b/library/cpp/actors/interconnect/CMakeLists.linux-aarch64.txt @@ -8,6 +8,8 @@ find_package(OpenSSL REQUIRED) add_subdirectory(mock) +add_subdirectory(ut) +add_subdirectory(ut_fat) add_library(cpp-actors-interconnect) target_link_libraries(cpp-actors-interconnect PUBLIC diff --git a/library/cpp/actors/interconnect/CMakeLists.linux.txt b/library/cpp/actors/interconnect/CMakeLists.linux.txt index b5201f16a0..ada1e68d25 100644 --- a/library/cpp/actors/interconnect/CMakeLists.linux.txt +++ b/library/cpp/actors/interconnect/CMakeLists.linux.txt @@ -8,6 +8,8 @@ find_package(OpenSSL REQUIRED) add_subdirectory(mock) +add_subdirectory(ut) +add_subdirectory(ut_fat) add_library(cpp-actors-interconnect) target_link_libraries(cpp-actors-interconnect PUBLIC diff --git a/library/cpp/actors/interconnect/ut/CMakeLists.darwin.txt b/library/cpp/actors/interconnect/ut/CMakeLists.darwin.txt new file mode 100644 index 0000000000..7f570a269b --- /dev/null +++ b/library/cpp/actors/interconnect/ut/CMakeLists.darwin.txt @@ -0,0 +1,53 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(lib) +add_subdirectory(protos) + +add_executable(library-cpp-actors-interconnect-ut) +target_link_libraries(library-cpp-actors-interconnect-ut PUBLIC + contrib-libs-cxxsupp + yutil + library-cpp-cpuid_check + cpp-testing-unittest_main + cpp-actors-core + cpp-actors-interconnect + interconnect-ut-lib + interconnect-ut-protos + cpp-actors-testlib + cpp-digest-md5 + cpp-testing-unittest +) +target_link_options(library-cpp-actors-interconnect-ut PRIVATE + -Wl,-no_deduplicate + -Wl,-sdk_version,10.15 + -fPIC + -fPIC + -framework + CoreFoundation +) +target_sources(library-cpp-actors-interconnect-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut/channel_scheduler_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut/event_holder_pool_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut/interconnect_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut/large.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut/poller_actor_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut/dynamic_proxy_ut.cpp +) +add_test( + NAME + library-cpp-actors-interconnect-ut + COMMAND + library-cpp-actors-interconnect-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-interconnect-ut) diff --git a/library/cpp/actors/interconnect/ut/CMakeLists.linux-aarch64.txt b/library/cpp/actors/interconnect/ut/CMakeLists.linux-aarch64.txt new file mode 100644 index 0000000000..dfe178b18a --- /dev/null +++ b/library/cpp/actors/interconnect/ut/CMakeLists.linux-aarch64.txt @@ -0,0 +1,56 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(lib) +add_subdirectory(protos) + +add_executable(library-cpp-actors-interconnect-ut) +target_link_libraries(library-cpp-actors-interconnect-ut PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + library-cpp-lfalloc + cpp-testing-unittest_main + cpp-actors-core + cpp-actors-interconnect + interconnect-ut-lib + interconnect-ut-protos + cpp-actors-testlib + cpp-digest-md5 + cpp-testing-unittest +) +target_link_options(library-cpp-actors-interconnect-ut PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(library-cpp-actors-interconnect-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut/channel_scheduler_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut/event_holder_pool_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut/interconnect_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut/large.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut/poller_actor_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut/dynamic_proxy_ut.cpp +) +add_test( + NAME + library-cpp-actors-interconnect-ut + COMMAND + library-cpp-actors-interconnect-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-interconnect-ut) diff --git a/library/cpp/actors/interconnect/ut/CMakeLists.linux.txt b/library/cpp/actors/interconnect/ut/CMakeLists.linux.txt new file mode 100644 index 0000000000..3ebb645c08 --- /dev/null +++ b/library/cpp/actors/interconnect/ut/CMakeLists.linux.txt @@ -0,0 +1,58 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(lib) +add_subdirectory(protos) + +add_executable(library-cpp-actors-interconnect-ut) +target_link_libraries(library-cpp-actors-interconnect-ut PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + cpp-malloc-tcmalloc + libs-tcmalloc-no_percpu_cache + library-cpp-cpuid_check + cpp-testing-unittest_main + cpp-actors-core + cpp-actors-interconnect + interconnect-ut-lib + interconnect-ut-protos + cpp-actors-testlib + cpp-digest-md5 + cpp-testing-unittest +) +target_link_options(library-cpp-actors-interconnect-ut PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(library-cpp-actors-interconnect-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut/channel_scheduler_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut/event_holder_pool_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut/interconnect_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut/large.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut/poller_actor_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut/dynamic_proxy_ut.cpp +) +add_test( + NAME + library-cpp-actors-interconnect-ut + COMMAND + library-cpp-actors-interconnect-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-interconnect-ut) diff --git a/library/cpp/actors/interconnect/ut/CMakeLists.txt b/library/cpp/actors/interconnect/ut/CMakeLists.txt new file mode 100644 index 0000000000..3e0811fb22 --- /dev/null +++ b/library/cpp/actors/interconnect/ut/CMakeLists.txt @@ -0,0 +1,15 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux-aarch64.txt) +elseif (APPLE) + include(CMakeLists.darwin.txt) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux.txt) +endif() diff --git a/library/cpp/actors/interconnect/ut/lib/CMakeLists.darwin.txt b/library/cpp/actors/interconnect/ut/lib/CMakeLists.darwin.txt new file mode 100644 index 0000000000..ecd1510650 --- /dev/null +++ b/library/cpp/actors/interconnect/ut/lib/CMakeLists.darwin.txt @@ -0,0 +1,14 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_library(interconnect-ut-lib INTERFACE) +target_link_libraries(interconnect-ut-lib INTERFACE + contrib-libs-cxxsupp + yutil +) diff --git a/library/cpp/actors/interconnect/ut/lib/CMakeLists.linux-aarch64.txt b/library/cpp/actors/interconnect/ut/lib/CMakeLists.linux-aarch64.txt new file mode 100644 index 0000000000..420e236c86 --- /dev/null +++ b/library/cpp/actors/interconnect/ut/lib/CMakeLists.linux-aarch64.txt @@ -0,0 +1,15 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_library(interconnect-ut-lib INTERFACE) +target_link_libraries(interconnect-ut-lib INTERFACE + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil +) diff --git a/library/cpp/actors/interconnect/ut/lib/CMakeLists.linux.txt b/library/cpp/actors/interconnect/ut/lib/CMakeLists.linux.txt new file mode 100644 index 0000000000..420e236c86 --- /dev/null +++ b/library/cpp/actors/interconnect/ut/lib/CMakeLists.linux.txt @@ -0,0 +1,15 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_library(interconnect-ut-lib INTERFACE) +target_link_libraries(interconnect-ut-lib INTERFACE + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil +) diff --git a/library/cpp/actors/interconnect/ut/lib/CMakeLists.txt b/library/cpp/actors/interconnect/ut/lib/CMakeLists.txt new file mode 100644 index 0000000000..3e0811fb22 --- /dev/null +++ b/library/cpp/actors/interconnect/ut/lib/CMakeLists.txt @@ -0,0 +1,15 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux-aarch64.txt) +elseif (APPLE) + include(CMakeLists.darwin.txt) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux.txt) +endif() diff --git a/library/cpp/actors/interconnect/ut/protos/CMakeLists.darwin.txt b/library/cpp/actors/interconnect/ut/protos/CMakeLists.darwin.txt new file mode 100644 index 0000000000..6796b829e5 --- /dev/null +++ b/library/cpp/actors/interconnect/ut/protos/CMakeLists.darwin.txt @@ -0,0 +1,31 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_library(interconnect-ut-protos) +target_link_libraries(interconnect-ut-protos PUBLIC + contrib-libs-cxxsupp + yutil + contrib-libs-protobuf +) +target_proto_messages(interconnect-ut-protos PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut/protos/interconnect_test.proto +) +target_proto_addincls(interconnect-ut-protos + ./ + ${CMAKE_SOURCE_DIR}/ + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src +) +target_proto_outs(interconnect-ut-protos + --cpp_out=${CMAKE_BINARY_DIR}/ + --cpp_styleguide_out=${CMAKE_BINARY_DIR}/ +) diff --git a/library/cpp/actors/interconnect/ut/protos/CMakeLists.linux-aarch64.txt b/library/cpp/actors/interconnect/ut/protos/CMakeLists.linux-aarch64.txt new file mode 100644 index 0000000000..ad25a5c4a8 --- /dev/null +++ b/library/cpp/actors/interconnect/ut/protos/CMakeLists.linux-aarch64.txt @@ -0,0 +1,32 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_library(interconnect-ut-protos) +target_link_libraries(interconnect-ut-protos PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + contrib-libs-protobuf +) +target_proto_messages(interconnect-ut-protos PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut/protos/interconnect_test.proto +) +target_proto_addincls(interconnect-ut-protos + ./ + ${CMAKE_SOURCE_DIR}/ + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src +) +target_proto_outs(interconnect-ut-protos + --cpp_out=${CMAKE_BINARY_DIR}/ + --cpp_styleguide_out=${CMAKE_BINARY_DIR}/ +) diff --git a/library/cpp/actors/interconnect/ut/protos/CMakeLists.linux.txt b/library/cpp/actors/interconnect/ut/protos/CMakeLists.linux.txt new file mode 100644 index 0000000000..ad25a5c4a8 --- /dev/null +++ b/library/cpp/actors/interconnect/ut/protos/CMakeLists.linux.txt @@ -0,0 +1,32 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_library(interconnect-ut-protos) +target_link_libraries(interconnect-ut-protos PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + contrib-libs-protobuf +) +target_proto_messages(interconnect-ut-protos PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut/protos/interconnect_test.proto +) +target_proto_addincls(interconnect-ut-protos + ./ + ${CMAKE_SOURCE_DIR}/ + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src +) +target_proto_outs(interconnect-ut-protos + --cpp_out=${CMAKE_BINARY_DIR}/ + --cpp_styleguide_out=${CMAKE_BINARY_DIR}/ +) diff --git a/library/cpp/actors/interconnect/ut/protos/CMakeLists.txt b/library/cpp/actors/interconnect/ut/protos/CMakeLists.txt new file mode 100644 index 0000000000..3e0811fb22 --- /dev/null +++ b/library/cpp/actors/interconnect/ut/protos/CMakeLists.txt @@ -0,0 +1,15 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux-aarch64.txt) +elseif (APPLE) + include(CMakeLists.darwin.txt) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux.txt) +endif() diff --git a/library/cpp/actors/interconnect/ut_fat/CMakeLists.darwin.txt b/library/cpp/actors/interconnect/ut_fat/CMakeLists.darwin.txt new file mode 100644 index 0000000000..16eb772399 --- /dev/null +++ b/library/cpp/actors/interconnect/ut_fat/CMakeLists.darwin.txt @@ -0,0 +1,46 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-interconnect-ut_fat) +target_link_libraries(library-cpp-actors-interconnect-ut_fat PUBLIC + contrib-libs-cxxsupp + yutil + library-cpp-cpuid_check + cpp-testing-unittest_main + cpp-actors-core + cpp-actors-interconnect + actors-interconnect-mock + interconnect-ut-lib + interconnect-ut-protos + cpp-testing-unittest + cpp-deprecated-atomic +) +target_link_options(library-cpp-actors-interconnect-ut_fat PRIVATE + -Wl,-no_deduplicate + -Wl,-sdk_version,10.15 + -fPIC + -fPIC + -framework + CoreFoundation +) +target_sources(library-cpp-actors-interconnect-ut_fat PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut_fat/main.cpp +) +add_test( + NAME + library-cpp-actors-interconnect-ut_fat + COMMAND + library-cpp-actors-interconnect-ut_fat + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-interconnect-ut_fat) diff --git a/library/cpp/actors/interconnect/ut_fat/CMakeLists.linux-aarch64.txt b/library/cpp/actors/interconnect/ut_fat/CMakeLists.linux-aarch64.txt new file mode 100644 index 0000000000..41d151a739 --- /dev/null +++ b/library/cpp/actors/interconnect/ut_fat/CMakeLists.linux-aarch64.txt @@ -0,0 +1,49 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-interconnect-ut_fat) +target_link_libraries(library-cpp-actors-interconnect-ut_fat PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + library-cpp-lfalloc + cpp-testing-unittest_main + cpp-actors-core + cpp-actors-interconnect + actors-interconnect-mock + interconnect-ut-lib + interconnect-ut-protos + cpp-testing-unittest + cpp-deprecated-atomic +) +target_link_options(library-cpp-actors-interconnect-ut_fat PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(library-cpp-actors-interconnect-ut_fat PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut_fat/main.cpp +) +add_test( + NAME + library-cpp-actors-interconnect-ut_fat + COMMAND + library-cpp-actors-interconnect-ut_fat + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-interconnect-ut_fat) diff --git a/library/cpp/actors/interconnect/ut_fat/CMakeLists.linux.txt b/library/cpp/actors/interconnect/ut_fat/CMakeLists.linux.txt new file mode 100644 index 0000000000..8c0871a1ae --- /dev/null +++ b/library/cpp/actors/interconnect/ut_fat/CMakeLists.linux.txt @@ -0,0 +1,51 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-interconnect-ut_fat) +target_link_libraries(library-cpp-actors-interconnect-ut_fat PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + cpp-malloc-tcmalloc + libs-tcmalloc-no_percpu_cache + library-cpp-cpuid_check + cpp-testing-unittest_main + cpp-actors-core + cpp-actors-interconnect + actors-interconnect-mock + interconnect-ut-lib + interconnect-ut-protos + cpp-testing-unittest + cpp-deprecated-atomic +) +target_link_options(library-cpp-actors-interconnect-ut_fat PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(library-cpp-actors-interconnect-ut_fat PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/interconnect/ut_fat/main.cpp +) +add_test( + NAME + library-cpp-actors-interconnect-ut_fat + COMMAND + library-cpp-actors-interconnect-ut_fat + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-interconnect-ut_fat) diff --git a/library/cpp/actors/interconnect/ut_fat/CMakeLists.txt b/library/cpp/actors/interconnect/ut_fat/CMakeLists.txt new file mode 100644 index 0000000000..3e0811fb22 --- /dev/null +++ b/library/cpp/actors/interconnect/ut_fat/CMakeLists.txt @@ -0,0 +1,15 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux-aarch64.txt) +elseif (APPLE) + include(CMakeLists.darwin.txt) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux.txt) +endif() diff --git a/library/cpp/actors/log_backend/CMakeLists.darwin.txt b/library/cpp/actors/log_backend/CMakeLists.darwin.txt new file mode 100644 index 0000000000..ed1902e1d9 --- /dev/null +++ b/library/cpp/actors/log_backend/CMakeLists.darwin.txt @@ -0,0 +1,19 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_library(cpp-actors-log_backend) +target_link_libraries(cpp-actors-log_backend PUBLIC + contrib-libs-cxxsupp + yutil + cpp-actors-core + library-cpp-logger +) +target_sources(cpp-actors-log_backend PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/log_backend/actor_log_backend.cpp +) diff --git a/library/cpp/actors/log_backend/CMakeLists.linux-aarch64.txt b/library/cpp/actors/log_backend/CMakeLists.linux-aarch64.txt new file mode 100644 index 0000000000..aa5c134c8c --- /dev/null +++ b/library/cpp/actors/log_backend/CMakeLists.linux-aarch64.txt @@ -0,0 +1,20 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_library(cpp-actors-log_backend) +target_link_libraries(cpp-actors-log_backend PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + cpp-actors-core + library-cpp-logger +) +target_sources(cpp-actors-log_backend PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/log_backend/actor_log_backend.cpp +) diff --git a/library/cpp/actors/log_backend/CMakeLists.linux.txt b/library/cpp/actors/log_backend/CMakeLists.linux.txt new file mode 100644 index 0000000000..aa5c134c8c --- /dev/null +++ b/library/cpp/actors/log_backend/CMakeLists.linux.txt @@ -0,0 +1,20 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_library(cpp-actors-log_backend) +target_link_libraries(cpp-actors-log_backend PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + cpp-actors-core + library-cpp-logger +) +target_sources(cpp-actors-log_backend PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/log_backend/actor_log_backend.cpp +) diff --git a/library/cpp/actors/log_backend/CMakeLists.txt b/library/cpp/actors/log_backend/CMakeLists.txt new file mode 100644 index 0000000000..3e0811fb22 --- /dev/null +++ b/library/cpp/actors/log_backend/CMakeLists.txt @@ -0,0 +1,15 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux-aarch64.txt) +elseif (APPLE) + include(CMakeLists.darwin.txt) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux.txt) +endif() diff --git a/library/cpp/actors/log_backend/actor_log_backend.cpp b/library/cpp/actors/log_backend/actor_log_backend.cpp new file mode 100644 index 0000000000..a6fdd20c7b --- /dev/null +++ b/library/cpp/actors/log_backend/actor_log_backend.cpp @@ -0,0 +1,42 @@ +#include "actor_log_backend.h" + +#include <library/cpp/actors/core/actorsystem.h> +#include <library/cpp/actors/core/log.h> +#include <library/cpp/logger/record.h> + +namespace { + +NActors::NLog::EPriority GetActorLogPriority(ELogPriority priority) { + switch (priority) { + case TLOG_EMERG: + return NActors::NLog::PRI_EMERG; + case TLOG_ALERT: + return NActors::NLog::PRI_ALERT; + case TLOG_CRIT: + return NActors::NLog::PRI_CRIT; + case TLOG_ERR: + return NActors::NLog::PRI_ERROR; + case TLOG_WARNING: + return NActors::NLog::PRI_WARN; + case TLOG_NOTICE: + return NActors::NLog::PRI_NOTICE; + case TLOG_INFO: + return NActors::NLog::PRI_INFO; + case TLOG_DEBUG: + return NActors::NLog::PRI_DEBUG; + default: + return NActors::NLog::PRI_TRACE; + } +} + +} + +TActorLogBackend::TActorLogBackend(NActors::TActorSystem* actorSystem, int logComponent) + : ActorSystem(actorSystem) + , LogComponent(logComponent) +{ +} + +void TActorLogBackend::WriteData(const TLogRecord& rec) { + LOG_LOG(*ActorSystem, GetActorLogPriority(rec.Priority), LogComponent, TString(rec.Data, rec.Len)); +} diff --git a/library/cpp/actors/log_backend/actor_log_backend.h b/library/cpp/actors/log_backend/actor_log_backend.h new file mode 100644 index 0000000000..a51427d498 --- /dev/null +++ b/library/cpp/actors/log_backend/actor_log_backend.h @@ -0,0 +1,20 @@ +#pragma once +#include <library/cpp/logger/backend.h> + +namespace NActors { +class TActorSystem; +} // namespace NActors + +class TActorLogBackend : public TLogBackend { +public: + TActorLogBackend(NActors::TActorSystem* actorSystem, int logComponent); + + void WriteData(const TLogRecord& rec) override; + + void ReopenLog() override { + } + +private: + NActors::TActorSystem* const ActorSystem; + const int LogComponent; +}; diff --git a/library/cpp/actors/prof/CMakeLists.darwin.txt b/library/cpp/actors/prof/CMakeLists.darwin.txt index da4124b232..931823e910 100644 --- a/library/cpp/actors/prof/CMakeLists.darwin.txt +++ b/library/cpp/actors/prof/CMakeLists.darwin.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(ut) add_library(cpp-actors-prof) target_link_libraries(cpp-actors-prof PUBLIC diff --git a/library/cpp/actors/prof/CMakeLists.linux-aarch64.txt b/library/cpp/actors/prof/CMakeLists.linux-aarch64.txt index a0ec95e1ab..901af0a04c 100644 --- a/library/cpp/actors/prof/CMakeLists.linux-aarch64.txt +++ b/library/cpp/actors/prof/CMakeLists.linux-aarch64.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(ut) add_library(cpp-actors-prof) target_link_libraries(cpp-actors-prof PUBLIC diff --git a/library/cpp/actors/prof/CMakeLists.linux.txt b/library/cpp/actors/prof/CMakeLists.linux.txt index a0ec95e1ab..901af0a04c 100644 --- a/library/cpp/actors/prof/CMakeLists.linux.txt +++ b/library/cpp/actors/prof/CMakeLists.linux.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(ut) add_library(cpp-actors-prof) target_link_libraries(cpp-actors-prof PUBLIC diff --git a/library/cpp/actors/prof/ut/CMakeLists.darwin.txt b/library/cpp/actors/prof/ut/CMakeLists.darwin.txt new file mode 100644 index 0000000000..67d708c798 --- /dev/null +++ b/library/cpp/actors/prof/ut/CMakeLists.darwin.txt @@ -0,0 +1,43 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-prof-ut) +target_include_directories(library-cpp-actors-prof-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/prof +) +target_link_libraries(library-cpp-actors-prof-ut PUBLIC + contrib-libs-cxxsupp + yutil + library-cpp-cpuid_check + cpp-testing-unittest_main + cpp-actors-prof +) +target_link_options(library-cpp-actors-prof-ut PRIVATE + -Wl,-no_deduplicate + -Wl,-sdk_version,10.15 + -fPIC + -fPIC + -framework + CoreFoundation +) +target_sources(library-cpp-actors-prof-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/prof/ut/tag_ut.cpp +) +add_test( + NAME + library-cpp-actors-prof-ut + COMMAND + library-cpp-actors-prof-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-prof-ut) diff --git a/library/cpp/actors/prof/ut/CMakeLists.linux-aarch64.txt b/library/cpp/actors/prof/ut/CMakeLists.linux-aarch64.txt new file mode 100644 index 0000000000..23ea1dc551 --- /dev/null +++ b/library/cpp/actors/prof/ut/CMakeLists.linux-aarch64.txt @@ -0,0 +1,46 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-prof-ut) +target_include_directories(library-cpp-actors-prof-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/prof +) +target_link_libraries(library-cpp-actors-prof-ut PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + library-cpp-lfalloc + cpp-testing-unittest_main + cpp-actors-prof +) +target_link_options(library-cpp-actors-prof-ut PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(library-cpp-actors-prof-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/prof/ut/tag_ut.cpp +) +add_test( + NAME + library-cpp-actors-prof-ut + COMMAND + library-cpp-actors-prof-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-prof-ut) diff --git a/library/cpp/actors/prof/ut/CMakeLists.linux.txt b/library/cpp/actors/prof/ut/CMakeLists.linux.txt new file mode 100644 index 0000000000..93b273cc5a --- /dev/null +++ b/library/cpp/actors/prof/ut/CMakeLists.linux.txt @@ -0,0 +1,48 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-prof-ut) +target_include_directories(library-cpp-actors-prof-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/prof +) +target_link_libraries(library-cpp-actors-prof-ut PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + cpp-malloc-tcmalloc + libs-tcmalloc-no_percpu_cache + library-cpp-cpuid_check + cpp-testing-unittest_main + cpp-actors-prof +) +target_link_options(library-cpp-actors-prof-ut PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(library-cpp-actors-prof-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/prof/ut/tag_ut.cpp +) +add_test( + NAME + library-cpp-actors-prof-ut + COMMAND + library-cpp-actors-prof-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-prof-ut) diff --git a/library/cpp/actors/prof/ut/CMakeLists.txt b/library/cpp/actors/prof/ut/CMakeLists.txt new file mode 100644 index 0000000000..3e0811fb22 --- /dev/null +++ b/library/cpp/actors/prof/ut/CMakeLists.txt @@ -0,0 +1,15 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux-aarch64.txt) +elseif (APPLE) + include(CMakeLists.darwin.txt) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux.txt) +endif() diff --git a/library/cpp/actors/testlib/CMakeLists.darwin.txt b/library/cpp/actors/testlib/CMakeLists.darwin.txt index 07cf982905..68e019a569 100644 --- a/library/cpp/actors/testlib/CMakeLists.darwin.txt +++ b/library/cpp/actors/testlib/CMakeLists.darwin.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(ut) add_library(cpp-actors-testlib) target_link_libraries(cpp-actors-testlib PUBLIC diff --git a/library/cpp/actors/testlib/CMakeLists.linux-aarch64.txt b/library/cpp/actors/testlib/CMakeLists.linux-aarch64.txt index 4f565a0769..5872ecbe19 100644 --- a/library/cpp/actors/testlib/CMakeLists.linux-aarch64.txt +++ b/library/cpp/actors/testlib/CMakeLists.linux-aarch64.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(ut) add_library(cpp-actors-testlib) target_link_libraries(cpp-actors-testlib PUBLIC diff --git a/library/cpp/actors/testlib/CMakeLists.linux.txt b/library/cpp/actors/testlib/CMakeLists.linux.txt index 4f565a0769..5872ecbe19 100644 --- a/library/cpp/actors/testlib/CMakeLists.linux.txt +++ b/library/cpp/actors/testlib/CMakeLists.linux.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(ut) add_library(cpp-actors-testlib) target_link_libraries(cpp-actors-testlib PUBLIC diff --git a/library/cpp/actors/testlib/ut/CMakeLists.darwin.txt b/library/cpp/actors/testlib/ut/CMakeLists.darwin.txt new file mode 100644 index 0000000000..84d04ab049 --- /dev/null +++ b/library/cpp/actors/testlib/ut/CMakeLists.darwin.txt @@ -0,0 +1,44 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-testlib-ut) +target_include_directories(library-cpp-actors-testlib-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/testlib +) +target_link_libraries(library-cpp-actors-testlib-ut PUBLIC + contrib-libs-cxxsupp + yutil + library-cpp-cpuid_check + cpp-testing-unittest_main + cpp-actors-testlib + cpp-actors-core +) +target_link_options(library-cpp-actors-testlib-ut PRIVATE + -Wl,-no_deduplicate + -Wl,-sdk_version,10.15 + -fPIC + -fPIC + -framework + CoreFoundation +) +target_sources(library-cpp-actors-testlib-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/testlib/decorator_ut.cpp +) +add_test( + NAME + library-cpp-actors-testlib-ut + COMMAND + library-cpp-actors-testlib-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-testlib-ut) diff --git a/library/cpp/actors/testlib/ut/CMakeLists.linux-aarch64.txt b/library/cpp/actors/testlib/ut/CMakeLists.linux-aarch64.txt new file mode 100644 index 0000000000..f943859b0e --- /dev/null +++ b/library/cpp/actors/testlib/ut/CMakeLists.linux-aarch64.txt @@ -0,0 +1,47 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-testlib-ut) +target_include_directories(library-cpp-actors-testlib-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/testlib +) +target_link_libraries(library-cpp-actors-testlib-ut PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + library-cpp-lfalloc + cpp-testing-unittest_main + cpp-actors-testlib + cpp-actors-core +) +target_link_options(library-cpp-actors-testlib-ut PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(library-cpp-actors-testlib-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/testlib/decorator_ut.cpp +) +add_test( + NAME + library-cpp-actors-testlib-ut + COMMAND + library-cpp-actors-testlib-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-testlib-ut) diff --git a/library/cpp/actors/testlib/ut/CMakeLists.linux.txt b/library/cpp/actors/testlib/ut/CMakeLists.linux.txt new file mode 100644 index 0000000000..0bbe2aceaf --- /dev/null +++ b/library/cpp/actors/testlib/ut/CMakeLists.linux.txt @@ -0,0 +1,49 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-testlib-ut) +target_include_directories(library-cpp-actors-testlib-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/testlib +) +target_link_libraries(library-cpp-actors-testlib-ut PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + cpp-malloc-tcmalloc + libs-tcmalloc-no_percpu_cache + library-cpp-cpuid_check + cpp-testing-unittest_main + cpp-actors-testlib + cpp-actors-core +) +target_link_options(library-cpp-actors-testlib-ut PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(library-cpp-actors-testlib-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/testlib/decorator_ut.cpp +) +add_test( + NAME + library-cpp-actors-testlib-ut + COMMAND + library-cpp-actors-testlib-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-testlib-ut) diff --git a/library/cpp/actors/testlib/ut/CMakeLists.txt b/library/cpp/actors/testlib/ut/CMakeLists.txt new file mode 100644 index 0000000000..3e0811fb22 --- /dev/null +++ b/library/cpp/actors/testlib/ut/CMakeLists.txt @@ -0,0 +1,15 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux-aarch64.txt) +elseif (APPLE) + include(CMakeLists.darwin.txt) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux.txt) +endif() diff --git a/library/cpp/actors/util/CMakeLists.darwin.txt b/library/cpp/actors/util/CMakeLists.darwin.txt index 19f683cb2a..5fef24f80e 100644 --- a/library/cpp/actors/util/CMakeLists.darwin.txt +++ b/library/cpp/actors/util/CMakeLists.darwin.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(ut) add_library(cpp-actors-util) target_link_libraries(cpp-actors-util PUBLIC diff --git a/library/cpp/actors/util/CMakeLists.linux-aarch64.txt b/library/cpp/actors/util/CMakeLists.linux-aarch64.txt index c6673cde78..d56c18be60 100644 --- a/library/cpp/actors/util/CMakeLists.linux-aarch64.txt +++ b/library/cpp/actors/util/CMakeLists.linux-aarch64.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(ut) add_library(cpp-actors-util) target_link_libraries(cpp-actors-util PUBLIC diff --git a/library/cpp/actors/util/CMakeLists.linux.txt b/library/cpp/actors/util/CMakeLists.linux.txt index c6673cde78..d56c18be60 100644 --- a/library/cpp/actors/util/CMakeLists.linux.txt +++ b/library/cpp/actors/util/CMakeLists.linux.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(ut) add_library(cpp-actors-util) target_link_libraries(cpp-actors-util PUBLIC diff --git a/library/cpp/actors/util/ut/CMakeLists.darwin.txt b/library/cpp/actors/util/ut/CMakeLists.darwin.txt new file mode 100644 index 0000000000..b7846d6e90 --- /dev/null +++ b/library/cpp/actors/util/ut/CMakeLists.darwin.txt @@ -0,0 +1,49 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-util-ut) +target_include_directories(library-cpp-actors-util-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util +) +target_link_libraries(library-cpp-actors-util-ut PUBLIC + contrib-libs-cxxsupp + yutil + library-cpp-cpuid_check + cpp-testing-unittest_main + cpp-actors-util +) +target_link_options(library-cpp-actors-util-ut PRIVATE + -Wl,-no_deduplicate + -Wl,-sdk_version,10.15 + -fPIC + -fPIC +) +target_sources(library-cpp-actors-util-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/cpu_load_log_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/memory_tracker_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/thread_load_log_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/rope_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/rc_buf_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/shared_data_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/shared_data_rope_backend_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/shared_data_native_rope_backend_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/unordered_cache_ut.cpp +) +add_test( + NAME + library-cpp-actors-util-ut + COMMAND + library-cpp-actors-util-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-util-ut) diff --git a/library/cpp/actors/util/ut/CMakeLists.linux-aarch64.txt b/library/cpp/actors/util/ut/CMakeLists.linux-aarch64.txt new file mode 100644 index 0000000000..2e5ec2d35a --- /dev/null +++ b/library/cpp/actors/util/ut/CMakeLists.linux-aarch64.txt @@ -0,0 +1,54 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-util-ut) +target_include_directories(library-cpp-actors-util-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util +) +target_link_libraries(library-cpp-actors-util-ut PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + library-cpp-lfalloc + cpp-testing-unittest_main + cpp-actors-util +) +target_link_options(library-cpp-actors-util-ut PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(library-cpp-actors-util-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/cpu_load_log_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/memory_tracker_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/thread_load_log_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/rope_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/rc_buf_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/shared_data_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/shared_data_rope_backend_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/shared_data_native_rope_backend_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/unordered_cache_ut.cpp +) +add_test( + NAME + library-cpp-actors-util-ut + COMMAND + library-cpp-actors-util-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-util-ut) diff --git a/library/cpp/actors/util/ut/CMakeLists.linux.txt b/library/cpp/actors/util/ut/CMakeLists.linux.txt new file mode 100644 index 0000000000..d67a9b544e --- /dev/null +++ b/library/cpp/actors/util/ut/CMakeLists.linux.txt @@ -0,0 +1,56 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(library-cpp-actors-util-ut) +target_include_directories(library-cpp-actors-util-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util +) +target_link_libraries(library-cpp-actors-util-ut PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + cpp-malloc-tcmalloc + libs-tcmalloc-no_percpu_cache + library-cpp-cpuid_check + cpp-testing-unittest_main + cpp-actors-util +) +target_link_options(library-cpp-actors-util-ut PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(library-cpp-actors-util-ut PRIVATE + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/cpu_load_log_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/memory_tracker_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/thread_load_log_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/rope_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/rc_buf_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/shared_data_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/shared_data_rope_backend_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/shared_data_native_rope_backend_ut.cpp + ${CMAKE_SOURCE_DIR}/library/cpp/actors/util/unordered_cache_ut.cpp +) +add_test( + NAME + library-cpp-actors-util-ut + COMMAND + library-cpp-actors-util-ut + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +vcs_info(library-cpp-actors-util-ut) diff --git a/library/cpp/actors/util/ut/CMakeLists.txt b/library/cpp/actors/util/ut/CMakeLists.txt new file mode 100644 index 0000000000..3e0811fb22 --- /dev/null +++ b/library/cpp/actors/util/ut/CMakeLists.txt @@ -0,0 +1,15 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux-aarch64.txt) +elseif (APPLE) + include(CMakeLists.darwin.txt) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE AND NOT ANDROID) + include(CMakeLists.linux.txt) +endif() |