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



##########
File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/processor/StandardProcessContext.java
##########
@@ -85,6 +90,51 @@ public StandardProcessContext(final ProcessorNode 
processorNode, final Controlle
         }
     }
 
+    public StandardProcessContext(final ProcessorNode processorNode, final 
Map<String, String> propertiesOverride, final String annotationDataOverride, 
final ParameterLookup parameterLookup,
+                                  final ControllerServiceProvider 
controllerServiceProvider, final PropertyEncryptor propertyEncryptor,
+                                  final StateManager stateManager, final 
TaskTermination taskTermination, final NodeTypeProvider nodeTypeProvider) {
+        this.procNode = processorNode;
+        this.controllerServiceProvider = controllerServiceProvider;
+        this.propertyEncryptor = propertyEncryptor;
+        this.stateManager = stateManager;
+        this.taskTermination = taskTermination;
+        this.nodeTypeProvider = nodeTypeProvider;

Review comment:
       Yeah I think this can be cleaned up a bit. Will take a look.

##########
File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/service/StandardConfigurationContext.java
##########
@@ -74,9 +82,58 @@ public StandardConfigurationContext(final ComponentNode 
component, final Control
         }
     }
 
+    public StandardConfigurationContext(final ComponentNode component, final 
Map<String, String> propertyOverrides, final String annotationDataOverride, 
final ParameterLookup parameterLookup,
+                                        final ControllerServiceLookup 
serviceLookup, final String schedulingPeriod, final VariableRegistry 
variableRegistry) {
+        this.component = component;
+        this.serviceLookup = serviceLookup;
+        this.schedulingPeriod = schedulingPeriod;
+        this.variableRegistry = variableRegistry;
+        this.annotationData = annotationDataOverride;
+
+        if (schedulingPeriod == null) {
+            schedulingNanos = null;
+        } else {
+            if 
(FormatUtils.TIME_DURATION_PATTERN.matcher(schedulingPeriod).matches()) {
+                schedulingNanos = 
FormatUtils.getTimeDuration(schedulingPeriod, TimeUnit.NANOSECONDS);
+            } else {
+                schedulingNanos = null;
+            }
+        }
+

Review comment:
       Yeah I think this can be cleaned up a bit. Will take a look.




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