The connector must be configured with a specific FSDirectoryWalker
that will be responsible for scanning an input directory to find files eligible to be streamed in Kafka.
FSDirectoryWalker implementation is :
FilePulseSourceConnector periodically triggers a file system scan of the directory specified in the
connector property. Scan is executed in a background-thread invoking the configured
Configuring Directory Scan (using
|The class used to scan file system
|The input directory to scan
|Time interval in milliseconds at wish the input directory is scanned
|The comma-separated list of fully qualified class names of the filter-filters to be uses to list eligible input files
|Boolean indicating whether local directory should be recursively scanned
Filtering input files
You can configure one or more
FileFilter that will be used to determine if a file should be scheduled for processing or ignored.
All files that are filtered out are simply ignored and remain untouched on the file system until the next scan.
At the next scan, previously filtered files will be evaluated again to determine if they are now eligible for processing.
FilePulse packs with the following built-in filters :
IgnoreHiddenFileFilter can be used to filter hidden files from being read.
LastModifiedFileFilter can be used to filter files that have been modified to recently based on their last modified date property.
# The last modified time for a file can be accepted (default: 5000)
RegexFileFilter can be used to filter files that do not match the specified regex.
# The regex pattern used to matches input files
Supported File types
LocalFSDirectoryWalker will try to detect if a file needs to be decompressed by probing its content type or its extension (javadoc : Files#probeContentType)
The connector supports the following content types :
- GZIP :
- TAR :
- ZIP :