rdblue commented on a change in pull request #1477:
URL: https://github.com/apache/iceberg/pull/1477#discussion_r496321345
##########
File path:
flink/src/main/java/org/apache/iceberg/flink/sink/IcebergFilesCommitter.java
##########
@@ -240,12 +256,22 @@ public void processElement(StreamRecord<DataFile>
element) {
}
@Override
- public void endInput() {
+ public void endInput() throws IOException {
// Flush the buffered data files into 'dataFilesPerCheckpoint' firstly.
- dataFilesPerCheckpoint.put(Long.MAX_VALUE,
ImmutableList.copyOf(dataFilesOfCurrentCheckpoint));
+ long currentCheckpointId = Long.MAX_VALUE;
+ dataFilesPerCheckpoint.put(currentCheckpointId,
writeToManifest(currentCheckpointId));
dataFilesOfCurrentCheckpoint.clear();
- commitUpToCheckpoint(dataFilesPerCheckpoint, flinkJobId, Long.MAX_VALUE);
+ commitUpToCheckpoint(dataFilesPerCheckpoint, flinkJobId,
currentCheckpointId);
+ }
+
+ /**
+ * Write all the complete data files to a newly created manifest file and
return the manifest's avro serialized bytes.
+ */
+ private Byte[] writeToManifest(long checkpointId) throws IOException {
Review comment:
Why is this `Byte[]` instead of `byte[]`?
----------------------------------------------------------------
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]