From d63fa8a822a755e12a30c05a00c73786ade1c657 Mon Sep 17 00:00:00 2001 From: Pierre Villard Date: Fri, 12 May 2017 15:31:42 +0200 Subject: [PATCH] NIFI-3878 This closes #1790. AmbariReportingTask - Default run schedule set to 1 minute Signed-off-by: joewitt --- .../apache/nifi/reporting/ambari/AmbariReportingTask.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nifi-nar-bundles/nifi-ambari-bundle/nifi-ambari-reporting-task/src/main/java/org/apache/nifi/reporting/ambari/AmbariReportingTask.java b/nifi-nar-bundles/nifi-ambari-bundle/nifi-ambari-reporting-task/src/main/java/org/apache/nifi/reporting/ambari/AmbariReportingTask.java index 0ad434536d..a5ce9f45d5 100644 --- a/nifi-nar-bundles/nifi-ambari-bundle/nifi-ambari-reporting-task/src/main/java/org/apache/nifi/reporting/ambari/AmbariReportingTask.java +++ b/nifi-nar-bundles/nifi-ambari-bundle/nifi-ambari-reporting-task/src/main/java/org/apache/nifi/reporting/ambari/AmbariReportingTask.java @@ -17,6 +17,8 @@ package org.apache.nifi.reporting.ambari; import com.yammer.metrics.core.VirtualMachineMetrics; + +import org.apache.nifi.annotation.configuration.DefaultSchedule; import org.apache.nifi.annotation.documentation.CapabilityDescription; import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.annotation.lifecycle.OnScheduled; @@ -28,7 +30,7 @@ import org.apache.nifi.reporting.AbstractReportingTask; import org.apache.nifi.reporting.ReportingContext; import org.apache.nifi.reporting.ambari.api.MetricsBuilder; import org.apache.nifi.reporting.ambari.metrics.MetricsService; - +import org.apache.nifi.scheduling.SchedulingStrategy; import javax.json.Json; import javax.json.JsonBuilderFactory; @@ -51,6 +53,7 @@ import java.util.concurrent.TimeUnit; "works, this reporting task should be scheduled to run every 60 seconds. Each iteration it will send the metrics " + "from the previous iteration, and calculate the current metrics to be sent on next iteration. Scheduling this reporting " + "task at a frequency other than 60 seconds may produce unexpected results.") +@DefaultSchedule(strategy = SchedulingStrategy.TIMER_DRIVEN, period = "1 min") public class AmbariReportingTask extends AbstractReportingTask { static final PropertyDescriptor METRICS_COLLECTOR_URL = new PropertyDescriptor.Builder()