diff options
author | gvit <gvit@ydb.tech> | 2023-01-23 13:35:08 +0300 |
---|---|---|
committer | gvit <gvit@ydb.tech> | 2023-01-23 13:35:08 +0300 |
commit | da72c4727923040ee9f7328caa9ee22e4bd4ab09 (patch) | |
tree | 724aaad14329bb2ae9821238b1d43b34e1af1a9d /library/cpp/actors/core/event_pb.h | |
parent | 006419e12383729f3d660ad51f5a84832d6e3780 (diff) | |
download | ydb-da72c4727923040ee9f7328caa9ee22e4bd4ab09.tar.gz |
Revert "Support interface part for ExternalDataChannel feature"
This reverts commit 0a05f95e826bc5416a494ba7822d7d7eaa8ce52c, reversing
changes made to 1c58d6c48d9dc449c72880696f23217d19595db1.
Diffstat (limited to 'library/cpp/actors/core/event_pb.h')
-rw-r--r-- | library/cpp/actors/core/event_pb.h | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/library/cpp/actors/core/event_pb.h b/library/cpp/actors/core/event_pb.h index 594559cea7..2d388fceeb 100644 --- a/library/cpp/actors/core/event_pb.h +++ b/library/cpp/actors/core/event_pb.h @@ -56,8 +56,10 @@ namespace NActors { bool WriteRope(const TRope *rope) override; bool WriteString(const TString *s) override; - inline TIntrusivePtr<TEventSerializedData> Release(TEventSerializationInfo&& serializationInfo) { - Buffers->SetSerializationInfo(std::move(serializationInfo)); + inline TIntrusivePtr<TEventSerializedData> Release(bool extendedFormat) { + if (extendedFormat) { + Buffers->SetExtendedFormat(); + } return std::move(Buffers); } @@ -158,6 +160,10 @@ namespace NActors { return true; } + bool IsExtendedFormat() const override { + return static_cast<bool>(Payload); + } + bool SerializeToArcadiaStream(TChunkSerializer* chunker) const override { // serialize payload first if (Payload) { @@ -230,7 +236,7 @@ namespace NActors { TRope::TConstIterator iter = input->GetBeginIter(); ui64 size = input->GetSize(); - if (const auto& info = input->GetSerializationInfo(); info.IsExtendedFormat) { + if (input->IsExtendedFormat()) { // check marker if (!iter.Valid() || *iter.ContiguousData() != PayloadMarker) { Y_FAIL("invalid event"); @@ -282,28 +288,6 @@ namespace NActors { CachedByteSize = 0; } - TEventSerializationInfo CreateSerializationInfo() const override { - TEventSerializationInfo info; - - if (Payload) { - char temp[MaxNumberBytes]; - info.Sections.push_back(TEventSectionInfo{0, 1, 0, 0}); // payload marker - info.Sections.push_back(TEventSectionInfo{0, SerializeNumber(Payload.size(), temp), 0, 0}); - for (const TRope& payload : Payload) { - info.Sections.push_back(TEventSectionInfo{0, SerializeNumber(payload.GetSize(), temp), 0, 0}); // length - info.Sections.push_back(TEventSectionInfo{0, payload.GetSize(), 0, 0}); // data - } - info.IsExtendedFormat = true; - } else { - info.IsExtendedFormat = false; - } - - const int byteSize = Max(0, Record.ByteSize()); - info.Sections.push_back(TEventSectionInfo{0, static_cast<size_t>(byteSize), 0, 0}); - - return info; - } - public: void ReservePayload(size_t size) { Payload.reserve(size); |