NIFI-7487 - Added batch support and displayName to ModifyBytes processor

Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>

This closes #4302.
This commit is contained in:
r65535 2020-05-28 11:35:30 +01:00 committed by Pierre Villard
parent 1dd0e92040
commit 4ced1775b5
No known key found for this signature in database
GPG Key ID: BEE1599F0726E9CD

View File

@ -30,6 +30,7 @@ import org.apache.nifi.annotation.behavior.EventDriven;
import org.apache.nifi.annotation.behavior.InputRequirement;
import org.apache.nifi.annotation.behavior.InputRequirement.Requirement;
import org.apache.nifi.annotation.behavior.SideEffectFree;
import org.apache.nifi.annotation.behavior.SupportsBatching;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.components.PropertyDescriptor;
@ -50,6 +51,7 @@ import org.apache.nifi.util.StopWatch;
@EventDriven
@SideEffectFree
@SupportsBatching
@Tags({"binary", "discard", "keep"})
@InputRequirement(Requirement.INPUT_REQUIRED)
@CapabilityDescription("Discard byte range at the start and end or all content of a binary file.")
@ -63,6 +65,7 @@ public class ModifyBytes extends AbstractProcessor {
private final Set<Relationship> relationships;
public static final PropertyDescriptor START_OFFSET = new PropertyDescriptor.Builder()
.name("Start Offset")
.displayName("Start Offset")
.description("Number of bytes removed at the beginning of the file.")
.required(true)
.addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
@ -71,6 +74,7 @@ public class ModifyBytes extends AbstractProcessor {
.build();
public static final PropertyDescriptor END_OFFSET = new PropertyDescriptor.Builder()
.name("End Offset")
.displayName("End Offset")
.description("Number of bytes removed at the end of the file.")
.required(true)
.addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
@ -79,6 +83,7 @@ public class ModifyBytes extends AbstractProcessor {
.build();
public static final PropertyDescriptor REMOVE_ALL = new PropertyDescriptor.Builder()
.name("Remove All Content")
.displayName("Remove All Content")
.description("Remove all content from the FlowFile superseding Start Offset and End Offset properties.")
.required(true)
.allowableValues("true", "false")