Description and usage of GetHDFSFileInfo processor:

Retrieves a listing of files and directories from HDFS. This processor creates a FlowFile(s) that represents the HDFS file/dir with relevant information. Main purpose of this processor to provide functionality similar to HDFS Client, i.e. count, du, ls, test, etc. Unlike ListHDFS, this processor is stateless, supports incoming connections and provides information on a dir level.

Tags:

hadoop, HDFS, get, list, ingest, source, filesystem

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 Expression Language Guide.

Name

Default Value

Allowable Values

Description

Hadoop Configuration Resources A 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. To use swebhdfs, see 'Additional Details' section of PutHDFS's documentation.

Supports Expression Language: true (will be evaluated using variable registry only)


Kerberos Credentials Service

Controller Service API: 


KerberosCredentialsService

Implementation: 

KeytabCredentialsService


Specifies the Kerberos Credentials Controller Service that should be used for authenticating with Kerberos
Kerberos Principal Kerberos principal to authenticate as. Requires nifi.kerberos.krb5.file to be set in your nifi.properties

Supports Expression Language: true (will be evaluated using variable registry only)


Kerberos Keytab Kerberos keytab associated with the principal. Requires nifi.kerberos.krb5.file to be set in your nifi.properties

Supports Expression Language: true (will be evaluated using variable registry only)


Kerberos Relogin Period 4 hours Period of time which should pass before attempting a kerberos relogin. This property has been deprecated, and has no effect on processing. Relogins now occur automatically.

Supports Expression Language: true (will be evaluated using variable registry only)


Additional Classpath Resources A 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.

Full path

A directory to start listing from, or a file's full path.

Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)


Recurse Subdirectories

true * true
* false
Indicates whether to list files from subdirectories of the HDFS directory
Directory Filter Regex. Only directories whose names match the given regular expression will be picked up. If not provided, any filter would be apply (performance considerations).

Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)


File Filter Regex. Only files whose names match the given regular expression will be picked up. If not provided, any filter would be apply (performance considerations).

Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)


Exclude Files Regex. Files whose names match the given regular expression will not be picked up. If not provided, any filter won't be apply (performance considerations).

Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)


Ignore Dotted Directories

true * true
* false
If true, directories whose names begin with a dot (".") will be ignored

Ignore Dotted Files

true * true
* false
If true, files whose names begin with a dot (".") will be ignored

Group Results

gethdfsfileinfo-group-all * All
* Parent Directory 
* None 
Groups HDFS objects

Destination

gethdfsfileinfo-dest-content * Attributes 
* Content 
Sets the destination for the results. When set to 'Content', attributes of flowfile won't be used for storing results.

Relationships:

Name

Description

success All successfully generated FlowFiles are transferred to this relationship
not found If no objects are found, original FlowFile are transferred to this relationship
failure All failed attempts to access HDFS will be routed to this relationship
original Original FlowFiles are transferred to this relationship

Reads Attributes:

None specified.

Writes Attributes:

Name

Description

hdfs.objectName The name of the file/dir found on HDFS.
hdfs.path The path is set to the absolute path of the object's parent directory on HDFS. For example, if an object is a directory 'foo', under directory '/bar' then 'hdfs.objectName' will have value 'foo', and 'hdfs.path' will be '/bar'
hdfs.type The type of an object. Possible values: directory, file, link
hdfs.owner The user that owns the object in HDFS
hdfs.group The group that owns the object in HDFS
hdfs.lastModified The timestamp of when the object in HDFS was last modified, as milliseconds since midnight Jan 1, 1970 UTC
hdfs.length In case of files: The number of bytes in the file in HDFS. In case of directories: Returns storage space consumed by directory.
hdfs.count.files In case of type='directory' will represent total count of files under this dir. Won't be populated to other types of HDFS objects.
hdfs.count.dirs In case of type='directory' will represent total count of directories under this dir (including itself). Won't be populated to other types of HDFS objects.
hdfs.replication The number of HDFS replicas for the file
hdfs.permissions The permissions for the object in HDFS. This is formatted as 3 characters for the owner, 3 for the group, and 3 for other users. For example rw-rw-r--
hdfs.status The status contains comma separated list of file/dir paths, which couldn't be listed/accessed. Status won't be set if no errors occurred.
hdfs.full.tree When destination is 'attribute', will be populated with full tree of HDFS directory in JSON format.WARNING: In case when scan finds thousands or millions of objects, having huge values in attribute could impact flow file repo and GC/heap usage. Use content destination for such cases

State management:

This component does not store state.

Restricted:

This component is not restricted.

Input requirement:

This component requires an incoming relationship.

System Resource Considerations:

None specified.