diff --git a/mcrouter/CMakeLists.txt b/mcrouter/CMakeLists.txt index 30b368a2f..022c4da40 100644 --- a/mcrouter/CMakeLists.txt +++ b/mcrouter/CMakeLists.txt @@ -63,17 +63,15 @@ add_library( CarbonRouterInstance.cpp CarbonRouterInstanceBase.cpp ConfigApi.cpp + ExternalStatsHandler.cpp FileDataProvider.cpp FileObserver.cpp - flavor.cpp LeaseTokenMap.cpp - mcrouter_config.cpp + McSpoolUtils.cpp McrouterFiberContext.cpp McrouterLogFailure.cpp McrouterLogger.cpp McrouterManager.cpp - McSpoolUtils.cpp - options.cpp OptionsUtil.cpp PoolFactory.cpp ProxyBase.cpp @@ -84,24 +82,52 @@ add_library( ProxyDestinationMap.cpp ProxyRequestContext.cpp ProxyStats.cpp - route.cpp RoutingPrefix.cpp RuntimeVarsData.cpp ServiceInfo.cpp - stats.cpp ThreadUtil.cpp ThriftAcceptor.cpp TkoLog.cpp TkoTracker.cpp - ExternalStatsHandler.cpp) + flavor.cpp + mcrouter_config.cpp + options.cpp + route.cpp + routes/BigValueRoute.cpp + routes/CarbonLookasideRoute.cpp + routes/FailoverRateLimiter.cpp + routes/HashStopAllowListRoute.cpp + routes/KeyParseRoute.cpp + routes/LatencyInjectionRoute.cpp + routes/McBucketRoute.cpp + routes/McImportResolver.cpp + routes/McRouteHandleProvider-AllFastestRoute.cpp + routes/McRouteHandleProvider-CarbonLookasideRoute.cpp + routes/McRouteHandleProvider-FailoverRoute.cpp + routes/McRouteHandleProvider-HashRoute.cpp + routes/McRouteHandleProvider-PoolRoute.cpp + routes/McRouteHandleProvider.cpp + routes/NullRoute.cpp + routes/RateLimiter.cpp + routes/RendezvousRouteHelpers.cpp + routes/ShadowSettings.cpp + routes/ShardHashFunc.cpp + routes/ShardSelectionRouteFactory.cpp + routes/ShardSplitRoute.cpp + routes/ShardSplitter.cpp + routes/SlowWarmUpRouteSettings.cpp + routes/StagingRoute.cpp + routes/WarmUpRoute.cpp + stats.cpp) add_dependencies(mcroutercore mcrouter_symlink_headers) target_link_libraries( mcroutercore - PUBLIC mcrouter_routes mcrouter_carbon_result_thrift mcrouter_carbon_thrift + PUBLIC mcrouter_carbon_result_thrift mcrouter_carbon_thrift mcrouter_common_thrift mcrouter_memcache_thrift memcache_service_thrift - PRIVATE mcrouter_invalidation FBThrift::thriftcpp2 Folly::folly atomic) + Folly::folly + PRIVATE mcrouter_invalidation FBThrift::thriftcpp2 atomic) add_executable(mcrouter main.cpp RequestAclChecker.cpp StandaloneConfig.cpp StandaloneUtils.cpp) @@ -113,11 +139,6 @@ target_link_libraries( Folly::folly FBThrift::thriftcpp2 FBThrift::async - mcrouter_carbon_result_thrift - mcrouter_carbon_thrift - mcrouter_common_thrift - mcrouter_memcache_thrift - memcache_service_thrift FBThrift::serverdbginfo FBThrift::transport FBThrift::thriftanyrep diff --git a/mcrouter/lib/CMakeLists.txt b/mcrouter/lib/CMakeLists.txt index 9e2013a23..3d8a51349 100644 --- a/mcrouter/lib/CMakeLists.txt +++ b/mcrouter/lib/CMakeLists.txt @@ -35,37 +35,79 @@ add_library(mcrouter_thread_pools AuxiliaryCPUThreadPool.cpp target_link_libraries(mcrouter_thread_pools PRIVATE Folly::folly) -add_library(mcrouter_fiber_local FiberLocalInternal.cpp) +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/network/McAsciiParser-gen.cpp + COMMAND ragel -G1 ${CMAKE_CURRENT_SOURCE_DIR}/network/McAsciiParser.rl -o + ${CMAKE_CURRENT_BINARY_DIR}/network/McAsciiParser-gen.cpp + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/network/McAsciiParser.rl + VERBATIM) -target_link_libraries(mcrouter_fiber_local PRIVATE Folly::folly) - -add_library(mcrouter_failover_errors_settings FailoverErrorsSettingsBase.cpp) - -target_link_libraries( - mcrouter_failover_errors_settings - PRIVATE mcrouter_fbi mcrouter_mc_protocol mcrouter_network_messages - Folly::folly FBThrift::thriftcpp2) - -add_library(mcrouterinternal MessageQueue.cpp StatsReply.cpp) +add_library( + mcrouterinternal + FailoverErrorsSettingsBase.cpp + FiberLocalInternal.cpp + MessageQueue.cpp + StatsReply.cpp + carbon/CmdLineClient.cpp + carbon/JsonClient.cpp + carbon/connection/ExternalCarbonConnectionImpl.cpp + network/AccessPoint.cpp + network/AsciiSerialized.cpp + network/AsyncMcClientImpl.cpp + network/AsyncMcServer.cpp + network/AsyncMcServerWorker.cpp + network/AsyncTlsToPlaintextSocket.cpp + network/CaretProtocol.cpp + network/ConnectionTracker.cpp + network/CpuController.cpp + network/FailureDomains.cpp + network/FizzContextProvider.cpp + network/McAsciiParser-gen.cpp + network/McAsciiParser.cpp + network/McClientRequestContext.cpp + network/McParser.cpp + network/McSSLUtil.cpp + network/McSerializedRequest.cpp + network/McServerRequestContext.cpp + network/McServerRequestContext.cpp + network/McServerSession.cpp + network/McServerThriftRequestContext.cpp + network/MultiOpParent.cpp + network/Qos.cpp + network/SecurityOptions.cpp + network/ServerLoad.cpp + network/SocketConnector.cpp + network/SocketUtil.cpp + network/ThreadLocalSSLContextProvider.cpp + network/ThriftTransport.cpp + network/WriteBuffer.cpp + network/gen/CommonMessages.cpp + network/gen/CommonMessagesThrift.cpp + network/gen/MemcacheMessages.cpp + network/gen/MemcacheMessagesThrift.cpp + network/gen/MemcacheRouterInfo-AllFastestRoute.cpp + network/gen/MemcacheRouterInfo-BuildExtraProvider.cpp + network/gen/MemcacheRouterInfo-ExternTemplate.cpp + network/gen/MemcacheRouterInfo-FailoverRoute.cpp + network/gen/MemcacheRouterInfo-HashRoute.cpp + network/gen/MemcacheRouterInfo.cpp) target_link_libraries( mcrouterinternal PUBLIC mcrouter_fbi mcrouter_config mcrouter_debug - mcrouter_network_messages mcrouter_hash_functions mcrouter_compression_codecs mcrouter_thread_pools mcrouter_carbon_protocol mcrouter_mc_protocol - mcrouter_network - mcrouter_failover_errors_settings mcrouter_carbon_result_thrift mcrouter_carbon_thrift mcrouter_common_thrift mcrouter_memcache_thrift - memcache_service_thrift) + memcache_service_thrift + PRIVATE mcrouter_clocks) add_subdirectory(carbon) add_subdirectory(config) diff --git a/mcrouter/lib/carbon/CMakeLists.txt b/mcrouter/lib/carbon/CMakeLists.txt index 72e591497..e41bbd0b6 100644 --- a/mcrouter/lib/carbon/CMakeLists.txt +++ b/mcrouter/lib/carbon/CMakeLists.txt @@ -15,12 +15,5 @@ target_link_libraries( PRIVATE mcrouter_carbon_result_thrift Folly::folly PUBLIC FBThrift::thriftcpp2) -add_library(mcrouter_carbon_clients CmdLineClient.cpp JsonClient.cpp) - -target_link_libraries( - mcrouter_carbon_clients PRIVATE mcrouterinternal Folly::folly - FBThrift::thriftcpp2) - -add_subdirectory(connection) add_subdirectory(example) add_subdirectory(test) diff --git a/mcrouter/lib/carbon/connection/CMakeLists.txt b/mcrouter/lib/carbon/connection/CMakeLists.txt deleted file mode 100644 index df99a9135..000000000 --- a/mcrouter/lib/carbon/connection/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# -# This source code is licensed under the MIT license found in the LICENSE file -# in the root directory of this source tree. - -add_library(mcrouter_carbon_connection ExternalCarbonConnectionImpl.cpp) - -target_link_libraries( - mcrouter_carbon_connection PRIVATE mcrouter_network_messages Folly::folly - FBThrift::thriftcpp2) diff --git a/mcrouter/lib/carbon/example/gen/CMakeLists.txt b/mcrouter/lib/carbon/example/gen/CMakeLists.txt index 9829051c2..a59e39958 100644 --- a/mcrouter/lib/carbon/example/gen/CMakeLists.txt +++ b/mcrouter/lib/carbon/example/gen/CMakeLists.txt @@ -39,11 +39,10 @@ add_dependencies(mcrouter_hello_goodbye mcrouter_symlink_headers) target_link_libraries( mcrouter_hello_goodbye PUBLIC mcrouter_hello_goodbye_service_thrift mcrouter_hello_goodbye_messages - PRIVATE mcrouter_carbon_connection mcrouter_routes Folly::folly - FBThrift::thriftcpp2) + PRIVATE mcrouterinternal Folly::folly FBThrift::thriftcpp2) add_executable(mcrouter_hello_goodbye_client_tool HelloGoodbyeClientTool.cpp) target_link_libraries( - mcrouter_hello_goodbye_client_tool - PRIVATE mcrouter_hello_goodbye_messages mcrouter_carbon_clients Folly::folly) + mcrouter_hello_goodbye_client_tool PRIVATE mcrouter_hello_goodbye_messages + mcrouterinternal Folly::folly) diff --git a/mcrouter/lib/carbon/test/CMakeLists.txt b/mcrouter/lib/carbon/test/CMakeLists.txt index 2637068a3..2c5ca7033 100644 --- a/mcrouter/lib/carbon/test/CMakeLists.txt +++ b/mcrouter/lib/carbon/test/CMakeLists.txt @@ -22,8 +22,7 @@ add_executable( VariantTest.cpp) target_link_libraries( - mcrouter_carbon_tests - PRIVATE mcrouter_carbon_protocol mcrouter_carbon_clients GTest::gtest - Folly::folly) + mcrouter_carbon_tests PRIVATE mcrouter_carbon_protocol mcrouterinternal + GTest::gtest Folly::folly) gtest_discover_tests(mcrouter_carbon_tests) diff --git a/mcrouter/lib/invalidation/test/CMakeLists.txt b/mcrouter/lib/invalidation/test/CMakeLists.txt index 86545624c..f265eede9 100644 --- a/mcrouter/lib/invalidation/test/CMakeLists.txt +++ b/mcrouter/lib/invalidation/test/CMakeLists.txt @@ -12,6 +12,5 @@ add_executable( McInvalidationKvPairsTest.cpp) target_link_libraries( - mcrouter_invalidation_tests - PRIVATE mcrouter_invalidation mcrouter_network_messages Folly::folly - GTest::gtest) + mcrouter_invalidation_tests PRIVATE mcrouter_invalidation mcrouterinternal + Folly::folly GTest::gtest) diff --git a/mcrouter/lib/network/CMakeLists.txt b/mcrouter/lib/network/CMakeLists.txt index ce91da7fc..e31b0c75e 100644 --- a/mcrouter/lib/network/CMakeLists.txt +++ b/mcrouter/lib/network/CMakeLists.txt @@ -3,58 +3,5 @@ # This source code is licensed under the MIT license found in the LICENSE file # in the root directory of this source tree. -add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/McAsciiParser-gen.cpp - COMMAND ragel -G1 ${CMAKE_CURRENT_SOURCE_DIR}/McAsciiParser.rl -o - ${CMAKE_CURRENT_BINARY_DIR}/McAsciiParser-gen.cpp - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/McAsciiParser.rl - VERBATIM) - -add_library( - mcrouter_network - AccessPoint.cpp - AsciiSerialized.cpp - AsyncMcClientImpl.cpp - AsyncTlsToPlaintextSocket.cpp - CaretProtocol.cpp - FailureDomains.cpp - FizzContextProvider.cpp - McClientRequestContext.cpp - McSerializedRequest.cpp - McSSLUtil.cpp - Qos.cpp - SecurityOptions.cpp - ServerLoad.cpp - SocketConnector.cpp - SocketUtil.cpp - ThreadLocalSSLContextProvider.cpp - ThriftTransport.cpp - WriteBuffer.cpp - McAsciiParser-gen.cpp - McAsciiParser.cpp - McParser.cpp - AsyncMcServer.cpp - AsyncMcServerWorker.cpp - ConnectionTracker.cpp - CpuController.cpp - McServerRequestContext.cpp - McServerRequestContext.cpp - McServerSession.cpp - McServerThriftRequestContext.cpp - MultiOpParent.cpp) - -target_link_libraries( - mcrouter_network - PUBLIC Folly::folly - PRIVATE mcrouter_clocks - mcrouter_carbon_protocol - mcrouter_memcache_thrift - mcrouter_debug - mcrouter_thread_pools - mcrouter_compression_codecs - mcrouter_utils - fizz::fizz - FBThrift::thriftcpp2) - add_subdirectory(gen) add_subdirectory(test) diff --git a/mcrouter/lib/network/gen/CMakeLists.txt b/mcrouter/lib/network/gen/CMakeLists.txt index ee4d312e1..fcf4d2428 100644 --- a/mcrouter/lib/network/gen/CMakeLists.txt +++ b/mcrouter/lib/network/gen/CMakeLists.txt @@ -19,24 +19,3 @@ add_fbthrift_cpp_library( Memcache OPTIONS "${THRIFT_OPTIONS}") - -add_library( - mcrouter_network_messages CommonMessages.cpp CommonMessagesThrift.cpp - MemcacheMessages.cpp MemcacheMessagesThrift.cpp) - -target_link_libraries( - mcrouter_network_messages - PUBLIC mcrouter_common_thrift mcrouter_memcache_thrift - mcrouter_carbon_protocol) - -add_library( - mcrouter_memcache_router_info - MemcacheRouterInfo.cpp - MemcacheRouterInfo-AllFastestRoute.cpp - MemcacheRouterInfo-FailoverRoute.cpp - MemcacheRouterInfo-HashRoute.cpp - MemcacheRouterInfo-BuildExtraProvider.cpp - MemcacheRouterInfo-ExternTemplate.cpp) - -target_link_libraries(mcrouter_memcache_router_info - PUBLIC mcrouter_network_messages Folly::folly) diff --git a/mcrouter/lib/network/test/CMakeLists.txt b/mcrouter/lib/network/test/CMakeLists.txt index 8a7307f7f..0e7650b91 100644 --- a/mcrouter/lib/network/test/CMakeLists.txt +++ b/mcrouter/lib/network/test/CMakeLists.txt @@ -11,8 +11,7 @@ add_executable(mcrouter_mock_mc_server MockMc.cpp MockMcServer.cpp) target_link_libraries( mcrouter_mock_mc_server - PRIVATE mcrouter_network - mcrouterinternal + PRIVATE mcrouterinternal Folly::folly FBThrift::thriftcpp2 FBThrift::async @@ -33,8 +32,7 @@ add_executable(mcrouter_mock_mc_thrift_server MockMc.cpp MockMcThriftServer.cpp) target_link_libraries( mcrouter_mock_mc_thrift_server - PRIVATE mcrouter_network - memcache_service_thrift + PRIVATE memcache_service_thrift mcrouterinternal Folly::folly FBThrift::thriftcpp2 @@ -56,8 +54,7 @@ add_executable(mcrouter_mock_mc_server_dual MockMc.cpp MockMcServerDual.cpp) target_link_libraries( mcrouter_mock_mc_server_dual - PRIVATE mcrouter_network - memcache_service_thrift + PRIVATE memcache_service_thrift mcrouterinternal Folly::folly FBThrift::thriftcpp2 @@ -97,9 +94,8 @@ add_executable( target_link_libraries( mcrouter_network_tests - PRIVATE mcrouter_network + PRIVATE mcrouterinternal mcrouter_network_tests_gen - mcrouter_network_messages Folly::folly GTest::gtest FBThrift::thriftcpp2 diff --git a/mcrouter/lib/test/CMakeLists.txt b/mcrouter/lib/test/CMakeLists.txt index 098c1284f..fa0142113 100644 --- a/mcrouter/lib/test/CMakeLists.txt +++ b/mcrouter/lib/test/CMakeLists.txt @@ -31,17 +31,8 @@ add_executable( WeightedRendezvousHashTest.cpp) target_link_libraries( - mcrouter_lib_tests - PRIVATE mcrouter_compression_codecs - mcrouter_hash_functions - mcrouter_fiber_local - mcrouter_utils - mcrouter_memcache_thrift - mcroutercore - GTest::gtest - Folly::folly - Folly::follybenchmark - FBThrift::thriftcpp2) + mcrouter_lib_tests PRIVATE mcrouterinternal GTest::gtest Folly::folly + Folly::follybenchmark FBThrift::thriftcpp2) add_executable(mcrouter_weighted_hash_benchmark WeightedHashBenchmark.cpp) diff --git a/mcrouter/routes/CMakeLists.txt b/mcrouter/routes/CMakeLists.txt index 8de032adf..9fed1a24d 100644 --- a/mcrouter/routes/CMakeLists.txt +++ b/mcrouter/routes/CMakeLists.txt @@ -3,43 +3,4 @@ # This source code is licensed under the MIT license found in the LICENSE file # in the root directory of this source tree. -add_library( - mcrouter_routes - BigValueRoute.cpp - CarbonLookasideRoute.cpp - FailoverRateLimiter.cpp - HashStopAllowListRoute.cpp - KeyParseRoute.cpp - LatencyInjectionRoute.cpp - McBucketRoute.cpp - McImportResolver.cpp - McRouteHandleProvider.cpp - McRouteHandleProvider-AllFastestRoute.cpp - McRouteHandleProvider-CarbonLookasideRoute.cpp - McRouteHandleProvider-FailoverRoute.cpp - McRouteHandleProvider-HashRoute.cpp - McRouteHandleProvider-PoolRoute.cpp - NullRoute.cpp - RateLimiter.cpp - RendezvousRouteHelpers.cpp - ShadowSettings.cpp - ShardHashFunc.cpp - ShardSelectionRouteFactory.cpp - ShardSplitRoute.cpp - ShardSplitter.cpp - SlowWarmUpRouteSettings.cpp - StagingRoute.cpp - WarmUpRoute.cpp) - -target_link_libraries( - mcrouter_routes - PUBLIC mcrouter_memcache_router_info - PRIVATE mcroutercore - mcrouterinternal - mcrouter_network_messages - mcrouter_failover_errors_settings - mcrouter_utils - Folly::folly - FBThrift::thriftcpp2) - add_subdirectory(test) diff --git a/mcrouter/routes/test/CMakeLists.txt b/mcrouter/routes/test/CMakeLists.txt index 586a6eead..9b23e8ea8 100644 --- a/mcrouter/routes/test/CMakeLists.txt +++ b/mcrouter/routes/test/CMakeLists.txt @@ -46,7 +46,7 @@ add_executable( WarmUpRouteTest.cpp) target_link_libraries( - mcrouter_routes_tests PRIVATE mcrouter_hello_goodbye mcrouter_routes + mcrouter_routes_tests PRIVATE mcrouter_hello_goodbye mcroutercore GTest::gtest Folly::folly FBThrift::thriftcpp2) gtest_discover_tests(mcrouter_routes_tests) diff --git a/mcrouter/test/cpp_unit_tests/CMakeLists.txt b/mcrouter/test/cpp_unit_tests/CMakeLists.txt index acad0ce6e..37a0a5c90 100644 --- a/mcrouter/test/cpp_unit_tests/CMakeLists.txt +++ b/mcrouter/test/cpp_unit_tests/CMakeLists.txt @@ -10,18 +10,18 @@ endif() add_executable( cpp_unit_tests "${CMAKE_SOURCE_DIR}/mcrouter/test/main.cpp" + LeaseTokenMapTest.cpp + McrouterClientUsage.cpp + ProxyRequestContextTest.cpp awriter_test.cpp config_api_test.cpp exponential_smooth_data_test.cpp file_observer_test.cpp flavor_test.cpp - LeaseTokenMapTest.cpp mc_route_handle_provider_test.cpp - McrouterClientUsage.cpp observable_test.cpp options_test.cpp pool_factory_test.cpp - ProxyRequestContextTest.cpp route_test.cpp runtime_vars_data_test.cpp)