@EventDriven @SideEffectFree @SupportsBatching @InputRequirement(value=INPUT_REQUIRED) @Tags(value={"content","compress","decompress","gzip","bzip2","lzma","xz-lzma2","snappy","snappy-hadoop","snappy framed","lz4-framed","deflate"}) @CapabilityDescription(value="Compresses or decompresses the contents of FlowFiles using a user-specified compression algorithm and updates the mime.type attribute as appropriate. This processor operates in a very memory efficient way so very large objects well beyond the heap size are generally fine to process") @ReadsAttribute(attribute="mime.type", description="If the Compression Format is set to use mime.type attribute, this attribute is used to determine the compression type. Otherwise, this attribute is ignored.") @WritesAttribute(attribute="mime.type", description="If the Mode property is set to compress, the appropriate MIME Type is set. If the Mode property is set to decompress and the file is successfully decompressed, this attribute is removed, as the MIME Type is no longer known.") @SystemResourceConsideration(resource=CPU) @SystemResourceConsideration(resource=MEMORY) public class CompressContent extends AbstractProcessor
Modifier and Type | Field and Description |
---|---|
static PropertyDescriptor |
COMPRESSION_FORMAT |
static String |
COMPRESSION_FORMAT_ATTRIBUTE |
static String |
COMPRESSION_FORMAT_BZIP2 |
static String |
COMPRESSION_FORMAT_DEFLATE |
static String |
COMPRESSION_FORMAT_GZIP |
static String |
COMPRESSION_FORMAT_LZ4_FRAMED |
static String |
COMPRESSION_FORMAT_LZMA |
static String |
COMPRESSION_FORMAT_SNAPPY |
static String |
COMPRESSION_FORMAT_SNAPPY_FRAMED |
static String |
COMPRESSION_FORMAT_SNAPPY_HADOOP |
static String |
COMPRESSION_FORMAT_XZ_LZMA2 |
static PropertyDescriptor |
COMPRESSION_LEVEL |
private Map<String,String> |
compressionFormatMimeTypeMap |
static PropertyDescriptor |
MODE |
static String |
MODE_COMPRESS |
static String |
MODE_DECOMPRESS |
private List<PropertyDescriptor> |
properties |
static Relationship |
REL_FAILURE |
static Relationship |
REL_SUCCESS |
private Set<Relationship> |
relationships |
static PropertyDescriptor |
UPDATE_FILENAME |
Constructor and Description |
---|
CompressContent() |
Modifier and Type | Method and Description |
---|---|
private void |
closeQuietly(Closeable closeable) |
protected Collection<ValidationResult> |
customValidate(ValidationContext context) |
Set<Relationship> |
getRelationships() |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
protected void |
init(ProcessorInitializationContext context) |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
onTrigger
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
public static final String COMPRESSION_FORMAT_ATTRIBUTE
public static final String COMPRESSION_FORMAT_GZIP
public static final String COMPRESSION_FORMAT_DEFLATE
public static final String COMPRESSION_FORMAT_BZIP2
public static final String COMPRESSION_FORMAT_XZ_LZMA2
public static final String COMPRESSION_FORMAT_LZMA
public static final String COMPRESSION_FORMAT_SNAPPY
public static final String COMPRESSION_FORMAT_SNAPPY_HADOOP
public static final String COMPRESSION_FORMAT_SNAPPY_FRAMED
public static final String COMPRESSION_FORMAT_LZ4_FRAMED
public static final String MODE_COMPRESS
public static final String MODE_DECOMPRESS
public static final PropertyDescriptor COMPRESSION_FORMAT
public static final PropertyDescriptor COMPRESSION_LEVEL
public static final PropertyDescriptor MODE
public static final PropertyDescriptor UPDATE_FILENAME
public static final Relationship REL_SUCCESS
public static final Relationship REL_FAILURE
private List<PropertyDescriptor> properties
private Set<Relationship> relationships
protected void init(ProcessorInitializationContext context)
init
in class AbstractSessionFactoryProcessor
public Set<Relationship> getRelationships()
getRelationships
in interface Processor
getRelationships
in class AbstractSessionFactoryProcessor
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors
in class AbstractConfigurableComponent
protected Collection<ValidationResult> customValidate(ValidationContext context)
customValidate
in class AbstractConfigurableComponent
public void onTrigger(ProcessContext context, ProcessSession session)
onTrigger
in class AbstractProcessor
private void closeQuietly(Closeable closeable)
Copyright © 2020 Apache NiFi Project. All rights reserved.