aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspreis <spreis@yandex-team.com>2024-01-23 16:13:43 +0300
committerAlexander Smirnov <alex@ydb.tech>2024-01-24 15:02:08 +0300
commit4b4ac0bca2d12bc3d03d6d70bf62999268e12cf0 (patch)
tree7f657b69a90ac5337914b2a80ab42277070a8574
parentb3a8706c73ceefb42c529668e9916b34d30ae8b8 (diff)
downloadydb-4b4ac0bca2d12bc3d03d6d70bf62999268e12cf0.tar.gz
Add GEN_FBS
-rw-r--r--build/conf/fbs.conf1
-rw-r--r--yt/yt/core/http/http.cpp4
-rw-r--r--yt/yt/core/yson/protobuf_interop.cpp10
-rw-r--r--yt/yt/core/yson/unittests/protobuf_yson_ut.cpp4
4 files changed, 10 insertions, 9 deletions
diff --git a/build/conf/fbs.conf b/build/conf/fbs.conf
index 2f6ccb40f8..c535c437b2 100644
--- a/build/conf/fbs.conf
+++ b/build/conf/fbs.conf
@@ -100,6 +100,7 @@ macro FBS_NAMESPACE(NAMESPACE, PATH...) {
multimodule FBS_LIBRARY {
module CPP_FBS: LIBRARY {
ENABLE(CPP_FBS)
+ ENABLE(GEN_FBS)
SET(PEERDIR_TAGS CPP_FBS)
}
diff --git a/yt/yt/core/http/http.cpp b/yt/yt/core/http/http.cpp
index 666799d830..1bbffcf32e 100644
--- a/yt/yt/core/http/http.cpp
+++ b/yt/yt/core/http/http.cpp
@@ -11,7 +11,7 @@ using namespace NConcurrency;
TStringBuf ToHttpString(EMethod method)
{
- switch(method) {
+ switch (method) {
#define XX(num, name, string) case EMethod::name: return #string;
YT_HTTP_METHOD_MAP(XX)
#undef XX
@@ -21,7 +21,7 @@ TStringBuf ToHttpString(EMethod method)
TStringBuf ToHttpString(EStatusCode code)
{
- switch(code) {
+ switch (code) {
#define XX(num, name, string) case EStatusCode::name: return #string;
YT_HTTP_STATUS_MAP(XX)
#undef XX
diff --git a/yt/yt/core/yson/protobuf_interop.cpp b/yt/yt/core/yson/protobuf_interop.cpp
index ee4493cb98..450ac2bbfc 100644
--- a/yt/yt/core/yson/protobuf_interop.cpp
+++ b/yt/yt/core/yson/protobuf_interop.cpp
@@ -1026,11 +1026,11 @@ protected:
data);
return;
case EUtf8Check::ThrowOnFail:
- THROW_ERROR_EXCEPTION("String field got non UTF-8 value (Path: %v)",
+ THROW_ERROR_EXCEPTION("Non UTF-8 value in string field %v",
YPathStack_.GetHumanReadablePath())
+ << TErrorAttribute("non_utf8_string", data)
<< TErrorAttribute("ypath", YPathStack_.GetPath())
- << TErrorAttribute("proto_field", fieldFullName)
- << TErrorAttribute("non_utf8_string", data);
+ << TErrorAttribute("proto_field", fieldFullName);
}
}
};
@@ -2511,7 +2511,7 @@ private:
case FieldDescriptor::TYPE_ENUM: {
ParseScalar([&] {
- switch(field->GetEnumYsonStorageType()) {
+ switch (field->GetEnumYsonStorageType()) {
case EEnumYsonStorageType::String:
storeEnumAsString(unsignedValue);
break;
@@ -2753,7 +2753,7 @@ private:
case FieldDescriptor::TYPE_ENUM: {
ParseVarintPacked<ui32>(length, field, [&] (auto value) {
- switch(field->GetEnumYsonStorageType()) {
+ switch (field->GetEnumYsonStorageType()) {
case EEnumYsonStorageType::String:
storeEnumAsString(value);
break;
diff --git a/yt/yt/core/yson/unittests/protobuf_yson_ut.cpp b/yt/yt/core/yson/unittests/protobuf_yson_ut.cpp
index 35c422a389..e2550ea774 100644
--- a/yt/yt/core/yson/unittests/protobuf_yson_ut.cpp
+++ b/yt/yt/core/yson/unittests/protobuf_yson_ut.cpp
@@ -1033,7 +1033,7 @@ TEST(TYsonToProtobufTest, ValidUtf8StringCheck)
.EndMap();
};
if (option == EUtf8Check::ThrowOnFail) {
- EXPECT_THROW_WITH_SUBSTRING(check(), "String field got non UTF-8 value");
+ EXPECT_THROW_WITH_SUBSTRING(check(), "Non UTF-8 value in string field");
} else {
EXPECT_NO_THROW(check());
}
@@ -1045,7 +1045,7 @@ TEST(TYsonToProtobufTest, ValidUtf8StringCheck)
TYsonWriter ysonWriter(&newYsonOutputStream, EYsonFormat::Pretty);
if (option == EUtf8Check::ThrowOnFail) {
EXPECT_THROW_WITH_SUBSTRING(
- WriteProtobufMessage(&ysonWriter, message), "String field got non UTF-8 value");
+ WriteProtobufMessage(&ysonWriter, message), "Non UTF-8 value in string field");
} else {
EXPECT_NO_THROW(WriteProtobufMessage(&ysonWriter, message));
}