Class DeleteHDFS

java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.hadoop.AbstractHadoopProcessor
org.apache.nifi.processors.hadoop.DeleteHDFS
All Implemented Interfaces:
org.apache.nifi.components.ClassloaderIsolationKeyProvider, org.apache.nifi.components.ConfigurableComponent, org.apache.nifi.processor.Processor

@InputRequirement(INPUT_ALLOWED) @Tags({"hadoop","HCFS","HDFS","delete","remove","filesystem"}) @CapabilityDescription("Deletes one or more files or directories from HDFS. The path can be provided as an attribute from an incoming FlowFile, or a statically set path that is periodically removed. If this processor has an incoming connection, itwill ignore running on a periodic basis and instead rely on incoming FlowFiles to trigger a delete. Note that you may use a wildcard character to match multiple files or directories. If there are no incoming connections no flowfiles will be transfered to any output relationships. If there is an incoming flowfile then provided there are no detected failures it will be transferred to success otherwise it will be sent to false. If knowledge of globbed files deleted is necessary use ListHDFS first to produce a specific list of files to delete. ") @Restricted(restrictions=@Restriction(requiredPermission=WRITE_DISTRIBUTED_FILESYSTEM,explanation="Provides operator the ability to delete any file that NiFi has access to in HDFS or the local filesystem.")) @WritesAttribute(attribute="hdfs.filename",description="HDFS file to be deleted. If multiple files are deleted, then only the last filename is set.") @WritesAttribute(attribute="hdfs.path",description="HDFS Path specified in the delete request. If multiple paths are deleted, then only the last path is set.") @WritesAttribute(attribute="hadoop.file.url",description="The hadoop url for the file to be deleted.") @WritesAttribute(attribute="hdfs.error.message",description="HDFS error message related to the hdfs.error.code") @SeeAlso({ListHDFS.class,PutHDFS.class}) public class DeleteHDFS extends AbstractHadoopProcessor
  • Field Details

    • REL_SUCCESS

      public static final org.apache.nifi.processor.Relationship REL_SUCCESS
    • REL_FAILURE

      public static final org.apache.nifi.processor.Relationship REL_FAILURE
    • FILE_OR_DIRECTORY

      public static final org.apache.nifi.components.PropertyDescriptor FILE_OR_DIRECTORY
    • RECURSIVE

      public static final org.apache.nifi.components.PropertyDescriptor RECURSIVE
    • GLOB_PATTERN

      protected final Pattern GLOB_PATTERN
    • GLOB_MATCHER

      protected final Matcher GLOB_MATCHER
    • RELATIONSHIPS

      private static final Set<org.apache.nifi.processor.Relationship> RELATIONSHIPS
    • PROPERTY_DESCRIPTORS

      private static final List<org.apache.nifi.components.PropertyDescriptor> PROPERTY_DESCRIPTORS
  • Constructor Details

    • DeleteHDFS

      public DeleteHDFS()
  • Method Details

    • getSupportedPropertyDescriptors

      protected List<org.apache.nifi.components.PropertyDescriptor> getSupportedPropertyDescriptors()
      Overrides:
      getSupportedPropertyDescriptors in class AbstractHadoopProcessor
    • getRelationships

      public Set<org.apache.nifi.processor.Relationship> getRelationships()
      Specified by:
      getRelationships in interface org.apache.nifi.processor.Processor
      Overrides:
      getRelationships in class org.apache.nifi.processor.AbstractSessionFactoryProcessor
    • onTrigger

      public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) throws org.apache.nifi.processor.exception.ProcessException
      Specified by:
      onTrigger in class org.apache.nifi.processor.AbstractProcessor
      Throws:
      org.apache.nifi.processor.exception.ProcessException
    • getSuccessRelationship

      protected org.apache.nifi.processor.Relationship getSuccessRelationship()
    • getFailureRelationship

      protected org.apache.nifi.processor.Relationship getFailureRelationship()
    • isRecursive

      protected boolean isRecursive(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session)
    • getPath

      protected String getPath(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session, org.apache.nifi.flowfile.FlowFile finalFlowFile)
    • getAttributePrefix

      protected String getAttributePrefix()