Skip to content

Commit bf52913

Browse files
committed
Remove remaining Guava dependencies from SnapshotDiffApplier
- Replace Sets.difference() with standard Java stream operations - Remove unused Objects import - Use streams with filter/collect instead of Guava Sets utility methods - Reduces external dependencies and aligns with PR1 implementation
1 parent d339c70 commit bf52913

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

iceberg/openhouse/internalcatalog/src/main/java/com/linkedin/openhouse/internal/catalog/SnapshotDiffApplier.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import org.apache.iceberg.SnapshotRef;
1919
import org.apache.iceberg.SnapshotSummary;
2020
import org.apache.iceberg.TableMetadata;
21-
import org.apache.iceberg.relocated.com.google.common.base.Objects;
2221

2322
/**
2423
* Service responsible for applying snapshot changes to Iceberg table metadata.
@@ -166,8 +165,14 @@ private class SnapshotDiff {
166165
deletedSnapshots.stream().map(Snapshot::snapshotId).collect(Collectors.toSet());
167166
this.newRegularSnapshots =
168167
regularSnapshots.stream().filter(newSnapshots::contains).collect(Collectors.toList());
169-
this.staleRefs = Sets.difference(existingRefs.keySet(), providedRefs.keySet());
170-
this.existingAfterDeletionIds = Sets.difference(existingSnapshotByIds.keySet(), deletedIds);
168+
this.staleRefs =
169+
existingRefs.keySet().stream()
170+
.filter(key -> !providedRefs.containsKey(key))
171+
.collect(Collectors.toSet());
172+
this.existingAfterDeletionIds =
173+
existingSnapshotByIds.keySet().stream()
174+
.filter(id -> !deletedIds.contains(id))
175+
.collect(Collectors.toSet());
171176
this.unreferencedNewSnapshots =
172177
providedSnapshots.stream()
173178
.filter(

0 commit comments

Comments
 (0)