Skip to content

Commit

Permalink
Run clang-format - 5/6
Browse files Browse the repository at this point in the history
Summary:
This directory is opted-in to clang-format but is not format-clean. This blocks continuous formatting from being enabled on fbcode, and causes hassle for other codemods that leave inconsistent formatting. This diff runs clang-format, which is widely used and considered safe.

If you are unhappy with the formatting of a particular block, please *accept this diff* and then in a stacked commit undo the change and wrap that code in `// clang-format off` and `// clang-format on`, or `/* clang-format off */` and `/* clang-format on */`.

drop-conflicts

Reviewed By: jmswen

Differential Revision: D22314269

fbshipit-source-id: 5cf97c4f1093055cf51eb3d4374d4dc9f77645fa
  • Loading branch information
iahs authored and facebook-github-bot committed Jul 1, 2020
1 parent f5d1504 commit ad7a6eb
Show file tree
Hide file tree
Showing 50 changed files with 164 additions and 164 deletions.
4 changes: 2 additions & 2 deletions mcrouter/lib/routes/AllAsyncRoute.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ class AllAsyncRoute {
private:
const std::vector<std::shared_ptr<RouteHandleIf>> children_;
};
}
} // facebook::memcache
} // namespace memcache
} // namespace facebook
4 changes: 2 additions & 2 deletions mcrouter/lib/routes/AllInitialRoute.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ class AllInitialRoute {
return std::move(rh[0]);
}
};
}
} // facebook::memcache
} // namespace memcache
} // namespace facebook
6 changes: 3 additions & 3 deletions mcrouter/lib/test/CompressionCodecManagerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,6 @@ TEST(CompressionCodecManager, getBest_serverWithoutCodecs) {
CodecIdRange{1, 6}, 1234 /* body size */, 0 /* reply type id */));
}

} // test
} // memcache
} // facebook
} // namespace test
} // namespace memcache
} // namespace facebook
6 changes: 3 additions & 3 deletions mcrouter/lib/test/CompressionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,6 @@ TEST(Lz4ImmutableCompressionCodec, uncompressChained) {
CompressionCodecType::LZ4Immutable, getAsciiDictionary(), 1);
testUncompressChained(compressor.get(), *getAsciiReply(), 3);
}
}
}
} // facebook::memcache::test
} // namespace test
} // namespace memcache
} // namespace facebook
6 changes: 3 additions & 3 deletions mcrouter/lib/test/CompressionTestUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,6 @@ std::unordered_map<uint32_t, CodecConfigPtr> testCodecConfigs() {
return codecConfigs;
}

} // test
} // memcache
} // facebook
} // namespace test
} // namespace memcache
} // namespace facebook
6 changes: 3 additions & 3 deletions mcrouter/lib/test/CompressionTestUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ std::string createBinaryData(size_t size);
// CompressionCodecManager.
std::unordered_map<uint32_t, CodecConfigPtr> testCodecConfigs();

} // test
} // memcache
} // facebook
} // namespace test
} // namespace memcache
} // namespace facebook
2 changes: 1 addition & 1 deletion mcrouter/lib/test/IovecCursorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ TEST(IovecCursor, construct) {

TEST(IovecCursor, construct_empty) {
std::string buf1 = "";
auto p = getIovecCursor({ buf1 });
auto p = getIovecCursor({buf1});
auto& cursor = p.first;

EXPECT_FALSE(cursor.hasDataAvailable());
Expand Down
4 changes: 2 additions & 2 deletions mcrouter/lib/test/TestRouteHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ using TestRouterInfo = MemcacheRouterInfo;
template <class Route>
using TestRouteHandle = MemcacheRouteHandle<Route>;

} // memcache
} // facebook
} // namespace memcache
} // namespace facebook
6 changes: 3 additions & 3 deletions mcrouter/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,6 @@ namespace options {
*/
std::string substituteTemplates(std::string str);

} // facebook::memcache::options
}
} // facebook::memcache
} // namespace options
} // namespace memcache
} // namespace facebook
6 changes: 3 additions & 3 deletions mcrouter/route.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ bool match_pattern_route(folly::StringPiece pattern, folly::StringPiece route) {
return match_pattern_helper(
pattern.begin(), pattern.end(), route.begin(), route.end());
}
}
}
} // facebook::memcache::mcrouter
} // namespace mcrouter
} // namespace memcache
} // namespace facebook
6 changes: 3 additions & 3 deletions mcrouter/route.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ namespace mcrouter {
* True if pattern (like "/foo/a*c/") matches a route (like "/foo/abc")
*/
bool match_pattern_route(folly::StringPiece pattern, folly::StringPiece route);
}
}
} // facebook::memcache::mcrouter
} // namespace mcrouter
} // namespace memcache
} // namespace facebook
8 changes: 4 additions & 4 deletions mcrouter/routes/AllAsyncRouteFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ typename RouterInfo::RouteHandlePtr makeAllAsyncRoute(
std::move(rh));
}

} // detail
} // namespace detail

