Class SampleRecord

java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.standard.SampleRecord
All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent, org.apache.nifi.processor.Processor

@SideEffectFree @SupportsBatching @Tags({"record","sample","reservoir","range","interval"}) @InputRequirement(INPUT_REQUIRED) @CapabilityDescription("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 org.apache.nifi.processor.AbstractProcessor
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    (package private) static class 
     
    (package private) static class 
     
    (package private) static class 
     
    (package private) static class 
     
    (package private) static interface 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final Pattern
     
    (package private) static final org.apache.nifi.components.AllowableValue
     
    (package private) static final String
     
    (package private) static final org.apache.nifi.components.AllowableValue
     
    (package private) static final String
     
    private static final List<org.apache.nifi.components.PropertyDescriptor>
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
    private static final Pattern
     
    (package private) static final org.apache.nifi.components.AllowableValue
     
    (package private) static final String
     
    private static final String
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
    static final org.apache.nifi.processor.Relationship
     
    static final org.apache.nifi.processor.Relationship
     
    static final org.apache.nifi.processor.Relationship
     
    private static final Set<org.apache.nifi.processor.Relationship>
     
    (package private) static final org.apache.nifi.components.AllowableValue
     
    (package private) static final String
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Set<org.apache.nifi.processor.Relationship>
     
    protected List<org.apache.nifi.components.PropertyDescriptor>
     
    void
    onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session)
     

    Methods inherited from class org.apache.nifi.processor.AbstractProcessor

    onTrigger

    Methods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor

    getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue

    Methods inherited from class org.apache.nifi.components.AbstractConfigurableComponent

    customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validate

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.nifi.components.ConfigurableComponent

    getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate

    Methods inherited from interface org.apache.nifi.processor.Processor

    isStateful, migrateProperties, migrateRelationships
  • Field Details

    • INTERVAL_SAMPLING_KEY

      static final String INTERVAL_SAMPLING_KEY
      See Also:
    • RANGE_SAMPLING_KEY

      static final String RANGE_SAMPLING_KEY
      See Also:
    • PROBABILISTIC_SAMPLING_KEY

      static final String PROBABILISTIC_SAMPLING_KEY
      See Also:
    • RESERVOIR_SAMPLING_KEY

      static final String RESERVOIR_SAMPLING_KEY
      See Also:
    • INTERVAL_SAMPLING

      static final org.apache.nifi.components.AllowableValue INTERVAL_SAMPLING
    • RANGE_SAMPLING

      static final org.apache.nifi.components.AllowableValue RANGE_SAMPLING
    • PROBABILISTIC_SAMPLING

      static final org.apache.nifi.components.AllowableValue PROBABILISTIC_SAMPLING
    • RESERVOIR_SAMPLING

      static final org.apache.nifi.components.AllowableValue RESERVOIR_SAMPLING
    • RANGE_SEPARATOR

      private static final String RANGE_SEPARATOR
      See Also:
    • RANGE_PATTERN

      private static final Pattern RANGE_PATTERN
    • INTERVAL_PATTERN

      private static final Pattern INTERVAL_PATTERN
    • RECORD_READER_FACTORY

      static final org.apache.nifi.components.PropertyDescriptor RECORD_READER_FACTORY
    • RECORD_WRITER_FACTORY

      static final org.apache.nifi.components.PropertyDescriptor RECORD_WRITER_FACTORY
    • SAMPLING_STRATEGY

      static final org.apache.nifi.components.PropertyDescriptor SAMPLING_STRATEGY
    • SAMPLING_INTERVAL

      static final org.apache.nifi.components.PropertyDescriptor SAMPLING_INTERVAL
    • SAMPLING_RANGE

      static final org.apache.nifi.components.PropertyDescriptor SAMPLING_RANGE
    • SAMPLING_PROBABILITY

      static final org.apache.nifi.components.PropertyDescriptor SAMPLING_PROBABILITY
    • RESERVOIR_SIZE

      static final org.apache.nifi.components.PropertyDescriptor RESERVOIR_SIZE
    • RANDOM_SEED

      static final org.apache.nifi.components.PropertyDescriptor RANDOM_SEED
    • PROPERTY_DESCRIPTORS

      private static final List<org.apache.nifi.components.PropertyDescriptor> PROPERTY_DESCRIPTORS
    • REL_ORIGINAL

      public static final org.apache.nifi.processor.Relationship REL_ORIGINAL
    • REL_SUCCESS

      public static final org.apache.nifi.processor.Relationship REL_SUCCESS
    • REL_FAILURE

      public static final org.apache.nifi.processor.Relationship REL_FAILURE
    • RELATIONSHIPS

      private static final Set<org.apache.nifi.processor.Relationship> RELATIONSHIPS
  • Constructor Details

    • SampleRecord

      public SampleRecord()
  • Method Details

    • getRelationships

      public Set<org.apache.nifi.processor.Relationship> getRelationships()
      Specified by:
      getRelationships in interface org.apache.nifi.processor.Processor
      Overrides:
      getRelationships in class org.apache.nifi.processor.AbstractSessionFactoryProcessor
    • getSupportedPropertyDescriptors

      protected List<org.apache.nifi.components.PropertyDescriptor> getSupportedPropertyDescriptors()
      Overrides:
      getSupportedPropertyDescriptors in class org.apache.nifi.components.AbstractConfigurableComponent
    • onTrigger

      public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) throws org.apache.nifi.processor.exception.ProcessException
      Specified by:
      onTrigger in class org.apache.nifi.processor.AbstractProcessor
      Throws:
      org.apache.nifi.processor.exception.ProcessException