rdblue commented on code in PR #3457:
URL: https://github.com/apache/iceberg/pull/3457#discussion_r990828859
##########
core/src/main/java/org/apache/iceberg/ReachableFileUtil.java:
##########
@@ -103,14 +106,24 @@ private static TableMetadata
findFirstExistentPreviousMetadata(
* @return the location of manifest Lists
*/
public static List<String> manifestListLocations(Table table) {
- Iterable<Snapshot> snapshots = table.snapshots();
- List<String> manifestListLocations = Lists.newArrayList();
- for (Snapshot snapshot : snapshots) {
- String manifestListLocation = snapshot.manifestListLocation();
- if (manifestListLocation != null) {
- manifestListLocations.add(manifestListLocation);
- }
+ return manifestListLocations(table, null);
+ }
+
+ /**
+ * Returns locations of manifest lists in a table.
+ *
+ * @param table table for which manifestList needs to be fetched
+ * @param snapshots ids of snapshots for which manifest lists will be
returned
+ * @return the location of manifest Lists
+ */
+ public static List<String> manifestListLocations(Table table, Set<Long>
snapshots) {
+ Stream<Snapshot> snapshotStream =
StreamSupport.stream(table.snapshots().spliterator(), false);
Review Comment:
Minor: rather than using Java's `spliterator` method and streams, we
generally prefer to use `Iterables.filter` and `Iterables.transform` or a
simple `for` loop.
--
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]