nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu-iskw <>
Subject [GitHub] nifi pull request: [NIFI-774] Create a DeleteS3Object Processor
Date Wed, 05 Aug 2015 04:47:00 GMT
Github user yu-iskw commented on a diff in the pull request:
    --- Diff: nifi/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/
    @@ -0,0 +1,125 @@
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +import java.util.*;
    +import java.util.concurrent.TimeUnit;
    +import com.amazonaws.AmazonClientException;
    +import org.apache.nifi.annotation.behavior.*;
    +import org.apache.nifi.annotation.documentation.CapabilityDescription;
    +import org.apache.nifi.annotation.documentation.SeeAlso;
    +import org.apache.nifi.annotation.documentation.Tags;
    +import org.apache.nifi.components.PropertyDescriptor;
    +import org.apache.nifi.flowfile.FlowFile;
    +import org.apache.nifi.processor.ProcessContext;
    +import org.apache.nifi.processor.ProcessSession;
    +import org.apache.nifi.processor.util.StandardValidators;
    +@Tags({"Amazon", "S3", "AWS", "Archive", "Delete"})
    +@CapabilityDescription("Deletes FlowFiles on an Amazon S3 Bucket")
    +@DynamicProperty(name = "The name of a User-Defined Metadata field to add to the S3 Object",
    +        value = "The value of a User-Defined Metadata field to add to the S3 Object",
    +        description = "Allows user-defined metadata to be added to the S3 object as key/value
    +        supportsExpressionLanguage = true)
    +@ReadsAttribute(attribute = "filename", description = "Uses the FlowFile's filename as
the filename for the S3 object")
    +        @WritesAttribute(attribute = "s3.bucket", description = "The name of the S3 bucket"),
    +        @WritesAttribute(attribute = "s3.version", description = "The version of the
S3 Object"),
    +        @WritesAttribute(attribute = "path", description = "The path of the file"),
    +public class DeleteS3Object extends AbstractS3Processor {
    +    public static final PropertyDescriptor VERSION_ID = new PropertyDescriptor.Builder()
    +            .name("Version")
    +            .description("The Version of the Object to delete")
    +            .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
    +            .expressionLanguageSupported(true)
    +            .required(false)
    +            .build();
    +    public static final List<PropertyDescriptor> properties = Collections.unmodifiableList(
    +    @Override
    +    protected List<PropertyDescriptor> getSupportedPropertyDescriptors() {
    +        return properties;
    +    }
    +    @Override
    +    protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(final String propertyDescriptorName)
    --- End diff --
    When I removed the method, I got a `IllegalStateException`.
    java.lang.AssertionError: java.lang.IllegalStateException: Attempting to Evaluate Expressions
but PropertyDescriptor[Version] indicates that the Expression Language is not supported. If
you realize that this is the case and do not want this error to occur, it can be disabled
by calling TestRunner.setValidateExpressionUsage(false)

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message