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

Method Close

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

Source from the content-addressed store, hash-verified

1523 }
1524
1525 Status Close() override {
1526 // Write 0 EOS message for compatibility with sequential readers
1527 RETURN_NOT_OK(WriteEOS());
1528
1529 // Write file footer
1530 RETURN_NOT_OK(UpdatePosition());
1531 int64_t initial_position = position_;
1532 RETURN_NOT_OK(
1533 WriteFileFooter(*schema_, dictionaries_, record_batches_, metadata_, sink_));
1534
1535 // Write footer length
1536 RETURN_NOT_OK(UpdatePosition());
1537 int32_t footer_length = static_cast<int32_t>(position_ - initial_position);
1538 if (footer_length <= 0) {
1539 return Status::Invalid("Invalid file footer");
1540 }
1541
1542 // write footer length in little endian
1543 footer_length = bit_util::ToLittleEndian(footer_length);
1544 RETURN_NOT_OK(Write(&footer_length, sizeof(int32_t)));
1545
1546 // Write magic bytes to end file
1547 return Write(kArrowMagicBytes.data(), kArrowMagicBytes.size());
1548 }
1549
1550 protected:
1551 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