diff --git a/mcrouter/lib/carbon/RoutingGroups.h b/mcrouter/lib/carbon/RoutingGroups.h index b3cd9da5..8f23e0c4 100644 --- a/mcrouter/lib/carbon/RoutingGroups.h +++ b/mcrouter/lib/carbon/RoutingGroups.h @@ -40,9 +40,7 @@ constexpr auto kUpdateKey = folly::makeFixedString("update_like"); * Request is get-like. */ template -struct GetLike { - static const bool value = false; -}; +struct GetLike; template using GetLikeT = typename GetLike::Type; @@ -57,9 +55,7 @@ using GetLikeT = typename GetLike::Type; * Request is update-like. */ template -struct UpdateLike { - static const bool value = false; -}; +struct UpdateLike; template using UpdateLikeT = typename UpdateLike::Type; @@ -74,9 +70,7 @@ using UpdateLikeT = typename UpdateLike::Type; * Request is delete-like. */ template -struct DeleteLike { - static const bool value = false; -}; +struct DeleteLike; template using DeleteLikeT = typename DeleteLike::Type; @@ -92,9 +86,7 @@ using DeleteLikeT = typename DeleteLike::Type; * Request is arithmetic-like. */ template -struct ArithmeticLike { - static const bool value = false; -}; +struct ArithmeticLike; template using ArithmeticLikeT = typename ArithmeticLike::Type; diff --git a/mcrouter/lib/carbon/example/HelloGoodbye.idl b/mcrouter/lib/carbon/example/HelloGoodbye.idl index f6b70a6e..99d86ce0 100644 --- a/mcrouter/lib/carbon/example/HelloGoodbye.idl +++ b/mcrouter/lib/carbon/example/HelloGoodbye.idl @@ -60,6 +60,12 @@ service { DuplicateRoute @ "mcrouter/lib/carbon/example/DuplicateRoute.h", CarbonLookasideRoute @ "mcrouter/lib/carbon/example/CarbonLookasideRoute.h" ]; + routing_groups: { + no_group: [ + HelloRequest, + GoodbyeRequest, + ] + }; gen_client_tool: true; compression_by_type: true; }; diff --git a/mcrouter/lib/carbon/example/gen/HelloGoodbyeRouterInfo.h b/mcrouter/lib/carbon/example/gen/HelloGoodbyeRouterInfo.h index da751388..0fbfa8e4 100644 --- a/mcrouter/lib/carbon/example/gen/HelloGoodbyeRouterInfo.h +++ b/mcrouter/lib/carbon/example/gen/HelloGoodbyeRouterInfo.h @@ -24,6 +24,7 @@ #include "mcrouter/lib/carbon/example/gen/HelloGoodbyeRouteHandleIf.h" #include "mcrouter/lib/carbon/example/gen/HelloGoodbyeRouterStats.h" +#include "mcrouter/lib/carbon/example/gen/HelloGoodbyeRoutingGroups.h" // Forward declarations namespace folly { diff --git a/mcrouter/lib/carbon/example/gen/HelloGoodbyeRoutingGroups.h b/mcrouter/lib/carbon/example/gen/HelloGoodbyeRoutingGroups.h new file mode 100644 index 00000000..c732ef4f --- /dev/null +++ b/mcrouter/lib/carbon/example/gen/HelloGoodbyeRoutingGroups.h @@ -0,0 +1,66 @@ +/* + * 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. + * + */ + +/* + * THIS FILE IS AUTOGENERATED. DO NOT MODIFY IT; ALL CHANGES WILL BE LOST IN + * VAIN. + * + * @generated + */ +#pragma once + +#include + +#include "mcrouter/lib/carbon/example/gen/HelloGoodbyeMessages.h" + +namespace carbon { + +// ArithmeticLike +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +// DeleteLike +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +// GetLike +template <> +struct GetLike { + static const bool value = false; +}; + +template <> +struct GetLike { + static const bool value = false; +}; + +// UpdateLike +template <> +struct UpdateLike { + static const bool value = false; +}; + +template <> +struct UpdateLike { + static const bool value = false; +}; +} // namespace carbon diff --git a/mcrouter/lib/carbon/test/A.idl b/mcrouter/lib/carbon/test/A.idl index cd173729..c8fd3265 100644 --- a/mcrouter/lib/carbon/test/A.idl +++ b/mcrouter/lib/carbon/test/A.idl @@ -29,4 +29,10 @@ reply TestAReply { service { enable_shutdown: true; + + routing_groups: { + no_group: [ + TestARequest, + ] + }; }; diff --git a/mcrouter/lib/carbon/test/B.idl b/mcrouter/lib/carbon/test/B.idl index e22c1b30..82142632 100644 --- a/mcrouter/lib/carbon/test/B.idl +++ b/mcrouter/lib/carbon/test/B.idl @@ -28,4 +28,10 @@ reply TestBReply { service { enable_shutdown: true; + + routing_groups: { + no_group: [ + TestBRequest, + ] + }; }; diff --git a/mcrouter/lib/carbon/test/CarbonTest.idl b/mcrouter/lib/carbon/test/CarbonTest.idl index 4c389da5..220ebefa 100644 --- a/mcrouter/lib/carbon/test/CarbonTest.idl +++ b/mcrouter/lib/carbon/test/CarbonTest.idl @@ -202,4 +202,11 @@ struct StructWithOptionalEnumInt8 { service { enable_shutdown: true; + + routing_groups: { + no_group: [ + TestRequest, + TestRequestStringKey, + ] + }; }; diff --git a/mcrouter/lib/carbon/test/CarbonThriftTest.idl b/mcrouter/lib/carbon/test/CarbonThriftTest.idl index ee71e86e..655c59cd 100644 --- a/mcrouter/lib/carbon/test/CarbonThriftTest.idl +++ b/mcrouter/lib/carbon/test/CarbonThriftTest.idl @@ -111,4 +111,12 @@ service { enable_shutdown: true; gen_client_tool: false; thrift_tm_thread: true; + + routing_groups: { + no_group: [ + ThriftTestRequest, + DummyThriftRequest, + CustomRequest, + ] + }; }; diff --git a/mcrouter/lib/carbon/test/JsonClientTest.cpp b/mcrouter/lib/carbon/test/JsonClientTest.cpp index 2dd1d881..f7fcaf7a 100644 --- a/mcrouter/lib/carbon/test/JsonClientTest.cpp +++ b/mcrouter/lib/carbon/test/JsonClientTest.cpp @@ -13,6 +13,7 @@ #include "mcrouter/lib/carbon/CmdLineClient.h" #include "mcrouter/lib/carbon/JsonClient.h" #include "mcrouter/lib/carbon/test/gen/CarbonTest.h" +#include "mcrouter/lib/carbon/test/gen/CarbonTestRoutingGroups.h" #include "mcrouter/lib/mc/msg.h" #include "mcrouter/lib/network/AsyncMcServer.h" #include "mcrouter/lib/network/AsyncMcServerWorker.h" diff --git a/mcrouter/lib/carbon/test/gen/ARouteHandleIf.h b/mcrouter/lib/carbon/test/gen/ARouteHandleIf.h index bea3001a..dace6b28 100644 --- a/mcrouter/lib/carbon/test/gen/ARouteHandleIf.h +++ b/mcrouter/lib/carbon/test/gen/ARouteHandleIf.h @@ -20,6 +20,7 @@ #include #include "mcrouter/lib/carbon/test/gen/AMessages.h" +#include "mcrouter/lib/carbon/test/gen/BRoutingGroups.h" namespace carbon { namespace test { diff --git a/mcrouter/lib/carbon/test/gen/ARouterInfo.h b/mcrouter/lib/carbon/test/gen/ARouterInfo.h index c9f4616f..0b25bf15 100644 --- a/mcrouter/lib/carbon/test/gen/ARouterInfo.h +++ b/mcrouter/lib/carbon/test/gen/ARouterInfo.h @@ -24,6 +24,7 @@ #include "mcrouter/lib/carbon/test/gen/ARouteHandleIf.h" #include "mcrouter/lib/carbon/test/gen/ARouterStats.h" +#include "mcrouter/lib/carbon/test/gen/ARoutingGroups.h" // Forward declarations namespace folly { diff --git a/mcrouter/lib/carbon/test/gen/ARoutingGroups.h b/mcrouter/lib/carbon/test/gen/ARoutingGroups.h new file mode 100644 index 00000000..22213690 --- /dev/null +++ b/mcrouter/lib/carbon/test/gen/ARoutingGroups.h @@ -0,0 +1,46 @@ +/* + * 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. + * + */ + +/* + * THIS FILE IS AUTOGENERATED. DO NOT MODIFY IT; ALL CHANGES WILL BE LOST IN + * VAIN. + * + * @generated + */ +#pragma once + +#include + +#include "mcrouter/lib/carbon/test/gen/AMessages.h" + +namespace carbon { + +// ArithmeticLike +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +// DeleteLike +template <> +struct DeleteLike { + static const bool value = false; +}; + +// GetLike +template <> +struct GetLike { + static const bool value = false; +}; + +// UpdateLike +template <> +struct UpdateLike { + static const bool value = false; +}; +} // namespace carbon diff --git a/mcrouter/lib/carbon/test/gen/BRouterInfo.h b/mcrouter/lib/carbon/test/gen/BRouterInfo.h index 81387bc5..53b8070f 100644 --- a/mcrouter/lib/carbon/test/gen/BRouterInfo.h +++ b/mcrouter/lib/carbon/test/gen/BRouterInfo.h @@ -24,6 +24,7 @@ #include "mcrouter/lib/carbon/test/gen/BRouteHandleIf.h" #include "mcrouter/lib/carbon/test/gen/BRouterStats.h" +#include "mcrouter/lib/carbon/test/gen/BRoutingGroups.h" // Forward declarations namespace folly { diff --git a/mcrouter/lib/carbon/test/gen/BRoutingGroups.h b/mcrouter/lib/carbon/test/gen/BRoutingGroups.h new file mode 100644 index 00000000..1b16d2ec --- /dev/null +++ b/mcrouter/lib/carbon/test/gen/BRoutingGroups.h @@ -0,0 +1,46 @@ +/* + * 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. + * + */ + +/* + * THIS FILE IS AUTOGENERATED. DO NOT MODIFY IT; ALL CHANGES WILL BE LOST IN + * VAIN. + * + * @generated + */ +#pragma once + +#include + +#include "mcrouter/lib/carbon/test/gen/BMessages.h" + +namespace carbon { + +// ArithmeticLike +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +// DeleteLike +template <> +struct DeleteLike { + static const bool value = false; +}; + +// GetLike +template <> +struct GetLike { + static const bool value = false; +}; + +// UpdateLike +template <> +struct UpdateLike { + static const bool value = false; +}; +} // namespace carbon diff --git a/mcrouter/lib/carbon/test/gen/CarbonTestRouterInfo.h b/mcrouter/lib/carbon/test/gen/CarbonTestRouterInfo.h index 891c7393..594fb474 100644 --- a/mcrouter/lib/carbon/test/gen/CarbonTestRouterInfo.h +++ b/mcrouter/lib/carbon/test/gen/CarbonTestRouterInfo.h @@ -24,6 +24,7 @@ #include "mcrouter/lib/carbon/test/gen/CarbonTestRouteHandleIf.h" #include "mcrouter/lib/carbon/test/gen/CarbonTestRouterStats.h" +#include "mcrouter/lib/carbon/test/gen/CarbonTestRoutingGroups.h" // Forward declarations namespace folly { diff --git a/mcrouter/lib/carbon/test/gen/CarbonTestRoutingGroups.h b/mcrouter/lib/carbon/test/gen/CarbonTestRoutingGroups.h new file mode 100644 index 00000000..4a0ac82e --- /dev/null +++ b/mcrouter/lib/carbon/test/gen/CarbonTestRoutingGroups.h @@ -0,0 +1,66 @@ +/* + * 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. + * + */ + +/* + * THIS FILE IS AUTOGENERATED. DO NOT MODIFY IT; ALL CHANGES WILL BE LOST IN + * VAIN. + * + * @generated + */ +#pragma once + +#include + +#include "mcrouter/lib/carbon/test/gen/CarbonTestMessages.h" + +namespace carbon { + +// ArithmeticLike +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +// DeleteLike +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +// GetLike +template <> +struct GetLike { + static const bool value = false; +}; + +template <> +struct GetLike { + static const bool value = false; +}; + +// UpdateLike +template <> +struct UpdateLike { + static const bool value = false; +}; + +template <> +struct UpdateLike { + static const bool value = false; +}; +} // namespace carbon diff --git a/mcrouter/lib/carbon/test/gen/CarbonThriftTestRouterInfo.h b/mcrouter/lib/carbon/test/gen/CarbonThriftTestRouterInfo.h index 71d49a20..6b0bd6bf 100644 --- a/mcrouter/lib/carbon/test/gen/CarbonThriftTestRouterInfo.h +++ b/mcrouter/lib/carbon/test/gen/CarbonThriftTestRouterInfo.h @@ -24,6 +24,7 @@ #include "mcrouter/lib/carbon/test/gen/CarbonThriftTestRouteHandleIf.h" #include "mcrouter/lib/carbon/test/gen/CarbonThriftTestRouterStats.h" +#include "mcrouter/lib/carbon/test/gen/CarbonThriftTestRoutingGroups.h" // Forward declarations namespace folly { diff --git a/mcrouter/lib/carbon/test/gen/CarbonThriftTestRoutingGroups.h b/mcrouter/lib/carbon/test/gen/CarbonThriftTestRoutingGroups.h new file mode 100644 index 00000000..ab58a560 --- /dev/null +++ b/mcrouter/lib/carbon/test/gen/CarbonThriftTestRoutingGroups.h @@ -0,0 +1,86 @@ +/* + * 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. + * + */ + +/* + * THIS FILE IS AUTOGENERATED. DO NOT MODIFY IT; ALL CHANGES WILL BE LOST IN + * VAIN. + * + * @generated + */ +#pragma once + +#include + +#include "mcrouter/lib/carbon/test/gen/CarbonThriftTestMessages.h" + +namespace carbon { + +// ArithmeticLike +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +// DeleteLike +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +// GetLike +template <> +struct GetLike { + static const bool value = false; +}; + +template <> +struct GetLike { + static const bool value = false; +}; + +template <> +struct GetLike { + static const bool value = false; +}; + +// UpdateLike +template <> +struct UpdateLike { + static const bool value = false; +}; + +template <> +struct UpdateLike { + static const bool value = false; +}; + +template <> +struct UpdateLike { + static const bool value = false; +}; +} // namespace carbon diff --git a/mcrouter/lib/network/Memcache.idl b/mcrouter/lib/network/Memcache.idl index 6993df41..1ca411aa 100644 --- a/mcrouter/lib/network/Memcache.idl +++ b/mcrouter/lib/network/Memcache.idl @@ -527,6 +527,16 @@ service { arithmetic: [ McIncrRequest, McDecrRequest + ], + no_group: [ + McExecRequest, + McFlushAllRequest, + McFlushReRequest, + McQuitRequest, + McShutdownRequest, + McStatsRequest, + McTouchRequest, + McVersionRequest, ] }; gen_client_tool: true; diff --git a/mcrouter/lib/network/gen/MemcacheRoutingGroups.h b/mcrouter/lib/network/gen/MemcacheRoutingGroups.h index e56843b7..31d56eaf 100644 --- a/mcrouter/lib/network/gen/MemcacheRoutingGroups.h +++ b/mcrouter/lib/network/gen/MemcacheRoutingGroups.h @@ -21,26 +21,291 @@ namespace carbon { // ArithmeticLike +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + template <> struct ArithmeticLike { static const bool value = true; typedef void* Type; }; +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + template <> struct ArithmeticLike { static const bool value = true; typedef void* Type; }; +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + +template <> +struct ArithmeticLike { + static const bool value = false; +}; + // DeleteLike +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + template <> struct DeleteLike { static const bool value = true; typedef void* Type; }; +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + +template <> +struct DeleteLike { + static const bool value = false; +}; + // GetLike +template <> +struct GetLike { + static const bool value = false; +}; + +template <> +struct GetLike { + static const bool value = false; +}; + +template <> +struct GetLike { + static const bool value = false; +}; + +template <> +struct GetLike { + static const bool value = false; +}; + +template <> +struct GetLike { + static const bool value = false; +}; + +template <> +struct GetLike { + static const bool value = false; +}; + +template <> +struct GetLike { + static const bool value = false; +}; + +template <> +struct GetLike { + static const bool value = false; +}; + template <> struct GetLike { static const bool value = true; @@ -65,18 +330,68 @@ struct GetLike { typedef void* Type; }; +template <> +struct GetLike { + static const bool value = false; +}; + template <> struct GetLike { static const bool value = true; typedef void* Type; }; +template <> +struct GetLike { + static const bool value = false; +}; + template <> struct GetLike { static const bool value = true; typedef void* Type; }; +template <> +struct GetLike { + static const bool value = false; +}; + +template <> +struct GetLike { + static const bool value = false; +}; + +template <> +struct GetLike { + static const bool value = false; +}; + +template <> +struct GetLike { + static const bool value = false; +}; + +template <> +struct GetLike { + static const bool value = false; +}; + +template <> +struct GetLike { + static const bool value = false; +}; + +template <> +struct GetLike { + static const bool value = false; +}; + +template <> +struct GetLike { + static const bool value = false; +}; + // UpdateLike template <> struct UpdateLike { @@ -96,18 +411,83 @@ struct UpdateLike { typedef void* Type; }; +template <> +struct UpdateLike { + static const bool value = false; +}; + +template <> +struct UpdateLike { + static const bool value = false; +}; + +template <> +struct UpdateLike { + static const bool value = false; +}; + +template <> +struct UpdateLike { + static const bool value = false; +}; + +template <> +struct UpdateLike { + static const bool value = false; +}; + +template <> +struct UpdateLike { + static const bool value = false; +}; + +template <> +struct UpdateLike { + static const bool value = false; +}; + +template <> +struct UpdateLike { + static const bool value = false; +}; + +template <> +struct UpdateLike { + static const bool value = false; +}; + +template <> +struct UpdateLike { + static const bool value = false; +}; + +template <> +struct UpdateLike { + static const bool value = false; +}; + template <> struct UpdateLike { static const bool value = true; typedef void* Type; }; +template <> +struct UpdateLike { + static const bool value = false; +}; + template <> struct UpdateLike { static const bool value = true; typedef void* Type; }; +template <> +struct UpdateLike { + static const bool value = false; +}; + template <> struct UpdateLike { static const bool value = true; @@ -119,4 +499,24 @@ struct UpdateLike { static const bool value = true; typedef void* Type; }; + +template <> +struct UpdateLike { + static const bool value = false; +}; + +template <> +struct UpdateLike { + static const bool value = false; +}; + +template <> +struct UpdateLike { + static const bool value = false; +}; + +template <> +struct UpdateLike { + static const bool value = false; +}; } // namespace carbon diff --git a/mcrouter/lib/network/test/AsyncMcServerShutdownTest.cpp b/mcrouter/lib/network/test/AsyncMcServerShutdownTest.cpp index 8d039d0e..91c3d2f0 100644 --- a/mcrouter/lib/network/test/AsyncMcServerShutdownTest.cpp +++ b/mcrouter/lib/network/test/AsyncMcServerShutdownTest.cpp @@ -10,6 +10,7 @@ #include #include +#include "mcrouter/lib/carbon/example/gen/HelloGoodbyeRoutingGroups.h" #include "mcrouter/lib/carbon/example/gen/HelloGoodbyeServer.h" #include "mcrouter/lib/network/AsyncMcClient.h" #include "mcrouter/lib/network/AsyncMcServer.h"