gaborkaszab commented on code in PR #18884:
URL: https://github.com/apache/iceberg/pull/18884#discussion_r4561310517


##########
core/src/main/java/org/apache/iceberg/RootManifestFile.java:
##########
@@ -21,14 +21,31 @@
 import java.nio.ByteBuffer;
 import java.util.Arrays;
 import java.util.List;
+import org.apache.iceberg.io.FileIO;
 import org.apache.iceberg.relocated.com.google.common.base.MoreObjects;
 import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
 import org.apache.iceberg.util.ByteBuffers;
+import org.apache.iceberg.util.LocationUtil;
 
 /** A {@link ManifestFile} for the root manifest of an adaptive metadata tree. 
*/
 class RootManifestFile implements ManifestFile {
   private static final int FORMAT_VERSION = 4;
 
+  static RootManifestFile from(Snapshot snapshot, FileIO io, String 
tableLocation) {

Review Comment:
   I wonder what the level of knowledge such a `RootManifestFile` should 
contain. For me this seems a simple abstraction that holds a couple of fields 
like location, length, etc.
   However, we now move knowledge about location resolution, FileIO, an entire 
`Snapshot` object here, and if I'm not mistaken also encryption related 
knowledge about how to get `keyMetadata` from `keyId` (or from the new fields 
we potentially add).
   I think such a knowledge should live one abstraction level above and 
`RootManifestFile` should have a single constructor accepting the pre-computed 
values. If we have multiple places where we create `RootManifestFile`s then 
maybe we should construct them either from `Snapshot`, or from some class like 
we have for `DataFiles`.
   WDYT?



-- 
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