ListHDFS

Description:

Retrieves a listing of files from HDFS. Each time a listing is performed, the files with the latest timestamp will be excluded and picked up during the next execution of the processor. This is done to ensure that we do not miss any files, or produce duplicates, in the cases where files with the same timestamp are written immediately before and after a single execution of the processor. For each file that is listed in HDFS, this processor creates a FlowFile that represents the HDFS file to be fetched in conjunction with FetchHDFS. This Processor is designed to run on Primary Node only in a cluster. If the primary node changes, the new Primary Node will pick up where the previous node left off without duplicating all of the data. Unlike GetHDFS, this Processor does not delete any data from HDFS.

Additional Details...

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, whether a property supports the NiFi Expression Language, and whether a property is considered "sensitive", meaning that its value will be encrypted. Before entering a value in a sensitive property, ensure that the nifi.properties file has an entry for the property nifi.sensitive.props.key.

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. 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 ServiceController Service API:
KerberosCredentialsService
Implementation: KeytabCredentialsService
Specifies the Kerberos Credentials Controller Service that should be used for authenticating with Kerberos
Kerberos User ServiceController Service API:
KerberosUserService
Implementations: KerberosPasswordUserService
KerberosTicketCacheUserService
KerberosKeytabUserService
Specifies the Kerberos User Controller Service that should be used for authenticating with Kerberos
Kerberos 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 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 password associated with the principal.
Sensitive Property: true
Kerberos 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 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: file, directory.
Distributed Cache ServiceController Service API:
DistributedMapCacheClient
Implementations: HBase_2_ClientMapCacheService
CassandraDistributedMapCache
HBase_1_1_2_ClientMapCacheService
DistributedMapCacheClientService
CouchbaseMapCacheClient
HazelcastMapCacheClient
RedisDistributedMapCacheClientService
This property is ignored. State will be stored in the LOCAL or CLUSTER scope by the State Manager based on NiFi's configuration.
DirectoryThe HDFS directory from which files should be read
Supports Expression Language: true (will be evaluated using variable registry only)
Recurse Subdirectoriestrue
  • true
  • false
Indicates whether to list files from subdirectories of the HDFS directory
Record WriterController Service API:
RecordSetWriterFactory
Implementations: AvroRecordSetWriter
ScriptedRecordSetWriter
JsonRecordSetWriter
ParquetRecordSetWriter
RecordSetWriterLookup
FreeFormTextRecordSetWriter
XMLRecordSetWriter
CSVRecordSetWriter
Specifies the Record Writer to use for creating the listing. If not specified, one FlowFile will be created for each entity that is listed. If the Record Writer is specified, all entities will be written to a single FlowFile.
File Filter[^\.].*Only files whose names match the given regular expression will be picked up
File Filter Modefilter-mode-directories-and-files
  • Directories and Files Filtering will be applied to the names of directories and files.  If Recurse Subdirectories is set to true, only subdirectories with a matching name will be searched for files that match the regular expression defined in File Filter.
  • Files Only Filtering will only be applied to the names of files.  If Recurse Subdirectories is set to true, the entire subdirectory tree will be searched for files that match the regular expression defined in File Filter.
  • Full Path Filtering will be applied by evaluating the regular expression defined in File Filter against the full path of files with and without the scheme and authority.  If Recurse Subdirectories is set to true, the entire subdirectory tree will be searched for files in which the full path of the file matches the regular expression defined in File Filter.  See 'Additional Details' for more information.
Determines how the regular expression in File Filter will be used when retrieving listings.
Minimum File AgeThe minimum age that a file must be in order to be pulled; any file younger than this amount of time (based on last modification date) will be ignored
Maximum File AgeThe maximum age that a file must be in order to be pulled; any file older than this amount of time (based on last modification date) will be ignored. Minimum value is 100ms.

Relationships:

NameDescription
successAll FlowFiles are transferred to this relationship

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
filenameThe name of the file that was read from HDFS.
pathThe path is set to the absolute path of the file's directory on HDFS. For example, if the Directory property is set to /tmp, then files picked up from /tmp will have the path attribute set to "./". If the Recurse Subdirectories property is set to true and a file is picked up from /tmp/abc/1/2/3, then the path attribute will be set to "/tmp/abc/1/2/3".
hdfs.ownerThe user that owns the file in HDFS
hdfs.groupThe group that owns the file in HDFS
hdfs.lastModifiedThe timestamp of when the file in HDFS was last modified, as milliseconds since midnight Jan 1, 1970 UTC
hdfs.lengthThe number of bytes in the file in HDFS
hdfs.replicationThe number of HDFS replicas for hte file
hdfs.permissionsThe permissions for the file 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--

State management:

ScopeDescription
CLUSTERAfter performing a listing of HDFS files, the latest timestamp of all the files listed and the latest timestamp of all the files transferred are both stored. This allows the Processor to list only files that have been added or modified after this date the next time that the Processor is run, without having to store all of the actual filenames/paths which could lead to performance problems. State is stored across the cluster so that this Processor can be run on Primary Node only and if a new Primary Node is selected, the new node can pick up where the previous node left off, without duplicating the data.

Restricted:

This component is not restricted.

Input requirement:

This component does not allow an incoming relationship.

System Resource Considerations:

None specified.

See Also:

GetHDFS, FetchHDFS, PutHDFS