wangzzu commented on code in PR #23386:
URL: https://github.com/apache/flink/pull/23386#discussion_r1320928205


##########
flink-runtime/src/main/java/org/apache/flink/runtime/failure/FailureEnricherUtils.java:
##########
@@ -106,23 +108,34 @@ static Collection<FailureEnricher> getFailureEnrichers(
             }
         }
 
+        if 
(!includedEnrichers.values().stream().allMatch(Boolean::booleanValue)) {

Review Comment:
   i think here can use `includedEnrichers.removeAll(failureEnrichers)` 
directly.
   It is not necessary to modify the return type of 
`getIncludedFailureEnrichers`. The boolean in the return type of this 
`getIncludedFailureEnrichers` method is not easy to explain.



##########
flink-runtime/src/main/java/org/apache/flink/runtime/failure/FailureEnricherUtils.java:
##########
@@ -106,23 +108,34 @@ static Collection<FailureEnricher> getFailureEnrichers(
             }
         }
 
+        if 
(!includedEnrichers.values().stream().allMatch(Boolean::booleanValue)) {

Review Comment:
   how do you think?



##########
flink-runtime/src/test/java/org/apache/flink/runtime/failure/FailureEnricherUtilsTest.java:
##########
@@ -109,6 +113,14 @@ public void testGetFailureEnrichers() {
         assertThat(enrichers).hasSize(1);
         // verify that the failure enricher was created and returned
         
assertThat(enrichers.iterator().next()).isInstanceOf(TestEnricher.class);
+
+        // Valid plus Invalid Name combination
+        configuration.set(
+                JobManagerOptions.FAILURE_ENRICHERS_LIST,
+                FailureEnricherUtilsTest.class.getName() + "," + 
TestEnricher.class.getName());
+        final Collection<FailureEnricher> validInvalidEnrichers =
+                FailureEnricherUtils.getFailureEnrichers(configuration, 
createPluginManager());

Review Comment:
   here should check the value is exist directly



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