kbendick commented on a change in pull request #1515: URL: https://github.com/apache/iceberg/pull/1515#discussion_r495638339
########## File path: flink/src/test/java/org/apache/iceberg/flink/FiniteTestSourceNoCheckpoint.java ########## @@ -0,0 +1,49 @@ +/* + * 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.flink; + +import java.util.Arrays; +import org.apache.flink.streaming.api.functions.source.SourceFunction; + +public class FiniteTestSourceNoCheckpoint<T> implements SourceFunction<T> { + + @SuppressWarnings("NonSerializableFieldInSerializableClass") + private final Iterable<T> elements; Review comment: Nit: I know this is just a test, but if you marked this as `transient` instead would you be able to remove the `SuppressWarning` and still get the same behavior? Or what about marking the type parameter T as Serializable, e.g. as `FiniteTestSourceNoCheckpoint<T extends Serializable> implements SourceFunction<T>`? I believe that the NonSerializable warning is coming from, at least in part, the fact that `Iterable` is not serializable. What about adding the `T extends Serializable` and then using `ArrayList` instead, which is serializable? Since this is just a test, I'm ok with letting it slide. However, I know that many users look at tests to find inspiration for their potential production code. So I would prefer that we handle this properly if it's not too much trouble. If it is too much trouble, it's not a blocking issue for me :) ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
