turcsanyip commented on a change in pull request #4213: NIFI-7280 Use Atlas 
metadata namespace in Atlas Reporting Task
URL: https://github.com/apache/nifi/pull/4213#discussion_r409589604
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-atlas-bundle/nifi-atlas-reporting-task/src/main/java/org/apache/nifi/atlas/reporting/ReportLineageToAtlas.java
 ##########
 @@ -371,35 +381,32 @@ protected PropertyDescriptor 
getSupportedDynamicPropertyDescriptor(String proper
         return null;
     }
 
-    private void parseAtlasUrls(final PropertyValue atlasUrlsProp, final 
Consumer<String> urlStrConsumer) {
-        final String atlasUrlsStr = 
atlasUrlsProp.evaluateAttributeExpressions().getValue();
-        if (atlasUrlsStr != null && !atlasUrlsStr.isEmpty()) {
-            Arrays.stream(atlasUrlsStr.split(","))
-                    .map(String::trim)
-                    .forEach(urlStrConsumer);
-        }
-    }
-
     @Override
     protected Collection<ValidationResult> customValidate(ValidationContext 
context) {
         final Collection<ValidationResult> results = new ArrayList<>();
 
         final boolean isSSLContextServiceSet = 
context.getProperty(SSL_CONTEXT_SERVICE).isSet();
         final ValidationResult.Builder invalidSSLService = new 
ValidationResult.Builder()
                 .subject(SSL_CONTEXT_SERVICE.getDisplayName()).valid(false);
-        parseAtlasUrls(context.getProperty(ATLAS_URLS), input -> {
-            final ValidationResult.Builder builder = new 
ValidationResult.Builder().subject(ATLAS_URLS.getDisplayName()).input(input);
-            try {
-                final URL url = new URL(input);
-                if ("https".equalsIgnoreCase(url.getProtocol()) && 
!isSSLContextServiceSet) {
-                    results.add(invalidSSLService.explanation("required by 
HTTPS Atlas access").build());
-                } else {
-                    results.add(builder.explanation("Valid 
URI").valid(true).build());
-                }
-            } catch (Exception e) {
-                results.add(builder.explanation("Contains invalid URI: " + 
e).valid(false).build());
-            }
-        });
+
+        String atlasUrls = 
context.getProperty(ATLAS_URLS).evaluateAttributeExpressions().getValue();
+        if (!StringUtils.isEmpty(atlasUrls)) {
+            Arrays.stream(atlasUrls.split(ATLAS_URL_DELIMITER))
+                .map(String::trim)
+                .forEach(input -> {
+                    final ValidationResult.Builder builder = new 
ValidationResult.Builder().subject(ATLAS_URLS.getDisplayName()).input(input);
+                    try {
+                        final URL url = new URL(input);
+                        if ("https".equalsIgnoreCase(url.getProtocol()) && 
!isSSLContextServiceSet) {
 
 Review comment:
   SSL Context Service is not used for Atlas connection so this validation 
check can be removed.

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


With regards,
Apache Git Services

Reply via email to