[ https://issues.apache.org/jira/browse/GOBBLIN-1707?focusedWorklogId=812247&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-812247 ]
ASF GitHub Bot logged work on GOBBLIN-1707: ------------------------------------------- Author: ASF GitHub Bot Created on: 26/Sep/22 21:09 Start Date: 26/Sep/22 21:09 Worklog Time Spent: 10m Work Description: Will-Lo commented on code in PR #3569: URL: https://github.com/apache/gobblin/pull/3569#discussion_r980473637 ########## gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergTable.java: ########## @@ -46,36 +51,89 @@ public class IcebergTable { private final TableOperations tableOps; + /** @return metadata info limited to the most recent (current) snapshot */ public IcebergSnapshotInfo getCurrentSnapshotInfo() throws IOException { TableMetadata current = tableOps.current(); - Snapshot snapshot = current.currentSnapshot(); + return createSnapshotInfo(current.currentSnapshot(), Optional.of(current.metadataFileLocation())); + } + + /** @return metadata info for all known snapshots, ordered historically, with *most recent last* */ + public Iterator<IcebergSnapshotInfo> getAllSnapshotInfosIterator() { + TableMetadata current = tableOps.current(); + long currentSnapshotId = current.currentSnapshot().snapshotId(); + List<Snapshot> snapshots = current.snapshots(); + return Iterators.transform(snapshots.iterator(), snapshot -> { + try { + return IcebergTable.this.createSnapshotInfo( + snapshot, + currentSnapshotId == snapshot.snapshotId() ? Optional.of(current.metadataFileLocation()) : Optional.empty() + ); + } catch (IOException e) { + throw new RuntimeException(e); + } + }); + } + + /** Review Comment: There's a lot of case by case scenarios, can we summarize the data paths here and add it to the javadoc? Issue Time Tracking ------------------- Worklog Id: (was: 812247) Time Spent: 2h (was: 1h 50m) > Add Iceberg support to DistCp > ----------------------------- > > Key: GOBBLIN-1707 > URL: https://issues.apache.org/jira/browse/GOBBLIN-1707 > Project: Apache Gobblin > Issue Type: Task > Components: gobblin-core > Reporter: Kip Kohn > Assignee: Abhishek Tiwari > Priority: Major > Time Spent: 2h > Remaining Estimate: 0h > > Add capability for iceberg copy/replication to distcp. Support incremental > copy (only of delta changes since last time) in addition to full copy on > first time. -- This message was sent by Atlassian Jira (v8.20.10#820010)