<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ydb/library/cpp/yt/error/error_attribute.h, branch meta-1.0.3-dev4</title>
<subtitle>Mirror of YDB github repos</subtitle>
<id>https://code.mastervirt.ru/ydb/atom?h=meta-1.0.3-dev4</id>
<link rel='self' href='https://code.mastervirt.ru/ydb/atom?h=meta-1.0.3-dev4'/>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/'/>
<updated>2024-12-26T08:12:17Z</updated>
<entry>
<title>YT-21233: Drop dependency on yson in library/cpp/yt/error by switch to std::string everywhere</title>
<updated>2024-12-26T08:12:17Z</updated>
<author>
<name>arkady-e1ppa</name>
<email>arkady-e1ppa@yandex-team.com</email>
</author>
<published>2024-12-26T07:52:40Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=0328aa1f62630f14d06076175e2f3750969ac813'/>
<id>urn:sha1:0328aa1f62630f14d06076175e2f3750969ac813</id>
<content type='text'>
done
commit_hash:8a83afa39917ba66a5161388a7cd74a4488d9908
</content>
</entry>
<entry>
<title>YT-21233: Adjust (To/From)ErrorAttributeValue CPOs, revert ConvertTo becoming CPO, move TErrorCode and TError to library/cpp/yt/error</title>
<updated>2024-12-25T04:31:55Z</updated>
<author>
<name>arkady-e1ppa</name>
<email>arkady-e1ppa@yandex-team.com</email>
</author>
<published>2024-12-25T04:12:23Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=b5dd91799751f9924acb7c17ddad16ddb2086bba'/>
<id>urn:sha1:b5dd91799751f9924acb7c17ddad16ddb2086bba</id>
<content type='text'>
\[nodiff:caesar\]

List of changes:

 1) Make `ConvertTo` a normal function again (basically, a revert of previous change). It turned out to be very inconvenient entry point

 2) Introduce concept for "Primitive types" which are handled without yt/core module. Please note that inclusion of core **does not** affect work with primitive types (otherwise we would be facing and ODR violation). These are numerics, duration, instant, string-like objects and guid

 3) Introduce `FromErrorAttributeValue` which is a substitute to `ConvertTo` with special behavior (see below)

 4) Scheme for (de-)serialization has changed:

    1) Primitive types are handled via `ConvertToTextYsonString` and `ConvertFromTextYsonString`

    2) Other types are not supported without yt/core. Otherwise `ConvertToYsonString(value, EYsonFormat::Text)` used for serialization and `ConvertTo&lt;T&gt;(value)` for deserialization.

 5) New format of attribute value storage allows to not care about concrete type of the attribute (text yson strings can be detected since they start with `\"` and deserialized so are text yson bools, everything else is already human readable). This drops dependency on `TTokenizer`

 6) Some small parts (e.g. enums or constants or aliases) of yt/core/misc files were moved to library/cpp/yt/\* locations and re-included to drop dependencies of stripped\_error on them

 7) `TErrorAttributes` is now a simple hash map instead of a handle to `IAttributeDictionary`

 8) `ExtractFromAttributes` weak symbol is finally moved to library/cpp/yt/error due to point 9 allowing to fully drop dependency on `IAttributeDictionary`. Combined with point 7 this drops dep on yt/core/ytree altogether

 9) Moved `TErrorCode` to library/cpp/yt/error. There is a logger there which forces dep on library/cpp/yt/logging. It is not required really, and can be later removed

10) Moved `TError` with format and macroes to library/cpp/yt/error. It still (and probably forever will) depend on yson.

What can be done next: Switch TYsonString to TString and move ConvertTo/FromTextYsonString to library/cpp/yt/error. This would remove dep on library/cpp/yt/yson\_string
commit_hash:6f11dc478ab782a1f98a5aedcd45a4800d3f4e7b
</content>
</entry>
<entry>
<title>YT-21233: Introduce ToAttributeValue cpo which removes dependency of TErrorAttribute from yt/core</title>
<updated>2024-11-29T19:12:26Z</updated>
<author>
<name>arkady-e1ppa</name>
<email>arkady-e1ppa@yandex-team.com</email>
</author>
<published>2024-11-29T19:02:21Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=b21317884da9622ac16bbad26627ae014d72d6a7'/>
<id>urn:sha1:b21317884da9622ac16bbad26627ae014d72d6a7</id>
<content type='text'>
Plan:

 1) Remove `IAttributedDictionary` type from the public API. \+

 2) Remove `Set` method from public API in favor of `operator&lt;&lt;=`. \+

 3) Adopt `ConvertTo&lt;T&gt;` (or other name) CPO with proper extension into `NYT::NYson::ConvertTo` from `yt/core`.

 4) Use CPO from (3) to eliminate direct dependency on `yt/core` of `Get/Find` methods from attributes API.

 5) Adopt `ConvertToYsonString` (or other name) CPO with proper extension into `yt/core` customisations.

 6) Use CPO from (5) to eliminate direct dependency on `yt/core` of `TErrorAttribute` ctor.

 7) Swap attributes implementation to the one which doesn’t use `IAttributeDictionary`.

 8) At this point `stripped_error*` can be moved to library/cpp/yt and so can recursively dependant on THROW macro methods `Get/Find/…`.

 9) Adjust CPO’s to work with `std::string` instead of `TYsonString` assuming text format to be used (maybe `TString` for now).

10) Remove dep of `library/cpp/yt/error` on `yson` entirely.

This pr addresses 5-6 steps of plan. Below is a brief explanation of design decisions. We also expressed everything related to key-value code in terms of aliases of `TErrorAttribute` so that later we could make a relatively simple switch to `std::string`. We expect to do steps 7-8 in the next pull request as everything should be ready
commit_hash:de9feca2bd24d823b33d904ef0fa5f4856f9b020
</content>
</entry>
</feed>
