diff options
author | asamoylov22 <asamoylov22@yandex-team.com> | 2025-02-28 10:12:12 +0300 |
---|---|---|
committer | asamoylov22 <asamoylov22@yandex-team.com> | 2025-02-28 10:43:22 +0300 |
commit | 54f08bc197a13725ddf51da1c507d9ea82bedd53 (patch) | |
tree | 4a800420a963ade4fae11680bdaafaae84141137 | |
parent | 470831e624146d43911f84cb3fd27b8685f14e37 (diff) | |
download | ydb-54f08bc197a13725ddf51da1c507d9ea82bedd53.tar.gz |
Add equality operator to TReadRange
commit_hash:2d5c53592a60605013dc6de0e7030f2c80ec3ac3
-rw-r--r-- | yt/cpp/mapreduce/interface/common.cpp | 22 | ||||
-rw-r--r-- | yt/cpp/mapreduce/interface/common.h | 9 |
2 files changed, 31 insertions, 0 deletions
diff --git a/yt/cpp/mapreduce/interface/common.cpp b/yt/cpp/mapreduce/interface/common.cpp index 966be8341f..7abbef9127 100644 --- a/yt/cpp/mapreduce/interface/common.cpp +++ b/yt/cpp/mapreduce/interface/common.cpp @@ -552,6 +552,28 @@ TKeyBound::TKeyBound(ERelation relation, TKey key) , Key_(std::move(key)) { } +bool operator==(const TKeyBound& lhs, const TKeyBound& rhs) noexcept +{ + return lhs.Key() == rhs.Key() && lhs.Relation() == rhs.Relation(); +} + +//////////////////////////////////////////////////////////////////////////////// + +bool operator==(const TReadLimit& lhs, const TReadLimit& rhs) noexcept +{ + return lhs.Key_ == rhs.Key_ && lhs.RowIndex_ == rhs.RowIndex_ && + lhs.Offset_ == rhs.Offset_ && lhs.TabletIndex_ == rhs.TabletIndex_ && + lhs.KeyBound_ == rhs.KeyBound_; +} + +//////////////////////////////////////////////////////////////////////////////// + +bool operator==(const TReadRange& lhs, const TReadRange& rhs) noexcept +{ + return lhs.LowerLimit_ == rhs.LowerLimit_ && + lhs.UpperLimit_ == rhs.UpperLimit_ && lhs.Exact_ == rhs.Exact_; +} + //////////////////////////////////////////////////////////////////////////////// TTableSchema CreateTableSchema( diff --git a/yt/cpp/mapreduce/interface/common.h b/yt/cpp/mapreduce/interface/common.h index d595302bbb..9752e15822 100644 --- a/yt/cpp/mapreduce/interface/common.h +++ b/yt/cpp/mapreduce/interface/common.h @@ -880,6 +880,9 @@ struct TKeyBound /// @endcond }; +/// Equality check checks all fields of TKeyBound +bool operator==(const TKeyBound& lhs, const TKeyBound& rhs) noexcept; + /// /// @brief Description of the read limit. /// @@ -923,6 +926,9 @@ struct TReadLimit FLUENT_FIELD_OPTION(i64, TabletIndex); }; +/// Equality check checks all fields of TReadLimit +bool operator==(const TReadLimit& lhs, const TReadLimit& rhs) noexcept; + /// /// @brief Range of a table or a file /// @@ -963,6 +969,9 @@ struct TReadRange } }; +/// Equality check checks all fields of TReadRange +bool operator==(const TReadRange& lhs, const TReadRange& rhs) noexcept; + /// /// @brief Path with additional attributes. /// |