nastra commented on code in PR #6706: URL: https://github.com/apache/iceberg/pull/6706#discussion_r1098938112
########## core/src/main/java/org/apache/iceberg/SnapshotOperations.java: ########## @@ -0,0 +1,190 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.iceberg; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; +import org.apache.iceberg.exceptions.ValidationException; +import org.apache.iceberg.relocated.com.google.common.base.Preconditions; +import org.apache.iceberg.relocated.com.google.common.collect.Lists; +import org.apache.iceberg.relocated.com.google.common.collect.Maps; +import org.apache.iceberg.relocated.com.google.common.collect.Sets; + +class SnapshotOperations implements Serializable { Review Comment: ``` class BaseSnapshot implements Snapshot { private static final long INITIAL_SEQUENCE_NUMBER = 0; @@ -42,7 +43,7 @@ class BaseSnapshot implements Snapshot { private final long timestampMillis; private final String manifestListLocation; private final String operation; - private final Map<String, String> summary; + private final SerializableMap<String, String> summary; private final Integer schemaId; private final String[] v1ManifestLocations; @@ -69,7 +70,7 @@ class BaseSnapshot implements Snapshot { this.parentId = parentId; this.timestampMillis = timestampMillis; this.operation = operation; - this.summary = summary; + this.summary = SerializableMap.copyOf(summary); this.schemaId = schemaId; this.manifestListLocation = manifestList; this.v1ManifestLocations = null; @@ -89,7 +90,7 @@ class BaseSnapshot implements Snapshot { this.parentId = parentId; this.timestampMillis = timestampMillis; this.operation = operation; - this.summary = summary; + this.summary = SerializableMap.copyOf(summary); this.schemaId = schemaId; this.manifestListLocation = null; this.v1ManifestLocations = v1ManifestLocations; diff --git a/core/src/main/java/org/apache/iceberg/SnapshotOperations.java b/core/src/main/java/org/apache/iceberg/SnapshotOperations.java index 9f681ce0a..087444212 100644 --- a/core/src/main/java/org/apache/iceberg/SnapshotOperations.java +++ b/core/src/main/java/org/apache/iceberg/SnapshotOperations.java @@ -55,7 +55,7 @@ class SnapshotOperations implements Serializable { SerializableSupplier<List<Snapshot>> snapshotsSupplier, Map<String, SnapshotRef> refs, SerializableSupplier<Map<String, SnapshotRef>> refsSupplier) { - this.snapshots = ImmutableList.copyOf(snapshots); + this.snapshots = Lists.newArrayList(snapshots); ``` just FYI that this is what's needed to make the Kryo tests pass -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org