diff --git a/third-party/mcrouter/mcrouter-CMakeLists.txt b/third-party/mcrouter/mcrouter-CMakeLists.txt index 980f3fa94e300..fb09baa792916 100644 --- a/third-party/mcrouter/mcrouter-CMakeLists.txt +++ b/third-party/mcrouter/mcrouter-CMakeLists.txt @@ -69,9 +69,19 @@ add_custom_command( "${CMAKE_CURRENT_BINARY_DIR}/mcrouter/mcrouter_sr_deps.h" COMMENT "Creating mcrouter_sr_deps.h symlink" ) +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/mcrouter/HostWithShard-fwd.h" + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/mcrouter/HostWithShard-fwd-impl.h" + COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/mcrouter" + COMMAND ${CMAKE_COMMAND} -E create_symlink + "${CMAKE_CURRENT_SOURCE_DIR}/mcrouter/HostWithShard-fwd-impl.h" + "${CMAKE_CURRENT_BINARY_DIR}/mcrouter/HostWithShard-fwd.h" + COMMENT "Creating HostWithShard-fwd.h symlink" +) list(APPEND CXX_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/mcrouter/RouterRegistry.h") list(APPEND CXX_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/mcrouter/ThriftAcceptor.h") list(APPEND CXX_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/mcrouter/mcrouter_sr_deps.h") +list(APPEND CXX_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/mcrouter/HostWithShard-fwd.h") list(APPEND CXX_SOURCES ${files}) add_definitions(-DNO_LIB_GFLAGS) @@ -100,4 +110,4 @@ target_include_directories(mcrouter PUBLIC "${CMAKE_CURRENT_BINARY_DIR}" "${JEMA install( TARGETS mcrouter LIBRARY ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} -) \ No newline at end of file +) diff --git a/third-party/mcrouter/src/mcrouter/CarbonRouterClient-inl.h b/third-party/mcrouter/src/mcrouter/CarbonRouterClient-inl.h index 0f2e1f723ddfc..3e2071321cb57 100644 --- a/third-party/mcrouter/src/mcrouter/CarbonRouterClient-inl.h +++ b/third-party/mcrouter/src/mcrouter/CarbonRouterClient-inl.h @@ -9,6 +9,7 @@ #include "mcrouter/CarbonRouterInstance.h" #include "mcrouter/ForEachPossibleClient.h" +#include "mcrouter/HostWithShard-fwd.h" #include "mcrouter/McrouterFiberContext.h" #include "mcrouter/ProxyRequestContextTyped.h" #include "mcrouter/lib/RouteHandleTraverser.h" diff --git a/third-party/mcrouter/src/mcrouter/HostWithShard-fwd-impl.h b/third-party/mcrouter/src/mcrouter/HostWithShard-fwd-impl.h new file mode 100644 index 0000000000000..c884ae78093b3 --- /dev/null +++ b/third-party/mcrouter/src/mcrouter/HostWithShard-fwd-impl.h @@ -0,0 +1,21 @@ +/* + * 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. + */ + +#pragma once + +#include +#include + +namespace facebook { +namespace memcache { + +class HostInfo; +using HostInfoPtr = std::shared_ptr; +using HostWithShard = std::pair; + +} // namespace memcache +} // namespace facebook diff --git a/third-party/mcrouter/src/mcrouter/configure.ac b/third-party/mcrouter/src/mcrouter/configure.ac index 1c8deaa2cb301..64ac5860e8687 100644 --- a/third-party/mcrouter/src/mcrouter/configure.ac +++ b/third-party/mcrouter/src/mcrouter/configure.ac @@ -33,6 +33,7 @@ AC_CONFIG_LINKS([test/config.py:test/mcrouter_config.py]) AC_CONFIG_LINKS([RouterRegistry.h:RouterRegistry-impl.h]) AC_CONFIG_LINKS([ThriftAcceptor.h:ThriftAcceptor-impl.h]) AC_CONFIG_LINKS([mcrouter_sr_deps.h:mcrouter_sr_deps-impl.h]) +AC_CONFIG_LINKS([HostWithShard-fwd.h:HostWithShard-fwd-impl.h]) AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE([1.14 foreign dist-bzip2 nostdinc subdir-objects parallel-tests]) diff --git a/third-party/mcrouter/src/mcrouter/lib/RouteHandleTraverser.h b/third-party/mcrouter/src/mcrouter/lib/RouteHandleTraverser.h index 4621b96f5a4e0..92f2f192bc9de 100644 --- a/third-party/mcrouter/src/mcrouter/lib/RouteHandleTraverser.h +++ b/third-party/mcrouter/src/mcrouter/lib/RouteHandleTraverser.h @@ -12,6 +12,7 @@ #include #include +#include "mcrouter/HostWithShard-fwd.h" #include "mcrouter/McrouterFiberContext.h" #include "mcrouter/lib/PoolContext.h" #include "mcrouter/lib/network/AccessPoint.h"