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

Method WritePayload

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

Source from the content-addressed store, hash-verified

1461 ~PayloadFileWriter() override = default;
1462
1463 Status WritePayload(const IpcPayload& payload) override {
1464#ifndef NDEBUG
1465 // Catch bug fixed in ARROW-3236
1466 RETURN_NOT_OK(UpdatePositionCheckAligned());
1467#endif
1468
1469 // Metadata length must include padding, it's computed by WriteIpcPayload()
1470 FileBlock block = {position_, 0, payload.body_length};
1471 RETURN_NOT_OK(WriteIpcPayload(payload, options_, sink_, &block.metadata_length));
1472 RETURN_NOT_OK(UpdatePositionCheckAligned());
1473
1474 // Record position and size of some message types, to list them in the footer
1475 switch (payload.type) {
1476 case MessageType::DICTIONARY_BATCH:
1477 dictionaries_.push_back(block);
1478 break;
1479 case MessageType::RECORD_BATCH:
1480 record_batches_.push_back(block);
1481 break;
1482 default:
1483 break;
1484 }
1485
1486 return Status::OK();
1487 }
1488
1489 Status Start() override {
1490 // 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