Class HDFSListing
java.lang.Object
org.apache.nifi.processors.hadoop.util.HDFSListing
A simple POJO for maintaining state about the last HDFS Listing that was performed so that
we can avoid pulling the same file multiple times
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HDFSListingvoidsetLatestTimestamp(Date latestTimestamp) Sets the timestamp of the modification date of the newest file that was contained in the HDFS ListingvoidsetMatchingPaths(Collection<String> matchingPaths) Sets the Collection containing the paths of all files in the HDFS Listing whose Modification Date was equal togetLatestTimestamp()toMap()Converts this HDFSListing into a Map<String, String> so that it can be stored in a StateManager.Set<org.apache.hadoop.fs.Path> toPaths()
-
Field Details
-
latestTimestamp
-
matchingPaths
-
-
Constructor Details
-
HDFSListing
public HDFSListing()
-
-
Method Details
-
getLatestTimestamp
- Returns:
- the modification date of the newest file that was contained in the HDFS Listing
-
setLatestTimestamp
Sets the timestamp of the modification date of the newest file that was contained in the HDFS Listing- Parameters:
latestTimestamp- the timestamp of the modification date of the newest file that was contained in the HDFS Listing
-
getMatchingPaths
- Returns:
- a Collection containing the paths of all files in the HDFS Listing whose Modification date
was equal to
getLatestTimestamp()
-
toPaths
- Returns:
- a Collection of
Pathobjects equivalent to those returned bygetMatchingPaths()
-
setMatchingPaths
Sets the Collection containing the paths of all files in the HDFS Listing whose Modification Date was equal togetLatestTimestamp()- Parameters:
matchingPaths- the paths that have last modified date matching the latest timestamp
-
toMap
Converts this HDFSListing into a Map<String, String> so that it can be stored in a StateManager.- Returns:
- a Map that represents the same information as this HDFSListing
-
fromMap
-