Class JoltTransformRecord

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

@SideEffectFree @SupportsBatching @Tags({"record","jolt","transform","shiftr","chainr","defaultr","removr","cardinality","sort"}) @InputRequirement(INPUT_REQUIRED) @WritesAttribute(attribute="record.count",description="The number of records in an outgoing FlowFile") @WritesAttribute(attribute="mime.type",description="The MIME Type that the configured Record Writer indicates is appropriate") @CapabilityDescription("Applies a JOLT specification to each record in the FlowFile payload. A new FlowFile is created with transformed content and is routed to the \'success\' relationship. If the transform fails, the original FlowFile is routed to the \'failure\' relationship.") @RequiresInstanceClassLoading public class JoltTransformRecord extends AbstractJoltTransform
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final List<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.processor.Relationship
     
    (package private) static final org.apache.nifi.processor.Relationship
     
    (package private) static final org.apache.nifi.processor.Relationship
     
    private static final Set<org.apache.nifi.processor.Relationship>
     

    Fields inherited from class org.apache.nifi.processors.jolt.AbstractJoltTransform

    CUSTOM_CLASS, JOLT_SPEC, JOLT_TRANSFORM, MODULES, TRANSFORM_CACHE_SIZE
  • 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>
     
    protected static Object
    Recursively replace List objects with Object[].
    protected static Object
     
    void
    onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session)
     
    protected static Object
    transform(com.bazaarvoice.jolt.JoltTransform joltTransform, Object input)
     
    private List<Record>
    transform(Record record, com.bazaarvoice.jolt.JoltTransform transform)
     

    Methods inherited from class org.apache.nifi.processors.jolt.AbstractJoltTransform

    createTransform, customValidate, getJarFilenameFilter, getTransform, readTransform, setup

    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

    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

    • RECORD_READER

      static final org.apache.nifi.components.PropertyDescriptor RECORD_READER
    • RECORD_WRITER

      static final org.apache.nifi.components.PropertyDescriptor RECORD_WRITER
    • REL_SUCCESS

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

      static final org.apache.nifi.processor.Relationship REL_FAILURE
    • REL_ORIGINAL

      static final org.apache.nifi.processor.Relationship REL_ORIGINAL
    • PROPERTIES

      private static final List<org.apache.nifi.components.PropertyDescriptor> PROPERTIES
    • RELATIONSHIPS

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

    • JoltTransformRecord

      public JoltTransformRecord()
  • 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
    • transform

      private List<Record> transform(Record record, com.bazaarvoice.jolt.JoltTransform transform)
    • transform

      protected static Object transform(com.bazaarvoice.jolt.JoltTransform joltTransform, Object input)
    • normalizeJoltObjects

      protected static Object normalizeJoltObjects(Object o)
      Recursively replace List objects with Object[]. JOLT expects arrays to be of type List where our Record code uses Object[].
      Parameters:
      o - The object to normalize with respect to JOLT
    • normalizeRecordObjects

      protected static Object normalizeRecordObjects(Object o)