You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/12/17 17:23:30 UTC

[GitHub] [iceberg] stevenzwu commented on a change in pull request #1939: Flink: Commit both data files and delete files to iceberg transaction.

stevenzwu commented on a change in pull request #1939:
URL: https://github.com/apache/iceberg/pull/1939#discussion_r545265016



##########
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:
       is this used?




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org