openinx commented on a change in pull request #1939:
URL: https://github.com/apache/iceberg/pull/1939#discussion_r545556133
##########
File path: flink/src/main/java/org/apache/iceberg/flink/sink/DeltaManifests.java
##########
@@ -19,30 +19,40 @@
package org.apache.iceberg.flink.sink;
-import java.io.IOException;
-import org.apache.flink.core.io.SimpleVersionedSerializer;
+import java.util.Iterator;
+import java.util.List;
import org.apache.iceberg.ManifestFile;
-import org.apache.iceberg.ManifestFiles;
-import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
+import org.apache.iceberg.relocated.com.google.common.collect.Lists;
-class FlinkManifestSerializer implements
SimpleVersionedSerializer<ManifestFile> {
- private static final int VERSION_NUM = 1;
- static final FlinkManifestSerializer INSTANCE = new
FlinkManifestSerializer();
+class DeltaManifests implements Iterable<ManifestFile> {
- @Override
- public int getVersion() {
- return VERSION_NUM;
+ private final ManifestFile dataManifest;
+ private final ManifestFile deleteManifest;
+
+ DeltaManifests(ManifestFile dataManifest, ManifestFile deleteManifest) {
+ this.dataManifest = dataManifest;
+ this.deleteManifest = deleteManifest;
}
- @Override
- public byte[] serialize(ManifestFile manifestFile) throws IOException {
- Preconditions.checkNotNull(manifestFile, "ManifestFile to be serialized
should not be null");
+ ManifestFile dataManifest() {
+ return dataManifest;
+ }
- return ManifestFiles.encode(manifestFile);
+ ManifestFile deleteManifest() {
+ return deleteManifest;
}
@Override
- public ManifestFile deserialize(int version, byte[] serialized) throws
IOException {
- return ManifestFiles.decode(serialized);
+ public Iterator<ManifestFile> iterator() {
Review comment:
OK, Agreed we don't have to introduce the complex `Iterable`.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]