@SideEffectFree @SupportsBatching @Tags(value={"avro","convert","json"}) @InputRequirement(value=INPUT_REQUIRED) @CapabilityDescription(value="Converts a Binary Avro record into a JSON object. This processor provides a direct mapping of an Avro field to a JSON field, such that the resulting JSON will have the same hierarchical structure as the Avro document. Note that the Avro schema information will be lost, as this is not a translation from binary Avro to JSON formatted Avro. The output JSON is encoded the UTF-8 encoding. If an incoming FlowFile contains a stream of multiple Avro records, the resultant FlowFile will contain a JSON Array containing all of the Avro records or a sequence of JSON Objects. If an incoming FlowFile does not contain any records, an empty JSON object is the output. Empty/Single Avro record FlowFile inputs are optionally wrapped in a container as dictated by \'Wrap Single Record\'") @WritesAttribute(attribute="mime.type", description="Sets the mime type to application/json") public class ConvertAvroToJSON extends AbstractProcessor
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
CONTAINER_ARRAY |
protected static java.lang.String |
CONTAINER_NONE |
Constructor and Description |
---|
ConvertAvroToJSON() |
Modifier and Type | Method and Description |
---|---|
java.util.Set<Relationship> |
getRelationships() |
protected java.util.List<PropertyDescriptor> |
getSupportedPropertyDescriptors()
Allows subclasses to register which property descriptor objects are
supported.
|
protected void |
init(ProcessorInitializationContext context)
Provides subclasses the ability to perform initialization logic
|
void |
onTrigger(ProcessContext context,
ProcessSession session) |
onTrigger
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
protected static final java.lang.String CONTAINER_ARRAY
protected static final java.lang.String CONTAINER_NONE
protected void init(ProcessorInitializationContext context)
AbstractSessionFactoryProcessor
init
in class AbstractSessionFactoryProcessor
context
- in which to perform initializationprotected java.util.List<PropertyDescriptor> getSupportedPropertyDescriptors()
AbstractConfigurableComponent
getSupportedPropertyDescriptors
in class AbstractConfigurableComponent
public java.util.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