fapaul commented on a change in pull request #18043:
URL: https://github.com/apache/flink/pull/18043#discussion_r796394250



##########
File path: 
flink-clients/src/main/java/org/apache/flink/client/program/StreamContextEnvironment.java
##########
@@ -161,6 +213,18 @@ public static void setAsContext(
             final boolean suppressSysout) {
         StreamExecutionEnvironmentFactory factory =
                 conf -> {
+                    final List<String> errors = new ArrayList<>();
+                    final boolean allowConfigurations =
+                            configuration.getBoolean(
+                                    
DeploymentOptions.ALLOW_CLIENT_JOB_CONFIGURATIONS);
+                    if (!allowConfigurations && !conf.toMap().isEmpty()) {
+                        conf.toMap()
+                                .forEach(
+                                        (k, v) ->
+                                                errors.add(
+                                                        
ConfigurationNotAllowedMessage
+                                                                
.ofConfigurationKeyAndValue(k, v)));

Review comment:
       Actually, I like that all errors are collected and users immediately see 
what they are not allowed to set. Otherwise, it might take multiple submissions 
until they have seen all errors. Regarding the code complexity, it seems okay 
to me since we are only adding to the `StreamContextEnvironment`. In fact, I am 
a bit surprised that the `StreamContextEnvironment` is marked as 
`@PublicEvolving` not sure when users will ever interact with it.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to