Skip to content

Commit

Permalink
Consolidate libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
mszabo-wikia committed Jul 28, 2024
1 parent df12f32 commit 1f20dec
Show file tree
Hide file tree
Showing 14 changed files with 109 additions and 192 deletions.
49 changes: 35 additions & 14 deletions mcrouter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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
Expand Down
72 changes: 57 additions & 15 deletions mcrouter/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 0 additions & 7 deletions mcrouter/lib/carbon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
10 changes: 0 additions & 10 deletions mcrouter/lib/carbon/connection/CMakeLists.txt

This file was deleted.

7 changes: 3 additions & 4 deletions mcrouter/lib/carbon/example/gen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 2 additions & 3 deletions mcrouter/lib/carbon/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 2 additions & 3 deletions mcrouter/lib/invalidation/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
53 changes: 0 additions & 53 deletions mcrouter/lib/network/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
21 changes: 0 additions & 21 deletions mcrouter/lib/network/gen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
12 changes: 4 additions & 8 deletions mcrouter/lib/network/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
13 changes: 2 additions & 11 deletions mcrouter/lib/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Loading

0 comments on commit 1f20dec

Please sign in to comment.