File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,9 +32,7 @@ RollingManifestWriter::RollingManifestWriter(
3232
3333RollingManifestWriter::~RollingManifestWriter () {
3434 // Ensure we close the current writer if not already closed
35- if (!closed_) {
36- (void )CloseCurrentWriter ();
37- }
35+ std::ignore = Close ();
3836}
3937
4038Status RollingManifestWriter::WriteAddedEntry (
@@ -96,13 +94,13 @@ bool RollingManifestWriter::ShouldRollToNewFile() const {
9694 if (current_writer_ == nullptr ) {
9795 return false ;
9896 }
99- // Roll when row count is a multiple of ROWS_DIVISOR and file size >= target
97+ // Roll when row count is a multiple of the divisor and file size >= target
10098 if (current_file_rows_ % kRowsDivisor == 0 ) {
10199 auto length_result = current_writer_->length ();
102100 if (length_result.has_value ()) {
103101 return length_result.value () >= target_file_size_in_bytes_;
104102 }
105- // If we can't get the length, don't roll
103+ // TODO(anyone): If we can't get the length, don't roll for now, revisit this later.
106104 }
107105 return false ;
108106}
Original file line number Diff line number Diff line change 3535namespace iceberg {
3636
3737// / \brief A rolling manifest writer that can produce multiple manifest files.
38- // /
39- // / As opposed to ManifestWriter, a rolling writer could produce multiple manifest
40- // / files.
4138class ICEBERG_EXPORT RollingManifestWriter {
4239 public:
4340 // / \brief Factory function type for creating ManifestWriter instances.
@@ -115,6 +112,8 @@ class ICEBERG_EXPORT RollingManifestWriter {
115112 // / \brief Close the current writer and add its ManifestFile to the list.
116113 Status CloseCurrentWriter ();
117114
115+ // / \brief The number of rows after which to consider rolling to a new file.
116+ // / \note This aligned with Iceberg's Java impl.
118117 static constexpr int64_t kRowsDivisor = 250 ;
119118
120119 ManifestWriterFactory manifest_writer_factory_;
You can’t perform that action at this time.
0 commit comments