markap14 commented on a change in pull request #3681: NIFI-6510 - Analytics
framework
URL: https://github.com/apache/nifi/pull/3681#discussion_r320907143
##########
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);
+ }
+
+ // Determine score name to use for evaluating model performance
+ String modelScoreName =
nifiProperties.getProperty(NiFiProperties.ANALYTICS_CONNECTION_MODEL_SCORE_NAME,
NiFiProperties.DEFAULT_ANALYTICS_CONNECTION_SCORE_NAME);
+
+ // Determine score threshold to use when evaluating acceptable
model
+ Double modelScoreThreshold;
+ try {
+ modelScoreThreshold =
Double.valueOf(nifiProperties.getProperty(NiFiProperties.ANALYTICS_CONNECTION_MODEL_SCORE_NAME,
NiFiProperties.DEFAULT_ANALYTICS_PREDICTION_INTERVAL));
+ } catch (final Exception e) {
+ modelScoreThreshold =
Double.valueOf(NiFiProperties.DEFAULT_ANALYTICS_CONNECTION_SCORE_THRESHOLD);
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