Uh oh!
There was an error while loading. Please reload this page.
STORM-2373: HDFS Spout should support multiple ignore extensions - #1957
STORM-2373: HDFS Spout should support multiple ignore extensions#1957pasalkarsachin1 wants to merge 13 commits into
Conversation
pasalkarsachin1
commented
Feb 23, 2017
Can someone take a look at this? |
| /** | ||
| * @deprecated use {@link #setIgnoreSuffix(List)} instead. | ||
| */ | ||
| public HdfsSpout setIgnoreSuffix(String ignoreSuffix) { |
There was a problem hiding this comment.
No needed to deprecate old method and add new one. You just extend the existing method to accept a space separate list of file extensions. That would preserve compatibility and extend it at the same time. conversion to an array can be done internally.
There was a problem hiding this comment.
Done. Suffixes separated by ','
pasalkarsachin1
commented
Feb 24, 2017
@roshannaik Can you again review it please? |
| */ | ||
| public static ArrayList<Path> listFilesByModificationTimeWithIgnoreSuffixes(FileSystem fs, Path directory, | ||
| long olderThan, List<String> ignoreSuffixes) throws IOException { | ||
| * @return | ||
| */ | ||
| private static boolean filterSufix(String name, List<String> ignoreSuffixes) { | ||
harshach
commented
Feb 25, 2017
@pasalkarsachin1 looks good. Minor nits. Also update the doc here with new config changes https://github.com/apache/storm/tree/master/external/storm-hdfs#hdfs-spout |
pasalkarsachin1
commented
Feb 25, 2017
@harshach Done. Thanks for review. |
roshannaik
left a comment
There was a problem hiding this comment.
Have you been able to do any manual testing to validate this ? Would be nice to include a UT.
| // -- ignore file names config | ||
| if ( conf.containsKey(Configs.IGNORE_SUFFIX) ) { | ||
| this.ignoreSuffix = conf.get(Configs.IGNORE_SUFFIX).toString(); | ||
| ignoreSuffixes = Arrays.asList(conf.get(Configs.IGNORE_SUFFIX).toString().split(",")); |
There was a problem hiding this comment.
This wont handle inputs like: ".ignore1, .ignore2 ,.ignore3" where user may put one or more spaces before/after the comma. We should allow for that. Also would be nice to trim off any spaces at the start and end of the entire string.
| | **.setBadFilesDir()** |~~hdfsspout.badfiles.dir~~ | | if there is an error parsing a file's contents, the file is moved to this location. If this directory does not exist it will be created. E.g. /data/badfiles | | ||
| | .setLockDir() |~~hdfsspout.lock.dir~~ | '.lock' subdirectory under hdfsspout.source.dir | Dir in which lock files will be created. Concurrent HDFS spout instances synchronize using *lock* files. Before processing a file the spout instance creates a lock file in this directory with same name as input file and deletes this lock file after processing the file. Spouts also periodically makes a note of their progress (wrt reading the input file) in the lock file so that another spout instance can resume progress on the same file if the spout dies for any reason.| | ||
| | .setIgnoreSuffix() |~~hdfsspout.ignore.suffix~~ | .ignore | File names with this suffix in the in the hdfsspout.source.dir location will not be processed| | ||
| | .setIgnoreSuffix() |~~hdfsspout.ignore.suffix~~ | .ignore | You can provide comma separated suffixes. File names with this suffixes in the hdfsspout.source.dir location will not be processed| |
There was a problem hiding this comment.
Suggest rephrasing the description to
"Comma separated list of file name suffixes. File with matching suffixes in the hdfsspout.source.dir location will not be processed"
pasalkarsachin1
commented
Feb 27, 2017
@roshannaik I have added test case too. We have running this code in our staging environment |
| | **.setBadFilesDir()** |~~hdfsspout.badfiles.dir~~ | | if there is an error parsing a file's contents, the file is moved to this location. If this directory does not exist it will be created. E.g. /data/badfiles | | ||
| | .setLockDir() |~~hdfsspout.lock.dir~~ | '.lock' subdirectory under hdfsspout.source.dir | Dir in which lock files will be created. Concurrent HDFS spout instances synchronize using *lock* files. Before processing a file the spout instance creates a lock file in this directory with same name as input file and deletes this lock file after processing the file. Spouts also periodically makes a note of their progress (wrt reading the input file) in the lock file so that another spout instance can resume progress on the same file if the spout dies for any reason.| | ||
| | .setIgnoreSuffix() |~~hdfsspout.ignore.suffix~~ | .ignore | File names with this suffix in the in the hdfsspout.source.dir location will not be processed| | ||
| | .setIgnoreSuffix() |~~hdfsspout.ignore.suffix~~ | .ignore | Comma separated list of file name suffixes. File with matching suffixes in the hdfsspout.source.dir location will not be processed| |
There was a problem hiding this comment.
A minor correction ... it should say "Files with matching suffixes". Looks good otherwise.
pasalkarsachin1
commented
Feb 27, 2017
@roshannaik Done |
roshannaik
commented
Feb 27, 2017
You made the fix in the wrong place. The sentence should read |
pasalkarsachin1
commented
Feb 28, 2017
@roshannaik My bad. I have corrected it. |
roshannaik
commented
Feb 28, 2017
+1 |
pasalkarsachin1
commented
Feb 28, 2017
Can I squash my changes then? |
roshannaik
commented
Feb 28, 2017
sure |
updated as per comment
@roshannaik Can you help me in squash this? I am not able to do it :( |
This changes is just to support multiple ignore extension for below cases Incase there is another distcp process which copies data to source directory & creates extension of _COPYING_ User have different file extensions which are not supported by reader
pasalkarsachin1
commented
Mar 2, 2017
@roshannaik Thanks for document. Can you merge 8da34ca? Then I will close PR. |
pasalkarsachin1
commented
Mar 4, 2017
Can someone merge it? |
harshach
commented
Mar 7, 2017
@pasalkarsachin1 I am going to merge it in but before can you squash your commits into a single commit. |
pasalkarsachin1
commented
Mar 7, 2017
harshach
commented
Mar 7, 2017
@pasalkarsachin1 this PR still shows commits as 13. you can do git rebase -i HEAD~13 on this branch and squash commits and do a force push to same branch. I don't want to cherry-pick single commit. It will cleaner if we do this via PR. |
roshannaik
commented
Mar 7, 2017
@pasalkarsachin1 its unclear what you have done with the latest (13th) commit. |
pasalkarsachin1
commented
Mar 16, 2017
@roshannaik@harshach Can you help me in merging it. Unfortunately I am not able to squash it :( |
We are closing stale Pull Requests to make the list more manageable. Please re-open any Pull Request that has been closed in error. Closesapache#608Closesapache#639Closesapache#640Closesapache#648Closesapache#662Closesapache#668Closesapache#692Closesapache#705Closesapache#724Closesapache#728Closesapache#730Closesapache#753Closesapache#803Closesapache#854Closesapache#922Closesapache#986Closesapache#992Closesapache#1019Closesapache#1040Closesapache#1041Closesapache#1043Closesapache#1046Closesapache#1051Closesapache#1078Closesapache#1146Closesapache#1164Closesapache#1165Closesapache#1178Closesapache#1213Closesapache#1225Closesapache#1258Closesapache#1259Closesapache#1268Closesapache#1272Closesapache#1277Closesapache#1278Closesapache#1288Closesapache#1296Closesapache#1328Closesapache#1342Closesapache#1353Closesapache#1370Closesapache#1376Closesapache#1391Closesapache#1395Closesapache#1399Closesapache#1406Closesapache#1410Closesapache#1422Closesapache#1427Closesapache#1443Closesapache#1462Closesapache#1468Closesapache#1483Closesapache#1506Closesapache#1509Closesapache#1515Closesapache#1520Closesapache#1521Closesapache#1525Closesapache#1527Closesapache#1544Closesapache#1550Closesapache#1566Closesapache#1569Closesapache#1570Closesapache#1575Closesapache#1580Closesapache#1584Closesapache#1591Closesapache#1600Closesapache#1611Closesapache#1613Closesapache#1639Closesapache#1703Closesapache#1711Closesapache#1719Closesapache#1737Closesapache#1760Closesapache#1767Closesapache#1768Closesapache#1785Closesapache#1799Closesapache#1822Closesapache#1824Closesapache#1844Closesapache#1874Closesapache#1918Closesapache#1928Closesapache#1937Closesapache#1942Closesapache#1951Closesapache#1957Closesapache#1963Closesapache#1964Closesapache#1965Closesapache#1967Closesapache#1968Closesapache#1971Closesapache#1985Closesapache#1986Closesapache#1998Closesapache#2031Closesapache#2032Closesapache#2071Closesapache#2076Closesapache#2108Closesapache#2119Closesapache#2128Closesapache#2142Closesapache#2174Closesapache#2206Closesapache#2297Closesapache#2322Closesapache#2332Closesapache#2341Closesapache#2377Closesapache#2414Closesapache#2469
We are closing stale Pull Requests to make the list more manageable. Please re-open any Pull Request that has been closed in error. Closesapache#608Closesapache#639Closesapache#640Closesapache#648Closesapache#662Closesapache#668Closesapache#692Closesapache#705Closesapache#724Closesapache#728Closesapache#730Closesapache#753Closesapache#803Closesapache#854Closesapache#922Closesapache#986Closesapache#992Closesapache#1019Closesapache#1040Closesapache#1041Closesapache#1043Closesapache#1046Closesapache#1051Closesapache#1078Closesapache#1146Closesapache#1164Closesapache#1165Closesapache#1178Closesapache#1213Closesapache#1225Closesapache#1258Closesapache#1259Closesapache#1268Closesapache#1272Closesapache#1277Closesapache#1278Closesapache#1288Closesapache#1296Closesapache#1328Closesapache#1342Closesapache#1353Closesapache#1370Closesapache#1376Closesapache#1391Closesapache#1395Closesapache#1399Closesapache#1406Closesapache#1410Closesapache#1422Closesapache#1427Closesapache#1443Closesapache#1462Closesapache#1468Closesapache#1483Closesapache#1506Closesapache#1509Closesapache#1515Closesapache#1520Closesapache#1521Closesapache#1525Closesapache#1527Closesapache#1544Closesapache#1550Closesapache#1566Closesapache#1569Closesapache#1570Closesapache#1575Closesapache#1580Closesapache#1584Closesapache#1591Closesapache#1600Closesapache#1611Closesapache#1613Closesapache#1639Closesapache#1703Closesapache#1711Closesapache#1719Closesapache#1737Closesapache#1760Closesapache#1767Closesapache#1768Closesapache#1785Closesapache#1799Closesapache#1822Closesapache#1824Closesapache#1844Closesapache#1874Closesapache#1918Closesapache#1928Closesapache#1937Closesapache#1942Closesapache#1951Closesapache#1957Closesapache#1963Closesapache#1964Closesapache#1965Closesapache#1967Closesapache#1968Closesapache#1971Closesapache#1985Closesapache#1986Closesapache#1998Closesapache#2031Closesapache#2032Closesapache#2071Closesapache#2076Closesapache#2108Closesapache#2119Closesapache#2128Closesapache#2142Closesapache#2174Closesapache#2206Closesapache#2297Closesapache#2322Closesapache#2332Closesapache#2341Closesapache#2377Closesapache#2414Closesapache#2469
This changes is just to support multiple ignore extension for below cases