@EventDriven @SideEffectFree @SupportsBatching @Tags(value={"csv","attributes","flowfile"}) @InputRequirement(value=INPUT_REQUIRED) @CapabilityDescription(value="Generates a CSV representation of the input FlowFile Attributes. The resulting CSV can be written to either a newly generated attribute named \'CSVAttributes\' or written to the FlowFile as content. If the attribute value contains a comma, newline or double quote, then the attribute value will be escaped with double quotes. Any double quote characters in the attribute value are escaped with another double quote.") @WritesAttribute(attribute="CSVSchema",description="CSV representation of the Schema") @WritesAttribute(attribute="CSVData",description="CSV representation of Attributes") public class AttributesToCSV extends AbstractProcessor
| Modifier and Type | Field and Description |
|---|---|
static PropertyDescriptor |
ATTRIBUTES_LIST |
static PropertyDescriptor |
ATTRIBUTES_REGEX |
private Set<String> |
coreAttributes |
private static String |
DATA_ATTRIBUTE_NAME |
static PropertyDescriptor |
DESTINATION |
private boolean |
destinationContent |
static PropertyDescriptor |
INCLUDE_CORE_ATTRIBUTES |
static PropertyDescriptor |
INCLUDE_SCHEMA |
private Boolean |
includeCoreAttributes |
private Boolean |
includeSchema |
static PropertyDescriptor |
NULL_VALUE_FOR_EMPTY_STRING |
private boolean |
nullValForEmptyString |
private static String |
OUTPUT_MIME_TYPE |
(package private) static AllowableValue |
OUTPUT_NEW_ATTRIBUTE |
(package private) static AllowableValue |
OUTPUT_OVERWRITE_CONTENT |
private static String |
OUTPUT_SEPARATOR |
private Pattern |
pattern |
private List<PropertyDescriptor> |
properties |
static Relationship |
REL_FAILURE |
static Relationship |
REL_SUCCESS |
private Set<Relationship> |
relationships |
private static String |
SCHEMA_ATTRIBUTE_NAME |
private static String |
SPLIT_REGEX |
| Constructor and Description |
|---|
AttributesToCSV() |
| Modifier and Type | Method and Description |
|---|---|
private LinkedHashSet<String> |
attributeListStringToSet(String attributeList) |
private Map<String,String> |
buildAttributesMapForFlowFile(FlowFile ff,
Set<String> attributes,
Pattern attPattern) |
Set<Relationship> |
getRelationships() |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
protected void |
init(ProcessorInitializationContext context) |
void |
onScheduled(ProcessContext context) |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
onTriggergetControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTruecustomValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitisStatefulgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateprivate static final String DATA_ATTRIBUTE_NAME
private static final String SCHEMA_ATTRIBUTE_NAME
private static final String OUTPUT_SEPARATOR
private static final String OUTPUT_MIME_TYPE
private static final String SPLIT_REGEX
static final AllowableValue OUTPUT_OVERWRITE_CONTENT
static final AllowableValue OUTPUT_NEW_ATTRIBUTE
public static final PropertyDescriptor ATTRIBUTES_LIST
public static final PropertyDescriptor ATTRIBUTES_REGEX
public static final PropertyDescriptor DESTINATION
public static final PropertyDescriptor INCLUDE_CORE_ATTRIBUTES
public static final PropertyDescriptor NULL_VALUE_FOR_EMPTY_STRING
public static final PropertyDescriptor INCLUDE_SCHEMA
public static final Relationship REL_SUCCESS
public static final Relationship REL_FAILURE
private List<PropertyDescriptor> properties
private Set<Relationship> relationships
private volatile Boolean includeCoreAttributes
private volatile boolean destinationContent
private volatile boolean nullValForEmptyString
private volatile Pattern pattern
private volatile Boolean includeSchema
protected void init(ProcessorInitializationContext context)
init in class AbstractSessionFactoryProcessorprotected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponentpublic Set<Relationship> getRelationships()
getRelationships in interface ProcessorgetRelationships in class AbstractSessionFactoryProcessorprivate Map<String,String> buildAttributesMapForFlowFile(FlowFile ff, Set<String> attributes, Pattern attPattern)
private LinkedHashSet<String> attributeListStringToSet(String attributeList)
@OnScheduled public void onScheduled(ProcessContext context)
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger in class AbstractProcessorProcessExceptionCopyright © 2023 Apache NiFi Project. All rights reserved.