NIFI-3878 This closes #1790. AmbariReportingTask - Default run schedule set to 1 minute

Signed-off-by: joewitt <joewitt@apache.org>
This commit is contained in:
Pierre Villard 2017-05-12 15:31:42 +02:00 committed by joewitt
parent 6d07ebf50c
commit d63fa8a822
1 changed files with 4 additions and 1 deletions

View File

@ -17,6 +17,8 @@
package org.apache.nifi.reporting.ambari; package org.apache.nifi.reporting.ambari;
import com.yammer.metrics.core.VirtualMachineMetrics; 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.CapabilityDescription;
import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.annotation.lifecycle.OnScheduled; 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.ReportingContext;
import org.apache.nifi.reporting.ambari.api.MetricsBuilder; import org.apache.nifi.reporting.ambari.api.MetricsBuilder;
import org.apache.nifi.reporting.ambari.metrics.MetricsService; import org.apache.nifi.reporting.ambari.metrics.MetricsService;
import org.apache.nifi.scheduling.SchedulingStrategy;
import javax.json.Json; import javax.json.Json;
import javax.json.JsonBuilderFactory; 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 " + "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 " + "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.") "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 { public class AmbariReportingTask extends AbstractReportingTask {
static final PropertyDescriptor METRICS_COLLECTOR_URL = new PropertyDescriptor.Builder() static final PropertyDescriptor METRICS_COLLECTOR_URL = new PropertyDescriptor.Builder()