Skip to content

Commit

Permalink
ThriftRemoveGetters_thrift
Browse files Browse the repository at this point in the history
Reviewed By: dtolnay

Differential Revision: D64592319

fbshipit-source-id: 7f18d5714a05f0c84a6af082bc430b6a7b92a10c
  • Loading branch information
generatedunixname89002005287564 authored and facebook-github-bot committed Oct 20, 2024
1 parent 3ef9a48 commit af909fa
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion thrift/conformance/cpp2/AnyRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ void registerGeneratedStruct() {
const ThriftTypeInfo& type = getGeneratedThriftTypeInfo<T>();
if (!getGeneratedAnyRegistry().registerType<T, Ps...>(type)) {
folly::throw_exception<std::runtime_error>(
"Could not register: " + type.get_uri());
"Could not register: " + type.uri().value());
}
using Tag = std::conditional_t<
is_thrift_union_v<T>,
Expand Down
6 changes: 4 additions & 2 deletions thrift/lib/cpp2/async/RocketClientChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ rocket::SetupFrame RocketClientChannel::makeSetupFrame(
clientMetadata.hostname_ref().from_optional(hostMetadata->hostname);
// no otherMetadata provided in makeSetupFrame override, copy
// hostMetadata.otherMetadata directly instead of doing inserts
if (!clientMetadata.get_otherMetadata()) {
if (!apache::thrift::get_pointer(clientMetadata.otherMetadata())) {
clientMetadata.otherMetadata_ref().from_optional(
hostMetadata->otherMetadata);
} else if (hostMetadata->otherMetadata) {
Expand Down Expand Up @@ -768,7 +768,9 @@ RocketClientChannel::RocketClientChannel(
*eventBase,
std::move(socket),
std::make_unique<rocket::SetupFrame>(makeSetupFrame(meta)),
meta.get_keepAliveTimeoutMs() ? *meta.get_keepAliveTimeoutMs() : 0,
apache::thrift::get_pointer(meta.keepAliveTimeoutMs())
? *apache::thrift::get_pointer(meta.keepAliveTimeoutMs())
: 0,
allocatorPtr),
evb_(eventBase) {
apache::thrift::detail::hookForClientTransport(getTransport());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ TEST_F(CPUConcurrencyControllerTest, getDbgInfo) {
auto dbgInfo = cpuConcurrencyController.getDbgInfo();

// Assert
ASSERT_EQ("ENABLED", dbgInfo.get_mode());
ASSERT_EQ("ENABLED", dbgInfo.mode().value());
ASSERT_EQ(*dbgInfo.method(), "MAX_QPS");
ASSERT_EQ(*dbgInfo.cpuTarget(), 99);
ASSERT_EQ(*dbgInfo.cpuLoadSource(), "CONTAINER_AND_HOST");
Expand Down
2 changes: 1 addition & 1 deletion thrift/lib/cpp2/server/test/RoundRobinRequestPileTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ TEST(RoundRobinRequestPileTest, GetDbgInfo) {
// Assert
EXPECT_TRUE(
(*result.name()).find("RoundRobinRequestPile") != std::string::npos);
EXPECT_EQ(result.get_prioritiesCount(), priorities);
EXPECT_EQ(folly::copy(result.prioritiesCount().value()), priorities);
for (int i = 0; i < priorities; ++i) {
EXPECT_EQ((*result.bucketsPerPriority())[i], 10 * (i + 1));
}
Expand Down
4 changes: 2 additions & 2 deletions thrift/lib/cpp2/type/AnyDebugWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ std::string getTypeName(const type::TypeStruct& type) {

void appendType(const type::TypeStruct& type, fmt::memory_buffer& buf) {
fmt::format_to(std::back_inserter(buf), "{}", getTypeName(type));
if (!type.get_params().empty()) {
if (!type.params().value().empty()) {
buf.push_back('<');
appendTypeParams(type.get_params(), buf);
appendTypeParams(type.params().value(), buf);
buf.push_back('>');
}
}
Expand Down

0 comments on commit af909fa

Please sign in to comment.