diff --git a/ydb/core/persqueue/events/internal.h b/ydb/core/persqueue/events/internal.h index 0bc98a1d5753..7e584528fdd9 100644 --- a/ydb/core/persqueue/events/internal.h +++ b/ydb/core/persqueue/events/internal.h @@ -4,6 +4,7 @@ #include #include +#include #include #include #include @@ -65,6 +66,18 @@ namespace NPQ { {} }; + struct TDataKey { + TKey Key; + ui32 Size; + TInstant Timestamp; + ui64 CumulativeSize; + }; + + struct TSeqNoRange { + ui64 Min; + ui64 Max; + }; + struct TErrorInfo { NPersQueue::NErrorCode::EErrorCode ErrorCode; TString ErrorStr; @@ -171,6 +184,9 @@ struct TEvPQ { EvProvideDirectReadInfo, EvCheckPartitionStatusRequest, EvCheckPartitionStatusResponse, + EvGetWriteInfoRequest, + EvGetWriteInfoResponse, + EvGetWriteInfoError, EvEnd }; @@ -1004,7 +1020,43 @@ struct TEvPQ { struct TEvCheckPartitionStatusResponse : public TEventPB { }; + struct TEvGetWriteInfoRequest : public TEventLocal { + explicit TEvGetWriteInfoRequest(ui32 cookie) : + Cookie(cookie) + { + } + + ui32 Cookie; // ShadowPartitionId + }; + + struct TEvGetWriteInfoResponse : public TEventLocal { + TEvGetWriteInfoResponse(ui32 cookie, + THashMap&& seqNo, + std::deque&& bodyKeys, + TVector&& head) : + Cookie(cookie), + SeqNo(std::move(seqNo)), + BodyKeys(std::move(bodyKeys)), + Head(std::move(head)) + { + } + + ui32 Cookie; // ShadowPartitionId + THashMap SeqNo; // SourceId -> (MinSeqNo, MaxSeqNo) + std::deque BodyKeys; + TVector Head; + }; + + struct TEvGetWriteInfoError : public TEventLocal { + ui32 Cookie; // ShadowPartitionId + TString Message; + TEvGetWriteInfoError(ui32 cookie, TString message) : + Cookie(cookie), + Message(std::move(message)) + { + } + }; }; } //NKikimr diff --git a/ydb/core/persqueue/partition_types.h b/ydb/core/persqueue/partition_types.h index a84cc54e86ec..a2d2a7905389 100644 --- a/ydb/core/persqueue/partition_types.h +++ b/ydb/core/persqueue/partition_types.h @@ -120,13 +120,6 @@ struct TMessage { #undef DEFINE_CHECKER_GETTER }; -struct TDataKey { - TKey Key; - ui32 Size; - TInstant Timestamp; - ui64 CumulativeSize; -}; - } // namespace NKikimr::NPQ