GetHDFSFileInfo

Description:

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, HCFS, 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 NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Hadoop Configuration ResourcesHadoop 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. To use swebhdfs, see 'Additional Details' section of PutHDFS's documentation.

This property expects a comma-separated list of file resources.

Supports Expression Language: true (will be evaluated using variable registry only)
Kerberos Credentials Servicekerberos-credentials-serviceController Service API:
KerberosCredentialsService
Implementation: KeytabCredentialsService
Specifies the Kerberos Credentials Controller Service that should be used for authenticating with Kerberos
Kerberos User Servicekerberos-user-serviceController Service API:
KerberosUserService
Implementations: KerberosTicketCacheUserService
KerberosKeytabUserService
KerberosPasswordUserService
Specifies the Kerberos User Controller Service that should be used for authenticating with Kerberos
Kerberos PrincipalKerberos PrincipalKerberos 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 KeytabKerberos KeytabKerberos keytab associated with the principal. Requires nifi.kerberos.krb5.file to be set in your nifi.properties

This property requires exactly one file to be provided..

Supports Expression Language: true (will be evaluated using variable registry only)
Kerberos PasswordKerberos PasswordKerberos password associated with the principal.
Sensitive Property: true
Kerberos Relogin PeriodKerberos Relogin Period4 hoursPeriod 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 ResourcesAdditional Classpath ResourcesA comma-separated list of paths to files and/or directories that will be added to the classpath and used for loading native libraries. When specifying a directory, all files with in the directory will be added to the classpath, but further sub-directories will not be included.

This property expects a comma-separated list of resources. Each of the resources may be of any of the following types: directory, file.
Full pathgethdfsfileinfo-full-pathA 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 Subdirectoriesgethdfsfileinfo-recurse-subdirstrue
  • true
  • false
Indicates whether to list files from subdirectories of the HDFS directory
Directory Filtergethdfsfileinfo-dir-filterRegex. 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 Filtergethdfsfileinfo-file-filterRegex. 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 Filesgethdfsfileinfo-file-exclude-filterRegex. 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 Directoriesgethdfsfileinfo-ignore-dotted-dirstrue
  • true
  • false
If true, directories whose names begin with a dot (".") will be ignored
Ignore Dotted Filesgethdfsfileinfo-ignore-dotted-filestrue
  • true
  • false
If true, files whose names begin with a dot (".") will be ignored
Group Resultsgethdfsfileinfo-groupAll
  • All Group all results into a single flowfile.
  • Parent Directory Group HDFS objects by their parent directories only. Processor will generate flowfile for each directory (if recursive). If 'Recurse Subdirectories' property set to 'false', then will have the same effect as 'All'
  • None Don't group results. Generate flowfile per each HDFS object.
Groups HDFS objects
Batch Sizegethdfsfileinfo-batch-sizeNumber of records to put into an output flowfile when 'Destination' is set to 'Content' and 'Group Results' is set to 'None'
Destinationgethdfsfileinfo-destinationContent
  • Attributes Details of given HDFS object will be stored in attributes of flowfile. 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.
  • Content Details of given HDFS object will be stored in a content in JSON format
Sets the destination for the resutls. When set to 'Content', attributes of flowfile won't be used for storing results.

Relationships:

NameDescription
successAll successfully generated FlowFiles are transferred to this relationship
not foundIf no objects are found, original FlowFile are transferred to this relationship
failureAll failed attempts to access HDFS will be routed to this relationship
originalOriginal FlowFiles are transferred to this relationship

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
hdfs.objectNameThe name of the file/dir found on HDFS.
hdfs.pathThe 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.typeThe type of an object. Possible values: directory, file, link
hdfs.ownerThe user that owns the object in HDFS
hdfs.groupThe group that owns the object in HDFS
hdfs.lastModifiedThe timestamp of when the object in HDFS was last modified, as milliseconds since midnight Jan 1, 1970 UTC
hdfs.lengthIn case of files: The number of bytes in the file in HDFS. In case of dirs: Retuns storage space consumed by directory.
hdfs.count.filesIn 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.dirsIn 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.replicationThe number of HDFS replicas for the file
hdfs.permissionsThe 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.statusThe status contains comma separated list of file/dir paths, which couldn't be listed/accessed. Status won't be set if no errors occured.
hdfs.full.treeWhen 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 allows an incoming relationship.

System Resource Considerations:

None specified.

See Also:

ListHDFS, GetHDFS, FetchHDFS, PutHDFS