@EventDriven @SideEffectFree @SupportsBatching @Tags(value={"record","sample","reservoir","range","interval"}) @InputRequirement(value=INPUT_REQUIRED) @CapabilityDescription(value="Samples the records of a FlowFile based on a specified sampling strategy (such as Reservoir Sampling). The resulting FlowFile may be of a fixed number of records (in the case of reservoir-based algorithms) or some subset of the total number of records (in the case of probabilistic sampling), or a deterministic number of records (in the case of interval sampling).") @SystemResourceConsideration(resource=MEMORY) @WritesAttribute(attribute="mime.type",description="The MIME type indicated by the record writer") @WritesAttribute(attribute="record.count",description="The number of records in the resulting flow file") public class SampleRecord extends AbstractProcessor
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
SampleRecord.IntervalSamplingStrategy |
(package private) static class |
SampleRecord.ProbabilisticSamplingStrategy |
(package private) static class |
SampleRecord.RangeSamplingStrategy |
(package private) static class |
SampleRecord.ReservoirSamplingStrategy |
(package private) static interface |
SampleRecord.SamplingStrategy |
| Constructor and Description |
|---|
SampleRecord() |
| Modifier and Type | Method and Description |
|---|---|
Set<Relationship> |
getRelationships() |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
onTriggergetControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTruecustomValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitisStatefulgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatestatic final String INTERVAL_SAMPLING_KEY
static final String RANGE_SAMPLING_KEY
static final String PROBABILISTIC_SAMPLING_KEY
static final String RESERVOIR_SAMPLING_KEY
static final AllowableValue INTERVAL_SAMPLING
static final AllowableValue RANGE_SAMPLING
static final AllowableValue PROBABILISTIC_SAMPLING
static final AllowableValue RESERVOIR_SAMPLING
private static final Pattern RANGE_PATTERN
private static final Pattern INTERVAL_PATTERN
static final PropertyDescriptor RECORD_READER_FACTORY
static final PropertyDescriptor RECORD_WRITER_FACTORY
static final PropertyDescriptor SAMPLING_STRATEGY
static final PropertyDescriptor SAMPLING_INTERVAL
static final PropertyDescriptor SAMPLING_RANGE
static final PropertyDescriptor SAMPLING_PROBABILITY
static final PropertyDescriptor RESERVOIR_SIZE
static final PropertyDescriptor RANDOM_SEED
public static final Relationship REL_ORIGINAL
public static final Relationship REL_SUCCESS
public static final Relationship REL_FAILURE
private static final List<PropertyDescriptor> properties
private static final Set<Relationship> relationships
public Set<Relationship> getRelationships()
getRelationships in interface ProcessorgetRelationships in class AbstractSessionFactoryProcessorprotected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponentpublic void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger in class AbstractProcessorProcessExceptionCopyright © 2023 Apache NiFi Project. All rights reserved.