kbendick commented on a change in pull request #1515:
URL: https://github.com/apache/iceberg/pull/1515#discussion_r495641395



##########
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> {

Review comment:
       NIT: Can we name this `NonCheckpointingFiniteTestSource`?
   
   Additionally, if it's used in a test where checkpointing is enabled, it 
seems to me as though it will likely send the data twice (once because of the 
run and then a second time when the checkpoint happens). Are we sure that this 
source function will not checkpoint, regardless of the configured execution 
environment? I would think that we'd need to override some of the checkpoint 
related methods or something to ensure that. I'm not sure what the best 
solution to that is, or if it's even clearly a problem. But I am suspicious / 
confused at why it's sending the data twice in the test if the run function 
only emits the elements one time.
   
   Typically, source functions synchronize on the checkpoint lock obtained from 
the run methods SourceContext<> argument, e.g. 
`synchronized(ctx.getCheckpointLock())`. I'm not quite sure if that should be 
used for a non-checkpointing source, but I do worry that the way this Source is 
currently set up doesn't guarantee non-checkpointing behavior and thus could 
lead to flakey tests.




----------------------------------------------------------------
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]

Reply via email to