@Tags(value={"record","stats","metrics"}) @CapabilityDescription(value="A processor that can count the number of items in a record set, as well as provide counts based on user-defined criteria on subsets of the record set.") @InputRequirement(value=INPUT_REQUIRED) @DynamicProperty(name="Record Path property", value="The Record Path value", expressionLanguageScope=FLOWFILE_ATTRIBUTES, description="A Record Path value, pointing to a field to be counted") @WritesAttribute(attribute="record.count",description="A count of the records in the record set in the FlowFile.") @WritesAttribute(attribute="recordStats.<User Defined Property Name>.count",description="A count of the records that contain a value for the user defined property.") @WritesAttribute(attribute="recordStats.<User Defined Property Name>.<value>.count",description="Each value discovered for the user defined property will have its own count attribute. Total number of top N value counts to be added is defined by the limit configuration.") public class CalculateRecordStats extends AbstractProcessor
| Modifier and Type | Field and Description |
|---|---|
private RecordPathCache |
cache |
(package private) static PropertyDescriptor |
LIMIT |
(package private) static List<PropertyDescriptor> |
PROPERTIES |
(package private) static String |
RECORD_COUNT_ATTR |
(package private) static PropertyDescriptor |
RECORD_READER |
(package private) static Relationship |
REL_FAILURE |
(package private) static Relationship |
REL_SUCCESS |
(package private) static Set |
RELATIONSHIPS |
| Constructor and Description |
|---|
CalculateRecordStats() |
| Modifier and Type | Method and Description |
|---|---|
protected Map |
filterBySize(Map<String,Integer> values,
Integer limit,
List<String> baseKeys) |
protected Map<String,RecordPath> |
getRecordPaths(ProcessContext context,
FlowFile flowFile) |
Set<Relationship> |
getRelationships() |
protected Map<String,String> |
getStats(FlowFile flowFile,
Map<String,RecordPath> paths,
ProcessContext context,
ProcessSession session) |
protected PropertyDescriptor |
getSupportedDynamicPropertyDescriptor(String propertyDescriptorName) |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
void |
onEnabled(ProcessContext context) |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
onTriggergetControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTruecustomValidate, equals, getPropertyDescriptor, getPropertyDescriptors, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitisStatefulgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatestatic final String RECORD_COUNT_ATTR
static final PropertyDescriptor RECORD_READER
static final PropertyDescriptor LIMIT
static final Relationship REL_SUCCESS
static final Relationship REL_FAILURE
private RecordPathCache cache
static final Set RELATIONSHIPS
static final List<PropertyDescriptor> PROPERTIES
protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(String propertyDescriptorName)
getSupportedDynamicPropertyDescriptor in class AbstractConfigurableComponentprotected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponent@OnScheduled public void onEnabled(ProcessContext context)
public Set<Relationship> getRelationships()
getRelationships in interface ProcessorgetRelationships in class AbstractSessionFactoryProcessorpublic void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger in class AbstractProcessorProcessExceptionprotected Map<String,RecordPath> getRecordPaths(ProcessContext context, FlowFile flowFile)
protected Map<String,String> getStats(FlowFile flowFile, Map<String,RecordPath> paths, ProcessContext context, ProcessSession session)
Copyright © 2023 Apache NiFi Project. All rights reserved.