MCPcopy Create free account
hub / github.com/apache/arrow / WritePayload

Method WritePayload

cpp/src/arrow/ipc/writer.cc:1486–1510  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1484 ~PayloadFileWriter() override = default;
1485
1486 Status WritePayload(const IpcPayload& payload) override {
1487#ifndef NDEBUG
1488 // Catch bug fixed in ARROW-3236
1489 RETURN_NOT_OK(UpdatePositionCheckAligned());
1490#endif
1491
1492 // Metadata length must include padding, it's computed by WriteIpcPayload()
1493 FileBlock block = {position_, 0, payload.body_length};
1494 RETURN_NOT_OK(WriteIpcPayload(payload, options_, sink_, &block.metadata_length));
1495 RETURN_NOT_OK(UpdatePositionCheckAligned());
1496
1497 // Record position and size of some message types, to list them in the footer
1498 switch (payload.type) {
1499 case MessageType::DICTIONARY_BATCH:
1500 dictionaries_.push_back(block);
1501 break;
1502 case MessageType::RECORD_BATCH:
1503 record_batches_.push_back(block);
1504 break;
1505 default:
1506 break;
1507 }
1508
1509 return Status::OK();
1510 }
1511
1512 Status Start() override {
1513 // ARROW-3236: The initial position -1 needs to be updated to the stream's

Callers 4

StartMethod · 0.45
WriteDictionaryMethod · 0.45
WriteBatchPayloadMethod · 0.45
WritePayloadFunction · 0.45

Calls 3

WriteIpcPayloadFunction · 0.85
push_backMethod · 0.80
OKFunction · 0.50

Tested by 3

StartMethod · 0.36
WriteDictionaryMethod · 0.36
WriteBatchPayloadMethod · 0.36