template <class RouterInfo>
typename RouterInfo::RouteHandlePtr makeAllAsyncRoute(
Expand All @@ -47,6 +47,6 @@ typename RouterInfo::RouteHandlePtr makeAllAsyncRoute(
}
return detail::makeAllAsyncRoute<RouterInfo>(std::move(children));
}
} // mcrouter
} // memcache
} // facebook
} // namespace mcrouter
} // namespace memcache
} // namespace facebook
8 changes: 4 additions & 4 deletions mcrouter/routes/AllFastestRouteFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ typename RouterInfo::RouteHandlePtr makeAllFastestRoute(
std::move(rh));
}

} // detail
} // namespace detail

template <class RouterInfo>
typename RouterInfo::RouteHandlePtr makeAllFastestRoute(
Expand All @@ -51,6 +51,6 @@ typename RouterInfo::RouteHandlePtr makeAllFastestRoute(
}
return detail::makeAllFastestRoute<RouterInfo>(std::move(children));
}
} // mcrouter
} // memcache
} // facebook
} // namespace mcrouter
} // namespace memcache
} // namespace facebook
8 changes: 4 additions & 4 deletions mcrouter/routes/AllInitialRouteFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ typename RouterInfo::RouteHandlePtr makeAllInitialRoute(
std::move(rh));
}

} // detail
} // namespace detail

template <class RouterInfo>
typename RouterInfo::RouteHandlePtr makeAllInitialRoute(
Expand All @@ -51,6 +51,6 @@ typename RouterInfo::RouteHandlePtr makeAllInitialRoute(
}
return detail::makeAllInitialRoute<RouterInfo>(std::move(children));
}
} // mcrouter
} // memcache
} // facebook
} // namespace mcrouter
} // namespace memcache
} // namespace facebook
6 changes: 3 additions & 3 deletions mcrouter/routes/AllMajorityRouteFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ typename RouterInfo::RouteHandlePtr makeAllMajorityRoute(
}
return createAllMajorityRoute<RouterInfo>(std::move(children));
}
} // mcrouter
} // memcache
} // facebook
} // namespace mcrouter
} // namespace memcache
} // namespace facebook
8 changes: 4 additions & 4 deletions mcrouter/routes/AllSyncRouteFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ typename RouterInfo::RouteHandlePtr makeAllSyncRoute(
std::move(rh));
}

} // detail
} // namespace detail

template <class RouterInfo>
typename RouterInfo::RouteHandlePtr makeAllSyncRoute(
Expand All @@ -51,6 +51,6 @@ typename RouterInfo::RouteHandlePtr makeAllSyncRoute(
}
return detail::makeAllSyncRoute<RouterInfo>(std::move(children));
}
} // mcrouter
} // memcache
} // facebook
} // namespace mcrouter
} // namespace memcache
} // namespace facebook
6 changes: 3 additions & 3 deletions mcrouter/routes/AsynclogRoute.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ typename RouterInfo::RouteHandlePtr makeAsynclogRoute(
std::move(rh), std::move(asynclogName));
}

} // mcrouter
} // memcache
} // facebook
} // namespace mcrouter
} // namespace memcache
} // namespace facebook
8 changes: 4 additions & 4 deletions mcrouter/routes/BigValueRoute.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace folly {
class IOBuf;
} // folly
} // namespace folly

namespace facebook {
namespace memcache {
Expand Down Expand Up @@ -141,8 +141,8 @@ class BigValueRoute {
createChunkKey(folly::StringPiece key, uint32_t index, uint64_t suffix) const;
};

} // mcrouter
} // memcache
} // facebook
} // namespace mcrouter
} // namespace memcache
} // namespace facebook

#include "BigValueRoute-inl.h"
6 changes: 3 additions & 3 deletions mcrouter/routes/BigValueRouteIf.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ struct BigValueRouteOptions {
const size_t batchSize;
};

} // mcrouter
} // memcache
} // facebook
} // namespace mcrouter
} // namespace memcache
} // namespace facebook
8 changes: 4 additions & 4 deletions mcrouter/routes/DevNullRoute.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ typename RouterInfo::RouteHandlePtr makeDevNullRoute() {
return makeRouteHandleWithInfo<RouterInfo, DevNullRoute>();
}

} // detail
} // namespace detail

