Class CompressContent
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.standard.CompressContent
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor
@SideEffectFree
@SupportsBatching
@InputRequirement(INPUT_REQUIRED)
@Tags({"content","compress","decompress","gzip","bzip2","lzma","xz-lzma2","snappy","snappy-hadoop","snappy framed","lz4-framed","deflate","zstd","brotli"})
@CapabilityDescription("Compresses or decompresses the contents of FlowFiles using a user-specified compression algorithm and updates the mime.type attribute as appropriate. A common idiom is to precede CompressContent with IdentifyMimeType and configure Mode=\'decompress\' AND Compression Format=\'use mime.type attribute\'. When used in this manner, the MIME type is automatically detected and the data is decompressed, if necessary. If decompression is unnecessary, the data is passed through to the \'success\' relationship. 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)
@UseCase(description="Compress the contents of a FlowFile",configuration="\"Mode\" = \"compress\"\n\"Compression Format\" should be set to whichever compression algorithm should be used.") @UseCase(description="Decompress the contents of a FlowFile",configuration="\"Mode\" = \"decompress\"\n\"Compression Format\" should be set to whichever compression algorithm was used to compress the data previously.")
@MultiProcessorUseCase(description="Check whether or not a FlowFile is compressed and if so, decompress it.",notes="If IdentifyMimeType determines that the content is not compressed, CompressContent will pass the FlowFile along to the \'success\' relationship without attempting to decompress it.",keywords={"auto","detect","mime type","compress","decompress","gzip","bzip2"},configurations={@ProcessorConfiguration(processorClass=IdentifyMimeType.class,configuration="Default property values are sufficient.\nConnect the \'success\' relationship to CompressContent.\n"),@ProcessorConfiguration(processorClass=CompressContent.class,configuration="\"Mode\" = \"decompress\"\n\"Compression Format\" = \"use mime.type attribute\"\n")})
@DeprecationNotice(classNames="org.apache.nifi.processors.compress.ModifyCompression")
public class CompressContent
extends org.apache.nifi.processor.AbstractProcessor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.nifi.components.PropertyDescriptorstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final Stringstatic final Stringprivate static final List<org.apache.nifi.components.PropertyDescriptor> static final org.apache.nifi.processor.Relationshipstatic final org.apache.nifi.processor.Relationshipprivate static final Set<org.apache.nifi.processor.Relationship> static final org.apache.nifi.components.PropertyDescriptor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcloseQuietly(Closeable closeable) protected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext context) Set<org.apache.nifi.processor.Relationship> protected List<org.apache.nifi.components.PropertyDescriptor> voidonTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) Methods inherited from class org.apache.nifi.processor.AbstractProcessor
onTriggerMethods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.components.ConfigurableComponent
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateMethods inherited from interface org.apache.nifi.processor.Processor
isStateful, migrateProperties, migrateRelationships
-
Field Details
-
COMPRESSION_FORMAT_ATTRIBUTE
- See Also:
-
COMPRESSION_FORMAT_GZIP
- See Also:
-
COMPRESSION_FORMAT_DEFLATE
- See Also:
-
COMPRESSION_FORMAT_BZIP2
- See Also:
-
COMPRESSION_FORMAT_XZ_LZMA2
- See Also:
-
COMPRESSION_FORMAT_LZMA
- See Also:
-
COMPRESSION_FORMAT_SNAPPY
- See Also:
-
COMPRESSION_FORMAT_SNAPPY_HADOOP
- See Also:
-
COMPRESSION_FORMAT_SNAPPY_FRAMED
- See Also:
-
COMPRESSION_FORMAT_LZ4_FRAMED
- See Also:
-
COMPRESSION_FORMAT_ZSTD
- See Also:
-
COMPRESSION_FORMAT_BROTLI
- See Also:
-
MODE_COMPRESS
- See Also:
-
MODE_DECOMPRESS
- See Also:
-
COMPRESSION_FORMAT
public static final org.apache.nifi.components.PropertyDescriptor COMPRESSION_FORMAT -
MODE
public static final org.apache.nifi.components.PropertyDescriptor MODE -
COMPRESSION_LEVEL
public static final org.apache.nifi.components.PropertyDescriptor COMPRESSION_LEVEL -
UPDATE_FILENAME
public static final org.apache.nifi.components.PropertyDescriptor UPDATE_FILENAME -
PROPERTY_DESCRIPTORS
-
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
-
compressionFormatMimeTypeMap
-
-
Constructor Details
-
CompressContent
public CompressContent()
-
-
Method Details
-
getRelationships
- Specified by:
getRelationshipsin interfaceorg.apache.nifi.processor.Processor- Overrides:
getRelationshipsin classorg.apache.nifi.processor.AbstractSessionFactoryProcessor
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptorsin classorg.apache.nifi.components.AbstractConfigurableComponent
-
customValidate
protected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext context) - Overrides:
customValidatein classorg.apache.nifi.components.AbstractConfigurableComponent
-
onTrigger
public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) - Specified by:
onTriggerin classorg.apache.nifi.processor.AbstractProcessor
-
closeQuietly
-