zhuzhurk commented on code in PR #23848:
URL: https://github.com/apache/flink/pull/23848#discussion_r1415539068


##########
flink-core/src/main/java/org/apache/flink/api/common/functions/util/AbstractRuntimeUDFContext.java:
##########
@@ -83,10 +86,27 @@ public AbstractRuntimeUDFContext(
     }
 
     @Override
+    // The @Override annotation will be removed in FLINK-2.0 version to avoid 
exposing the
+    // executionConfig, and the getter method should only be used internally.

Review Comment:
   It's fine to not document this because `AbstractRuntimeUDFContext` is an 
`@Internal` class.
   The annotation will be removed naturally once 
`RuntimeContext#getExecutionConfig()` is removed.



##########
flink-core/src/main/java/org/apache/flink/api/common/state/StateDescriptor.java:
##########
@@ -325,6 +326,19 @@ public void initializeSerializerUnlessSet(ExecutionConfig 
executionConfig) {
         }
     }
 
+    @Internal
+    public void initializeSerializerUnlessSet(SerializerFactory 
serializerFactory) {

Review Comment:
   Maybe change `initializeSerializerUnlessSet(ExecutionConfig)` to invoke this 
method to avoid logic duplication?
   ```
       public void initializeSerializerUnlessSet(ExecutionConfig 
executionConfig) {
           initializeSerializerUnlessSet(
                   new SerializerFactory() {
                       @Override
                       public <T> TypeSerializer<T> createSerializer(
                               TypeInformation<T> typeInformation) {
                           return 
typeInformation.createSerializer(executionConfig);
                       }
                   });
       }
   ```



##########
flink-tests/src/test/java/org/apache/flink/test/operators/MapITCase.java:
##########
@@ -90,16 +89,6 @@ public void testRuntimeContextAndExecutionConfigParams() 
throws Exception {
                         new RichMapFunction<String, String>() {
                             @Override
                             public String map(String value) throws Exception {
-                                Assert.assertTrue(
-                                        1000
-                                                == getRuntimeContext()
-                                                        .getExecutionConfig()
-                                                        
.getNumberOfExecutionRetries());
-                                Assert.assertTrue(
-                                        50000
-                                                == getRuntimeContext()
-                                                        .getExecutionConfig()
-                                                        
.getTaskCancellationInterval());

Review Comment:
   We should add some other verifications as a replacement, e.g. object reuse.



-- 
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...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to