template <class RouterInfo>
typename RouterInfo::RouteHandlePtr makeDevNullRoute(
RouteHandleFactory<typename RouterInfo::RouteHandleIf>&,
const folly::dynamic&) {
return detail::makeDevNullRoute<RouterInfo>();
}
} // mcrouter
} // memcache
} // facebook
} // namespace mcrouter
} // namespace memcache
} // namespace facebook
6 changes: 3 additions & 3 deletions mcrouter/routes/ExtraRouteHandleProviderIf.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ class ExtraRouteHandleProviderIf {

virtual ~ExtraRouteHandleProviderIf() {}
};
}
}
} // facebook::memcache::mcrouter
} // namespace mcrouter
} // namespace memcache
} // namespace facebook
8 changes: 4 additions & 4 deletions mcrouter/routes/FailoverRateLimiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ folly::TokenBucket tbFromJson(const folly::dynamic& json) {
return {rate, burst, /* allow `burst` requests at time 0 */ -1e6};
}

} // anonymous
} // namespace

FailoverRateLimiter::FailoverRateLimiter(const folly::dynamic& json)
: tb_(tbFromJson(json)) {}
}
}
} // facebook::memcache::mcrouter
} // namespace mcrouter
} // namespace memcache
} // namespace facebook
8 changes: 4 additions & 4 deletions mcrouter/routes/FailoverRateLimiter.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace folly {
struct dynamic;
} // folly
} // namespace folly

namespace facebook {
namespace memcache {
Expand Down Expand Up @@ -60,6 +60,6 @@ class FailoverRateLimiter {
folly::TokenBucket tb_;
size_t totalReqs_{0};
};
}
}
} // facebook::memcache::mcrouter
} // namespace mcrouter
} // namespace memcache
} // namespace facebook
8 changes: 4 additions & 4 deletions mcrouter/routes/HostIdRouteFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ typename RouterInfo::RouteHandlePtr makeHostIdRoute(
return std::move(rh[hostIdHash % rh.size()]);
}

} // detail
} // namespace detail

template <class RouterInfo>
typename RouterInfo::RouteHandlePtr makeHostIdRoute(
Expand All @@ -57,6 +57,6 @@ typename RouterInfo::RouteHandlePtr makeHostIdRoute(

return detail::makeHostIdRoute<RouterInfo>(std::move(children), salt);
}
}
}
} // facebook::memcache::mcrouter
} // namespace mcrouter
} // namespace memcache
} // namespace facebook
8 changes: 4 additions & 4 deletions mcrouter/routes/L1L2CacheRouteFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ typename RouterInfo::RouteHandlePtr makeL1L2CacheRoute(
ncacheUpdatePeriod);
}

} // detail
} // namespace detail

template <class RouterInfo>
typename RouterInfo::RouteHandlePtr makeL1L2CacheRoute(
Expand Down Expand Up @@ -75,6 +75,6 @@ typename RouterInfo::RouteHandlePtr makeL1L2CacheRoute(
ncacheExptime,
ncacheUpdatePeriod);
}
} // mcrouter
} // memcache
} // facebook
} // namespace mcrouter
} // namespace memcache
} // namespace facebook
6 changes: 3 additions & 3 deletions mcrouter/routes/McExtraRouteHandleProvider-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ McExtraRouteHandleProvider<RouterInfo>::tryCreate(
return {};
}

} // mcrouter
} // memcache
} // facebook
} // namespace mcrouter
} // namespace memcache
} // namespace facebook
6 changes: 3 additions & 3 deletions mcrouter/routes/McExtraRouteHandleProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class McExtraRouteHandleProvider

~McExtraRouteHandleProvider() override {}
};
}
}
} // facebook::memcache::mcrouter
} // namespace mcrouter
} // namespace memcache
} // namespace facebook

#include "McExtraRouteHandleProvider-inl.h"
6 changes: 3 additions & 3 deletions mcrouter/routes/McImportResolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ std::string McImportResolver::import(folly::StringPiece path) {
}
return ret;
}
}
}
} // facebook::memcache::mcrouter
} // namespace mcrouter
} // namespace memcache
} // namespace facebook
6 changes: 3 additions & 3 deletions mcrouter/routes/McImportResolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ class McImportResolver : public ImportResolverIf {
private:
ConfigApiIf& configApi_;
};
}
}
} // facebook::memcache::mcrouter
} // namespace mcrouter
} // namespace memcache
} // namespace facebook
6 changes: 3 additions & 3 deletions mcrouter/routes/McRouteHandleBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ McrouterRouteHandlePtr makeMcrouterRouteHandleWithInfo(Args&&... args) {
std::forward<Args>(args)...);
}

} // mcrouter
} // memcache
} // facebook
} // namespace mcrouter
} // namespace memcache
} // namespace facebook
Loading

0 comments on commit ad7a6eb

Please sign in to comment.