markap14 commented on a change in pull request #3681: NIFI-6510 - Analytics 
framework
URL: https://github.com/apache/nifi/pull/3681#discussion_r320906392
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java
 ##########
 @@ -588,8 +597,41 @@ private FlowController(
             zooKeeperStateServer = null;
         }
 
-        eventAccess = new StandardEventAccess(this, flowFileEventRepository);
         componentStatusRepository = createComponentStatusRepository();
+
+        final boolean analyticsEnabled =  
Boolean.parseBoolean(nifiProperties.getProperty(NiFiProperties.ANALYTICS_PREDICTION_ENABLED,
 NiFiProperties.DEFAULT_ANALYTICS_PREDICTION_ENABLED));
+
+        if(analyticsEnabled) {
+
+            // Determine interval for predicting future feature values
+            final String predictionInterval = 
nifiProperties.getProperty(NiFiProperties.ANALYTICS_PREDICTION_INTERVAL, 
NiFiProperties.DEFAULT_ANALYTICS_PREDICTION_INTERVAL);
+            long predictionIntervalMillis;
+            try {
+                predictionIntervalMillis = 
FormatUtils.getTimeDuration(predictionInterval, TimeUnit.MILLISECONDS);
+            } catch (final Exception e) {
+                predictionIntervalMillis = 
FormatUtils.getTimeDuration(NiFiProperties.DEFAULT_ANALYTICS_PREDICTION_INTERVAL,
 TimeUnit.MILLISECONDS);
 
 Review comment:
   This should probably log a warning to notify administrators that the value 
provided was invalid and a default value will be used.

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