mirror of https://github.com/apache/nifi.git
NIFI-1108 Providing additional annotations on processors to ensure utilization of the InputRequirement annotation.
This commit is contained in:
parent
911e1c5412
commit
773576e041
|
@ -26,6 +26,8 @@ import com.amazonaws.services.s3.AmazonS3;
|
|||
import com.amazonaws.services.s3.model.DeleteObjectRequest;
|
||||
import com.amazonaws.services.s3.model.DeleteVersionRequest;
|
||||
|
||||
import org.apache.nifi.annotation.behavior.InputRequirement;
|
||||
import org.apache.nifi.annotation.behavior.InputRequirement.Requirement;
|
||||
import org.apache.nifi.annotation.behavior.SupportsBatching;
|
||||
import org.apache.nifi.annotation.documentation.CapabilityDescription;
|
||||
import org.apache.nifi.annotation.documentation.SeeAlso;
|
||||
|
@ -40,6 +42,7 @@ import org.apache.nifi.processor.util.StandardValidators;
|
|||
@SupportsBatching
|
||||
@SeeAlso({PutS3Object.class})
|
||||
@Tags({"Amazon", "S3", "AWS", "Archive", "Delete"})
|
||||
@InputRequirement(Requirement.INPUT_REQUIRED)
|
||||
@CapabilityDescription("Deletes FlowFiles on an Amazon S3 Bucket. " +
|
||||
"If attempting to delete a file that does not exist, FlowFile is routed to success.")
|
||||
public class DeleteS3Object extends AbstractS3Processor {
|
||||
|
|
|
@ -30,6 +30,8 @@ import java.util.concurrent.ConcurrentMap;
|
|||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.nifi.annotation.behavior.InputRequirement;
|
||||
import org.apache.nifi.annotation.behavior.InputRequirement.Requirement;
|
||||
import org.apache.nifi.annotation.behavior.WritesAttribute;
|
||||
import org.apache.nifi.annotation.behavior.WritesAttributes;
|
||||
import org.apache.nifi.annotation.documentation.CapabilityDescription;
|
||||
|
@ -56,6 +58,7 @@ import com.microsoft.eventhubs.client.ResilientEventHubReceiver;
|
|||
|
||||
@Tags({ "azure", "microsoft", "cloud", "eventhub", "events", "streaming", "streams" })
|
||||
@CapabilityDescription("Receives messages from a Microsoft Azure Event Hub, writing the contents of the Azure message to the content of the FlowFile")
|
||||
@InputRequirement(Requirement.INPUT_FORBIDDEN)
|
||||
@WritesAttributes({
|
||||
@WritesAttribute(attribute = "eventhub.enqueued.timestamp", description = "The time (in milliseconds since epoch, UTC) at which the message was enqueued in the Azure Event Hub"),
|
||||
@WritesAttribute(attribute = "eventhub.offset", description = "The offset into the partition at which the message was stored"),
|
||||
|
|
|
@ -28,6 +28,8 @@ import java.util.concurrent.TimeUnit;
|
|||
|
||||
import javax.jms.DeliveryMode;
|
||||
|
||||
import org.apache.nifi.annotation.behavior.InputRequirement;
|
||||
import org.apache.nifi.annotation.behavior.InputRequirement.Requirement;
|
||||
import org.apache.nifi.annotation.behavior.SupportsBatching;
|
||||
import org.apache.nifi.annotation.documentation.CapabilityDescription;
|
||||
import org.apache.nifi.annotation.documentation.Tags;
|
||||
|
@ -53,6 +55,7 @@ import com.microsoft.eventhubs.client.EventHubSender;
|
|||
|
||||
@SupportsBatching
|
||||
@Tags({ "microsoft", "azure", "cloud", "eventhub", "events", "streams", "streaming" })
|
||||
@InputRequirement(Requirement.INPUT_REQUIRED)
|
||||
@CapabilityDescription("Sends the contents of a FlowFile to a Windows Azure Event Hub. Note: the content of the FlowFile will be buffered into memory before being sent, "
|
||||
+ "so care should be taken to avoid sending FlowFiles to this Processor that exceed the amount of Java Heap Space available.")
|
||||
public class PutAzureEventHub extends AbstractProcessor {
|
||||
|
|
|
@ -25,6 +25,8 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.nifi.annotation.behavior.InputRequirement;
|
||||
import org.apache.nifi.annotation.behavior.InputRequirement.Requirement;
|
||||
import org.apache.nifi.annotation.behavior.ReadsAttribute;
|
||||
import org.apache.nifi.annotation.behavior.ReadsAttributes;
|
||||
import org.apache.nifi.annotation.behavior.WritesAttribute;
|
||||
|
@ -57,6 +59,7 @@ import com.couchbase.client.java.document.RawJsonDocument;
|
|||
@Tags({"nosql", "couchbase", "database", "put"})
|
||||
@CapabilityDescription("Put a document to Couchbase Server via Key/Value access.")
|
||||
@SeeAlso({CouchbaseClusterControllerService.class})
|
||||
@InputRequirement(Requirement.INPUT_REQUIRED)
|
||||
@ReadsAttributes({
|
||||
@ReadsAttribute(attribute = "uuid", description = "Used as a document id if 'Document Id' is not specified"),
|
||||
})
|
||||
|
|
|
@ -36,6 +36,8 @@ import org.apache.avro.generic.GenericData.Record;
|
|||
import org.apache.avro.generic.GenericDatumReader;
|
||||
import org.apache.hadoop.conf.Configuration;
|
||||
import org.apache.nifi.annotation.behavior.DynamicProperty;
|
||||
import org.apache.nifi.annotation.behavior.InputRequirement;
|
||||
import org.apache.nifi.annotation.behavior.InputRequirement.Requirement;
|
||||
import org.apache.nifi.annotation.documentation.CapabilityDescription;
|
||||
import org.apache.nifi.annotation.documentation.Tags;
|
||||
import org.apache.nifi.components.PropertyDescriptor;
|
||||
|
@ -62,6 +64,7 @@ import com.google.common.collect.Lists;
|
|||
|
||||
@Tags({ "avro", "convert", "kite" })
|
||||
@CapabilityDescription("Convert records from one Avro schema to another, including support for flattening and simple type conversions")
|
||||
@InputRequirement(Requirement.INPUT_REQUIRED)
|
||||
@DynamicProperty(name = "Field name from input schema",
|
||||
value = "Field name for output schema",
|
||||
description = "Explicit mappings from input schema to output schema, which supports renaming fields and stepping into nested records on the input schema using notation like parent.id")
|
||||
|
|
|
@ -27,6 +27,8 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.nifi.annotation.behavior.InputRequirement;
|
||||
import org.apache.nifi.annotation.behavior.InputRequirement.Requirement;
|
||||
import org.apache.nifi.annotation.documentation.CapabilityDescription;
|
||||
import org.apache.nifi.annotation.documentation.Tags;
|
||||
import org.apache.nifi.components.PropertyDescriptor;
|
||||
|
@ -48,6 +50,7 @@ import com.mongodb.client.MongoCollection;
|
|||
import com.mongodb.client.MongoCursor;
|
||||
|
||||
@Tags({ "mongodb", "read", "get" })
|
||||
@InputRequirement(Requirement.INPUT_FORBIDDEN)
|
||||
@CapabilityDescription("Creates FlowFiles from documents in MongoDB")
|
||||
public class GetMongo extends AbstractMongoProcessor {
|
||||
public static final Validator DOCUMENT_VALIDATOR = new Validator() {
|
||||
|
|
|
@ -26,6 +26,8 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
|
||||
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.documentation.CapabilityDescription;
|
||||
import org.apache.nifi.annotation.documentation.Tags;
|
||||
import org.apache.nifi.components.PropertyDescriptor;
|
||||
|
@ -46,6 +48,7 @@ import com.mongodb.client.model.UpdateOptions;
|
|||
|
||||
@EventDriven
|
||||
@Tags({ "mongodb", "insert", "update", "write", "put" })
|
||||
@InputRequirement(Requirement.INPUT_REQUIRED)
|
||||
@CapabilityDescription("Writes the contents of a FlowFile to MongoDB")
|
||||
public class PutMongo extends AbstractMongoProcessor {
|
||||
static final Relationship REL_SUCCESS = new Relationship.Builder().name("success")
|
||||
|
|
|
@ -29,6 +29,8 @@ import java.util.Set;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.nifi.annotation.behavior.InputRequirement;
|
||||
import org.apache.nifi.annotation.behavior.InputRequirement.Requirement;
|
||||
import org.apache.nifi.components.PropertyDescriptor;
|
||||
import org.apache.nifi.flowfile.FlowFile;
|
||||
import org.apache.nifi.stream.io.StreamUtils;
|
||||
|
@ -54,6 +56,7 @@ import org.apache.nifi.annotation.documentation.SeeAlso;
|
|||
@SideEffectFree
|
||||
@SupportsBatching
|
||||
@Tags({"deprecated"})
|
||||
@InputRequirement(Requirement.INPUT_REQUIRED)
|
||||
@CapabilityDescription("WARNING: This has been deprecated and will be removed in 0.2.0. \n\n Use ExtractText instead.")
|
||||
@SeeAlso(ExtractText.class)
|
||||
@Deprecated
|
||||
|
|
Loading…
Reference in New Issue