@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) @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) |
onTrigger
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, hashCode, onPropertyModified, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
static 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 AbstractConfigurableComponent
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors
in class AbstractConfigurableComponent
@OnScheduled public void onEnabled(ProcessContext context)
public Set<Relationship> getRelationships()
getRelationships
in interface Processor
getRelationships
in class AbstractSessionFactoryProcessor
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger
in class AbstractProcessor
ProcessException
protected Map<String,RecordPath> getRecordPaths(ProcessContext context, FlowFile flowFile)
protected Map<String,String> getStats(FlowFile flowFile, Map<String,RecordPath> paths, ProcessContext context, ProcessSession session)
Copyright © 2020 Apache NiFi Project. All rights reserved.