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

Method WritePayload

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

Source from the content-addressed store, hash-verified

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