wombatu-kun commented on code in PR #16910:
URL: https://github.com/apache/iceberg/pull/16910#discussion_r3791837912
##########
core/src/main/java/org/apache/iceberg/RewriteTablePathUtil.java:
##########
@@ -328,6 +376,36 @@ private static List<ManifestFile>
manifestFilesInSnapshot(FileIO io, Snapshot sn
return manifestFiles;
}
+ /**
+ * Read the manifests referenced by a snapshot's manifest list, without
writing anything.
+ *
+ * <p>Callers need this before producing the rewritten manifest list, which
records each
+ * referenced manifest's rewritten length. Reading once here and passing the
result to {@link
+ * #rewriteManifestList(Snapshot, FileIO, TableMetadata, List, Set, String,
String, String,
+ * String, Map)} also avoids reading the manifest list twice.
+ *
+ * <p>An unreadable manifest list is logged and treated as empty, matching
the behaviour this
+ * method was extracted from.
+ *
+ * @param snapshot snapshot whose manifest list is read
+ * @param io file io
+ * @param sourcePrefix source prefix every referenced manifest must live
under
+ * @return the manifests referenced by the snapshot's manifest list, or an
empty list if the
+ * manifest list could not be read
+ */
+ public static List<ManifestFile> manifestsInSnapshot(
Review Comment:
Done 90d25bf7d. manifestFilesInSnapshot had a single caller, so it is
inlined and only manifestsInSnapshot remains.
--
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]