Skip to content

Commit

Permalink
Add a constexpr var to indicate whether McRefill is enabled for a Router
Browse files Browse the repository at this point in the history
Summary: as title

Reviewed By: disylh

Differential Revision: D61503306

fbshipit-source-id: edd74112c23088fa512afd36493cb438a23a2f83
  • Loading branch information
Xiaofei Hu authored and facebook-github-bot committed Aug 23, 2024
1 parent 17d4965 commit 7f5c691
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions mcrouter/lib/carbon/example/gen/HelloGoodbyeRouterInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ struct HelloGoodbyeRouterInfo {
static constexpr const char* name = "HelloGoodbye";
static constexpr const bool bucketization = false;
static constexpr const bool useRequestAclChecker = false;
static constexpr const bool hasMcRefillRoute = false;

template <class Route>
using RouteHandle = HelloGoodbyeRouteHandle<Route>;
Expand Down
1 change: 1 addition & 0 deletions mcrouter/lib/carbon/test/gen/ARouterInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ struct ARouterInfo {
static constexpr const char* name = "A";
static constexpr const bool bucketization = false;
static constexpr const bool useRequestAclChecker = false;
static constexpr const bool hasMcRefillRoute = false;

template <class Route>
using RouteHandle = ARouteHandle<Route>;
Expand Down
1 change: 1 addition & 0 deletions mcrouter/lib/carbon/test/gen/BRouterInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ struct BRouterInfo {
static constexpr const char* name = "B";
static constexpr const bool bucketization = false;
static constexpr const bool useRequestAclChecker = false;
static constexpr const bool hasMcRefillRoute = false;

template <class Route>
using RouteHandle = BRouteHandle<Route>;
Expand Down
1 change: 1 addition & 0 deletions mcrouter/lib/carbon/test/gen/CarbonTestRouterInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ struct CarbonTestRouterInfo {
static constexpr const char* name = "CarbonTest";
static constexpr const bool bucketization = false;
static constexpr const bool useRequestAclChecker = false;
static constexpr const bool hasMcRefillRoute = false;

template <class Route>
using RouteHandle = CarbonTestRouteHandle<Route>;
Expand Down
1 change: 1 addition & 0 deletions mcrouter/lib/carbon/test/gen/CarbonThriftTestRouterInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ struct CarbonThriftTestRouterInfo {
static constexpr const char* name = "CarbonThriftTest";
static constexpr const bool bucketization = false;
static constexpr const bool useRequestAclChecker = false;
static constexpr const bool hasMcRefillRoute = false;

template <class Route>
using RouteHandle = CarbonThriftTestRouteHandle<Route>;
Expand Down
3 changes: 3 additions & 0 deletions mcrouter/lib/network/Memcache.idl
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,9 @@ reply McGatsReply with 1: MemcacheReplyCommon {

service {
additional_requests: [];
additional_route_handles: [
McRefillRoute @ "mcrouter/routes/McRefillRoute.h"
];
on_reply_logger: facebook::memcache::mcrouter::AdditionalProxyRequestLogger;
enable_shutdown: false;
stats: {
Expand Down
3 changes: 3 additions & 0 deletions mcrouter/lib/network/gen/MemcacheRouterInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@

#include <mcrouter/routes/McExtraRouteHandleProvider.h>

#include "mcrouter/routes/McRefillRoute.h"

using namespace facebook::memcache;
using namespace facebook::memcache::mcrouter;

Expand Down Expand Up @@ -189,6 +191,7 @@ MemcacheRouterInfo::buildRouteMap() {
{"OperationSelectorRoute",
&makeOperationSelectorRoute<MemcacheRouterInfo>},
{"RandomRoute", &makeRandomRoute<MemcacheRouterInfo>},
{"McRefillRoute", &makeMcRefillRoute<MemcacheRouterInfo>},
};
return map;
}
Expand Down
1 change: 1 addition & 0 deletions mcrouter/lib/network/gen/MemcacheRouterInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ struct MemcacheRouterInfo {
static constexpr const char* name = "Memcache";
static constexpr const bool bucketization = true;
static constexpr const bool useRequestAclChecker = true;
static constexpr const bool hasMcRefillRoute = true;

template <class Route>
using RouteHandle = MemcacheRouteHandle<Route>;
Expand Down

0 comments on commit 7f5c691

Please sign in to comment.