diff options
author | eshcherbin <eshcherbin@yandex-team.com> | 2025-02-10 20:31:37 +0300 |
---|---|---|
committer | eshcherbin <eshcherbin@yandex-team.com> | 2025-02-10 22:48:45 +0300 |
commit | 2574ebe48e5377d3c12c2ce4bfb7beff951ccdc5 (patch) | |
tree | 6f5ff20ad88b834a376e9f8c52c93e62522615a2 | |
parent | 7743bf2e4f41f9d4220fbab577bb1257f19d57d3 (diff) | |
download | ydb-2574ebe48e5377d3c12c2ce4bfb7beff951ccdc5.tar.gz |
YT-24133: Introduce TAllocationGroupResources and send grouped allocation resources to scheduler
commit_hash:e175d842d02741748f030a47e11588c9776e2bb6
-rw-r--r-- | yt/yt/core/ytree/serialize-inl.h | 10 | ||||
-rw-r--r-- | yt/yt/core/ytree/serialize.h | 7 |
2 files changed, 15 insertions, 2 deletions
diff --git a/yt/yt/core/ytree/serialize-inl.h b/yt/yt/core/ytree/serialize-inl.h index 01fc90c73a..a4e980de99 100644 --- a/yt/yt/core/ytree/serialize-inl.h +++ b/yt/yt/core/ytree/serialize-inl.h @@ -431,13 +431,21 @@ void Serialize(const std::tuple<T...>& value, NYson::IYsonConsumer* consumer) NDetail::SerializeTuple(value, consumer); } -// For any associative container. +// TODO(eshcherbin): Add a concept for associative containers. +// Any associative container (except TCompactFlatMap). template <template<typename...> class C, class... T, class K> void Serialize(const C<T...>& value, NYson::IYsonConsumer* consumer) { NDetail::SerializeAssociative(value, consumer); } +// TCompactFlatMap. +template <class K, class V, size_t N> +void Serialize(const TCompactFlatMap<K, V, N>& value, NYson::IYsonConsumer* consumer) +{ + NDetail::SerializeAssociative(value, consumer); +} + template <class E, class T, E Min, E Max> void Serialize(const TEnumIndexedArray<E, T, Min, Max>& vector, NYson::IYsonConsumer* consumer) { diff --git a/yt/yt/core/ytree/serialize.h b/yt/yt/core/ytree/serialize.h index a188910e66..2719a69cf4 100644 --- a/yt/yt/core/ytree/serialize.h +++ b/yt/yt/core/ytree/serialize.h @@ -11,6 +11,7 @@ #include <yt/yt/core/yson/writer.h> #include <library/cpp/yt/compact_containers/compact_vector.h> +#include <library/cpp/yt/compact_containers/compact_flat_map.h> #include <library/cpp/yt/containers/enum_indexed_array.h> @@ -150,10 +151,14 @@ void Serialize(const std::array<T, N>& value, NYson::IYsonConsumer* consumer); template <class... T> void Serialize(const std::tuple<T...>& value, NYson::IYsonConsumer* consumer); -// For any associative container. +// Any associative container (except TCompactFlatMap). template <template<typename...> class C, class... T, class K = typename C<T...>::key_type> void Serialize(const C<T...>& value, NYson::IYsonConsumer* consumer); +// TCompactFlatMap. +template <class K, class V, size_t N> +void Serialize(const TCompactFlatMap<K, V, N>& value, NYson::IYsonConsumer* consumer); + // TEnumIndexedArray template <class E, class T, E Min, E Max> void Serialize(const TEnumIndexedArray<E, T, Min, Max>& value, NYson::IYsonConsumer* consumer); |