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

Method Close

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

Source from the content-addressed store, hash-verified

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