zhjwpku commented on code in PR #443:
URL: https://github.com/apache/iceberg-cpp/pull/443#discussion_r2650752633


##########
src/iceberg/manifest/rolling_manifest_writer.h:
##########
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+/// \file iceberg/manifest/rolling_manifest_writer.h
+/// Rolling manifest writer that can produce multiple manifest files.
+
+#include <functional>
+#include <memory>
+#include <vector>
+
+#include "iceberg/iceberg_export.h"
+#include "iceberg/manifest/manifest_entry.h"
+#include "iceberg/manifest/manifest_list.h"
+#include "iceberg/manifest/manifest_writer.h"
+#include "iceberg/result.h"
+
+namespace iceberg {
+
+/// \brief A rolling manifest writer that can produce multiple manifest files.
+///
+/// As opposed to ManifestWriter, a rolling writer could produce multiple 
manifest
+/// files.
+class ICEBERG_EXPORT RollingManifestWriter {
+ public:
+  /// \brief Factory function type for creating ManifestWriter instances.
+  using ManifestWriterFactory = 
std::function<Result<std::unique_ptr<ManifestWriter>>()>;
+
+  /// \brief Construct a rolling manifest writer.
+  /// \param manifest_writer_factory Factory function to create new 
ManifestWriter
+  /// instances.
+  /// \param target_file_size_in_bytes Target file size in bytes. When the 
current
+  /// file reaches this size (and row count is a multiple of 250), a new file
+  /// will be created.
+  RollingManifestWriter(ManifestWriterFactory manifest_writer_factory,
+                        int64_t target_file_size_in_bytes);
+
+  ~RollingManifestWriter();
+
+  /// \brief Add an added entry for a file.
+  ///
+  /// \param file a data file
+  /// \return Status::OK() if the entry was written successfully

Review Comment:
   Changed to `\return Status indicating success or failure`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to