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_r409539113
##########
File path:
nifi-nar-bundles/nifi-atlas-bundle/nifi-atlas-reporting-task/src/main/java/org/apache/nifi/atlas/reporting/ReportLineageToAtlas.java
##########
@@ -585,12 +594,58 @@ private void initAtlasProperties(ConfigurationContext
context) throws IOExceptio
if (confDir != null) {
// If atlasConfDir is not set, atlas-application.properties will
be searched under classpath.
Properties props = System.getProperties();
- final String atlasConfProp = "atlas.conf";
+ final String atlasConfProp =
ApplicationProperties.ATLAS_CONFIGURATION_DIRECTORY_PROPERTY;
props.setProperty(atlasConfProp, confDir.getAbsolutePath());
getLogger().debug("{} has been set to: {}", new
Object[]{atlasConfProp, props.getProperty(atlasConfProp)});
}
}
+ private void parseAtlasUrls(final PropertyValue atlasUrlsProp, final
Consumer<String> urlStrConsumer) {
+ setValue(
+ value -> Arrays.stream(value.split(ATLAS_URL_DELIMITER))
+ .map(String::trim)
+ .forEach(urlStrConsumer),
+ () -> {},
+ atlasUrlsProp,
+ atlasProperties.getProperty(ATLAS_PROPERTY_REST_ADDRESS)
+ );
+ }
+
+ private void setValue(Consumer<String> setter, Runnable emptyHandler,
PropertyValue elPropertyValue, String... properties) {
Review comment:
Seems to me a bit complicated too, but not insisted on changing it to
something simpler.
Minor: in case of the PropertyValue, it does not really matter whether it
has EL or not, so it could be simply called `propertyValue` I think.
----------------------------------------------------------------
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