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

Method Close

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

Source from the content-addressed store, hash-verified

1507 }
1508
1509 Status Close() override {
1510 // Write 0 EOS message for compatibility with sequential readers
1511 RETURN_NOT_OK(WriteEOS());
1512
1513 // Write file footer
1514 RETURN_NOT_OK(UpdatePosition());
1515 int64_t initial_position = position_;
1516 RETURN_NOT_OK(
1517 WriteFileFooter(*schema_, dictionaries_, record_batches_, metadata_, sink_));
1518
1519 // Write footer length
1520 RETURN_NOT_OK(UpdatePosition());
1521 int32_t footer_length = static_cast<int32_t>(position_ - initial_position);
1522 if (footer_length <= 0) {
1523 return Status::Invalid("Invalid file footer");
1524 }
1525
1526 // write footer length in little endian
1527 footer_length = bit_util::ToLittleEndian(footer_length);
1528 RETURN_NOT_OK(Write(&footer_length, sizeof(int32_t)));
1529
1530 // Write magic bytes to end file
1531 return Write(kArrowMagicBytes.data(), kArrowMagicBytes.size());
1532 }
1533
1534 protected:
1535 std::shared_ptr<Schema> schema_;

Callers 3

WriteRecordBatchStreamFunction · 0.45
CloseFunction · 0.45
SerializeRecordBatchFunction · 0.45

Calls 6

WriteFileFooterFunction · 0.85
WriteFunction · 0.85
InvalidFunction · 0.50
ToLittleEndianFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected