NIFI-251: Added CapabilityDescription and Tags annotations to reporting tasks and controller services

This commit is contained in:
Mark Payne 2015-01-22 11:59:53 -05:00
parent 716e03b502
commit 5161b234a5
10 changed files with 58 additions and 4 deletions

View File

@ -24,6 +24,8 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.components.PropertyDescriptor;
import org.apache.nifi.controller.annotation.OnConfigured; import org.apache.nifi.controller.annotation.OnConfigured;
import org.apache.nifi.controller.status.ConnectionStatus; import org.apache.nifi.controller.status.ConnectionStatus;
@ -32,10 +34,15 @@ import org.apache.nifi.controller.status.ProcessorStatus;
import org.apache.nifi.reporting.AbstractReportingTask; import org.apache.nifi.reporting.AbstractReportingTask;
import org.apache.nifi.reporting.ReportingContext; import org.apache.nifi.reporting.ReportingContext;
import org.apache.nifi.util.FormatUtils; import org.apache.nifi.util.FormatUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@Tags({"stats", "log"})
@CapabilityDescription("Logs the 5-minute stats that are shown in the NiFi Summary Page for Processors and Connections, as"
+ " well optionally logging the deltas between the previous iteration and the current iteration. Processors' stats are"
+ " logged using the org.apache.nifi.controller.ControllerStatusReportingTask.Processors logger, while Connections' stats are"
+ " logged using the org.apache.nifi.controller.ControllerStatusReportingTask.Connections logger. These can be configured"
+ " in the NiFi logging configuration to log to different files, if desired.")
public class ControllerStatusReportingTask extends AbstractReportingTask { public class ControllerStatusReportingTask extends AbstractReportingTask {
public static final PropertyDescriptor SHOW_DELTAS = new PropertyDescriptor.Builder() public static final PropertyDescriptor SHOW_DELTAS = new PropertyDescriptor.Builder()

View File

@ -24,6 +24,8 @@ import java.util.Map;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.components.PropertyDescriptor;
import org.apache.nifi.processor.util.StandardValidators; import org.apache.nifi.processor.util.StandardValidators;
import org.apache.nifi.reporting.AbstractReportingTask; import org.apache.nifi.reporting.AbstractReportingTask;
@ -32,10 +34,13 @@ import org.apache.nifi.reporting.ReportingContext;
import org.apache.nifi.reporting.Severity; import org.apache.nifi.reporting.Severity;
import org.apache.nifi.util.FormatUtils; import org.apache.nifi.util.FormatUtils;
import org.apache.nifi.util.NiFiProperties; import org.apache.nifi.util.NiFiProperties;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@Tags({"disk", "storage", "warning", "monitoring", "repo"})
@CapabilityDescription("Checks the amount of storage space available for the Content Repository and FlowFile Repository"
+ " and warns (via a log message and a System-Level Bulletin) if the partition on which either repository exceeds"
+ " some configurable threshold of storage space")
public class MonitorDiskUsage extends AbstractReportingTask { public class MonitorDiskUsage extends AbstractReportingTask {
private static final Logger logger = LoggerFactory.getLogger(MonitorDiskUsage.class); private static final Logger logger = LoggerFactory.getLogger(MonitorDiskUsage.class);

View File

@ -16,7 +16,10 @@
*/ */
package org.apache.nifi.controller; package org.apache.nifi.controller;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.controller.ConfigurationContext; import org.apache.nifi.controller.ConfigurationContext;
import java.lang.management.GarbageCollectorMXBean; import java.lang.management.GarbageCollectorMXBean;
import java.lang.management.ManagementFactory; import java.lang.management.ManagementFactory;
import java.lang.management.MemoryPoolMXBean; import java.lang.management.MemoryPoolMXBean;
@ -40,7 +43,6 @@ import org.apache.nifi.reporting.ReportingContext;
import org.apache.nifi.reporting.ReportingInitializationContext; import org.apache.nifi.reporting.ReportingInitializationContext;
import org.apache.nifi.reporting.Severity; import org.apache.nifi.reporting.Severity;
import org.apache.nifi.util.FormatUtils; import org.apache.nifi.util.FormatUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -86,6 +88,10 @@ import org.slf4j.LoggerFactory;
* </li> * </li>
* </ul> * </ul>
*/ */
@Tags({"monitor", "memory", "heap", "jvm", "gc", "garbage collection", "warning"})
@CapabilityDescription("Checks the amount of Java Heap available in the JVM for a particular JVM Memory Pool. If the"
+ " amount of space used exceeds some configurable threshold, will warn (via a log message and System-Level Bulletin)"
+ " that the memory pool is exceeding this threshold.")
public class MonitorMemory extends AbstractReportingTask { public class MonitorMemory extends AbstractReportingTask {
public static final PropertyDescriptor MEMORY_POOL_PROPERTY = new PropertyDescriptor.Builder() public static final PropertyDescriptor MEMORY_POOL_PROPERTY = new PropertyDescriptor.Builder()

View File

@ -24,6 +24,8 @@ import java.util.concurrent.atomic.AtomicReference;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.components.PropertyDescriptor;
import org.apache.nifi.controller.ConfigurationContext; import org.apache.nifi.controller.ConfigurationContext;
import org.apache.nifi.controller.annotation.OnConfigured; import org.apache.nifi.controller.annotation.OnConfigured;
@ -44,6 +46,11 @@ import com.yammer.metrics.reporting.GangliaReporter;
* to the Ganglia server and optionally allows a "port" property (default * to the Ganglia server and optionally allows a "port" property (default
* otherwise is 8649) * otherwise is 8649)
*/ */
@Tags({"ganglia", "stats"})
@CapabilityDescription("Reports metrics to Ganglia so that Ganglia can be used for external monitoring of the application. Metrics"
+ " reported include JVM Metrics (optional); the following 5-minute NiFi statistics: FlowFiles Received, Bytes Received,"
+ " FlowFiles Sent, Bytes Sent, Bytes Read, Bytes Written, Total Task Duration; and the current values for"
+ " FlowFiles Queued, Bytes Queued, and number of Active Threads.")
public class StandardGangliaReporter extends AbstractReportingTask { public class StandardGangliaReporter extends AbstractReportingTask {
public static final PropertyDescriptor HOSTNAME = new PropertyDescriptor.Builder() public static final PropertyDescriptor HOSTNAME = new PropertyDescriptor.Builder()

View File

@ -18,6 +18,8 @@ package org.apache.nifi.distributed.cache.client;
import java.io.IOException; import java.io.IOException;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.controller.ControllerService; import org.apache.nifi.controller.ControllerService;
/** /**
@ -25,6 +27,9 @@ import org.apache.nifi.controller.ControllerService;
* Distributed Cache that functions similarly to a {@link java.util.Map Map}. * Distributed Cache that functions similarly to a {@link java.util.Map Map}.
* *
*/ */
@Tags({"distributed", "client", "cluster", "map", "cache"})
@CapabilityDescription("Provides the ability to communicate with a DistributedMapCacheServer. This allows "
+ "multiple nodes to coordinate state with a single remote entity.")
public interface DistributedMapCacheClient extends ControllerService { public interface DistributedMapCacheClient extends ControllerService {
/** /**

View File

@ -18,12 +18,17 @@ package org.apache.nifi.distributed.cache.client;
import java.io.IOException; import java.io.IOException;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.controller.ControllerService; import org.apache.nifi.controller.ControllerService;
/** /**
* This interface defines an API that can be used for interacting with a * This interface defines an API that can be used for interacting with a
* Distributed Cache that functions similarly to a {@link java.util.Set Set}. * Distributed Cache that functions similarly to a {@link java.util.Set Set}.
*/ */
@Tags({"distributed", "client", "cluster", "set", "cache"})
@CapabilityDescription("Provides the ability to communicate with a DistributedSetCacheServer. This allows "
+ "multiple nodes to coordinate state with a single remote entity.")
public interface DistributedSetCacheClient extends ControllerService { public interface DistributedSetCacheClient extends ControllerService {
/** /**

View File

@ -20,10 +20,14 @@ import java.io.File;
import javax.net.ssl.SSLContext; import javax.net.ssl.SSLContext;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.controller.ConfigurationContext; import org.apache.nifi.controller.ConfigurationContext;
import org.apache.nifi.ssl.SSLContextService; import org.apache.nifi.ssl.SSLContextService;
import org.apache.nifi.ssl.SSLContextService.ClientAuth; import org.apache.nifi.ssl.SSLContextService.ClientAuth;
@Tags({"distributed", "set", "distinct", "cache", "server"})
@CapabilityDescription("Provides a set (collection of unique values) cache that can be accessed over a socket. "
+ "Interaction with this service is typically accomplished via a DistributedSetCacheClient service.")
public class DistributedSetCacheServer extends DistributedCacheServer { public class DistributedSetCacheServer extends DistributedCacheServer {
@Override @Override

View File

@ -20,6 +20,8 @@ import java.io.File;
import javax.net.ssl.SSLContext; import javax.net.ssl.SSLContext;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.controller.ConfigurationContext; import org.apache.nifi.controller.ConfigurationContext;
import org.apache.nifi.distributed.cache.server.CacheServer; import org.apache.nifi.distributed.cache.server.CacheServer;
import org.apache.nifi.distributed.cache.server.DistributedCacheServer; import org.apache.nifi.distributed.cache.server.DistributedCacheServer;
@ -27,6 +29,9 @@ import org.apache.nifi.distributed.cache.server.EvictionPolicy;
import org.apache.nifi.ssl.SSLContextService; import org.apache.nifi.ssl.SSLContextService;
import org.apache.nifi.ssl.SSLContextService.ClientAuth; import org.apache.nifi.ssl.SSLContextService.ClientAuth;
@Tags({"distributed", "cluster", "map", "cache", "server", "key/value"})
@CapabilityDescription("Provides a map (key/value) cache that can be accessed over a socket. Interaction with this service"
+ " is typically accomplished via a DistributedMapCacheClient service.")
public class DistributedMapCacheServer extends DistributedCacheServer { public class DistributedMapCacheServer extends DistributedCacheServer {
@Override @Override

View File

@ -26,6 +26,8 @@ import java.util.Map;
import javax.net.ssl.SSLContext; import javax.net.ssl.SSLContext;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.annotation.lifecycle.OnEnabled; import org.apache.nifi.annotation.lifecycle.OnEnabled;
import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.components.PropertyDescriptor;
import org.apache.nifi.components.ValidationContext; import org.apache.nifi.components.ValidationContext;
@ -40,6 +42,9 @@ import org.apache.nifi.security.util.CertificateUtils;
import org.apache.nifi.security.util.KeystoreType; import org.apache.nifi.security.util.KeystoreType;
import org.apache.nifi.security.util.SslContextFactory; import org.apache.nifi.security.util.SslContextFactory;
@Tags({"ssl", "secure", "certificate", "keystore", "truststore", "jks", "p12", "pkcs12", "pkcs"})
@CapabilityDescription("Standard implementation of the SSLContextService. Provides the ability to configure "
+ "keystore and/or truststore properties once and reuse that configuration throughout the application")
public class StandardSSLContextService extends AbstractControllerService implements SSLContextService { public class StandardSSLContextService extends AbstractControllerService implements SSLContextService {
public static final String STORE_TYPE_JKS = "JKS"; public static final String STORE_TYPE_JKS = "JKS";

View File

@ -18,6 +18,8 @@ package org.apache.nifi.ssl;
import javax.net.ssl.SSLContext; import javax.net.ssl.SSLContext;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.controller.ControllerService; import org.apache.nifi.controller.ControllerService;
import org.apache.nifi.processor.exception.ProcessException; import org.apache.nifi.processor.exception.ProcessException;
@ -25,6 +27,9 @@ import org.apache.nifi.processor.exception.ProcessException;
* Definition for SSLContextService. * Definition for SSLContextService.
* *
*/ */
@Tags({"ssl", "secure", "certificate", "keystore", "truststore", "jks", "p12", "pkcs12", "pkcs"})
@CapabilityDescription("Provides the ability to configure keystore and/or truststore properties once and reuse "
+ "that configuration throughout the application")
public interface SSLContextService extends ControllerService { public interface SSLContextService extends ControllerService {
public static enum ClientAuth { public static enum ClientAuth {