DeleteHDFS

Description:

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.

Tags:

hadoop, HDFS, delete, remove, filesystem, restricted

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

NameDefault ValueAllowable ValuesDescription
Hadoop Configuration ResourcesA file or comma separated list of files which contains the Hadoop file system configuration. Without this, Hadoop will search the classpath for a 'core-site.xml' and 'hdfs-site.xml' file or will revert to a default configuration.
Kerberos PrincipalKerberos principal to authenticate as. Requires nifi.kerberos.krb5.file to be set in your nifi.properties
Kerberos KeytabKerberos keytab associated with the principal. Requires nifi.kerberos.krb5.file to be set in your nifi.properties
Kerberos Relogin Period4 hoursPeriod of time which should pass before attempting a kerberos relogin
Additional Classpath ResourcesA comma-separated list of paths to files and/or directories that will be added to the classpath. When specifying a directory, all files with in the directory will be added to the classpath, but further sub-directories will not be included.
PathThe HDFS file or directory to delete. A wildcard expression may be used to only delete certain files
Supports Expression Language: true
Recursivetrue
  • true
  • false
Remove contents of a non-empty directory recursively

Relationships:

NameDescription
successWhen an incoming flowfile is used then if there are no errors invoking delete the flowfile will route here.
failureWhen an incoming flowfile is used and there is a failure while deleting then the flowfile will route here.

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
hdfs.filenameHDFS file to be deleted
hdfs.pathHDFS Path specified in the delete request
hdfs.error.messageHDFS error message related to the hdfs.error.code

State management:

This component does not store state.

Restricted:

Provides operator the ability to delete any file that NiFi has access to in HDFS or the local filesystem.

Input requirement:

This component allows an incoming relationship.

See Also:

ListHDFS