Skip to content

Commit f3484a6

Browse files
authored
Permanently enable extended payload format generation (#6434)
1 parent 8159d83 commit f3484a6

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

ydb/library/actors/core/event_pb.cpp

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#include "event_pb.h"
22

3-
// enable only when patch with this macro was successfully deployed
4-
#define USE_EXTENDED_PAYLOAD_FORMAT 0
5-
63
namespace NActors {
74
bool TRopeStream::Next(const void** data, int* size) {
85
*data = Iter.ContiguousData();
@@ -278,7 +275,6 @@ namespace NActors {
278275
return append(buf, SerializeNumber(number, buf));
279276
};
280277

281-
#if USE_EXTENDED_PAYLOAD_FORMAT
282278
char marker = ExtendedPayloadMarker;
283279
append(&marker, 1);
284280
if (!appendNumber(payload.size())) {
@@ -297,29 +293,6 @@ namespace NActors {
297293
return false;
298294
}
299295
}
300-
#else
301-
char marker = PayloadMarker;
302-
append(&marker, 1);
303-
if (!appendNumber(payload.size())) {
304-
return false;
305-
}
306-
for (const TRope& rope : payload) {
307-
if (!appendNumber(rope.GetSize())) {
308-
return false;
309-
}
310-
if (rope) {
311-
if (size) {
312-
chunker->BackUp(std::exchange(size, 0));
313-
}
314-
if (!chunker->WriteRope(&rope)) {
315-
return false;
316-
}
317-
}
318-
}
319-
if (size) {
320-
chunker->BackUp(size);
321-
}
322-
#endif
323296
}
324297

325298
return true;
@@ -396,7 +369,6 @@ namespace NActors {
396369
if (allowExternalDataChannel) {
397370
if (payload) {
398371
char temp[MaxNumberBytes];
399-
#if USE_EXTENDED_PAYLOAD_FORMAT
400372
size_t headerLen = 1 + SerializeNumber(payload.size(), temp);
401373
for (const TRope& rope : payload) {
402374
headerLen += SerializeNumber(rope.size(), temp);
@@ -405,14 +377,6 @@ namespace NActors {
405377
for (const TRope& rope : payload) {
406378
info.Sections.push_back(TEventSectionInfo{0, rope.size(), 0, 0, false});
407379
}
408-
#else
409-
info.Sections.push_back(TEventSectionInfo{0, 1 + SerializeNumber(payload.size(), temp), 0, 0, true}); // payload marker and rope count
410-
for (const TRope& rope : payload) {
411-
const size_t ropeSize = rope.GetSize();
412-
info.Sections.back().Size += SerializeNumber(ropeSize, temp);
413-
info.Sections.push_back(TEventSectionInfo{0, ropeSize, 0, 0, false}); // data as a separate section
414-
}
415-
#endif
416380
}
417381

418382
const size_t byteSize = Max<ssize_t>(0, recordSize) + preserializedSize;

0 commit comments

Comments
 (0)