markap14 commented on a change in pull request #5113:
URL: https://github.com/apache/nifi/pull/5113#discussion_r657371543



##########
File path: 
nifi-stateless/nifi-stateless-bundle/nifi-stateless-engine/src/main/java/org/apache/nifi/stateless/config/PropertiesFileFlowDefinitionParser.java
##########
@@ -174,6 +180,80 @@
         return new ArrayList<>(reportingTaskDefinitions.values());
     }
 
+    private List<ParameterProviderDefinition> getParameterProviders(final 
Map<String, String> properties, final List<ParameterOverride> 
parameterOverrides) {
+        final Map<String, ParameterProviderDefinition> 
parameterProviderDefinitions = new LinkedHashMap<>();
+
+        for (final String propertyName : properties.keySet()) {
+            final Matcher matcher = 
PARAMETER_PROVIDER_PATTERN.matcher(propertyName);
+            if (!matcher.matches()) {
+                continue;
+            }
+
+            // For a property name like:
+            // nifi.stateless.parameter.provider.abc.name=hello
+            // We consider 'abc' the <parameter provider key> and 'name' the 
<relative property name>
+            final String parameterProviderKey = matcher.group(1);
+            final ParameterProviderDefinition definition = 
parameterProviderDefinitions.computeIfAbsent(parameterProviderKey, key -> new 
ParameterProviderDefinition());
+            final String relativePropertyName = matcher.group(2);
+            final String propertyValue = properties.get(propertyName);
+
+            if (relativePropertyName.startsWith("properties.")) {
+                if (relativePropertyName.length() < 12) {
+                    logger.warn("Encountered unexpected property <" + 
propertyName + "> in flow definition. This property will be ignored.");

Review comment:
       Well, I don't think we know at this point whether or not it's valid. At 
this point, we are only parsing the definition. Validity would really depend on 
the implementation of the Parameter Provider.




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


Reply via email to