Skip to content

STORM-2373: HDFS Spout should support multiple ignore extensions - #1957

Closed
pasalkarsachin1 wants to merge 13 commits into
apache:1.x-branchfrom
pasalkarsachin1:STORM-2373
Closed

STORM-2373: HDFS Spout should support multiple ignore extensions#1957
pasalkarsachin1 wants to merge 13 commits into
apache:1.x-branchfrom
pasalkarsachin1:STORM-2373

Conversation

@pasalkarsachin1

@pasalkarsachin1pasalkarsachin1 commented Feb 22, 2017

Copy link
Copy Markdown
Contributor

This changes is just to support multiple ignore extension for below cases

  1. Incase there is another distcp process which copies data to source directory & creates extension of _COPYING_
  2. User have different file extensions which are not supported by reader

@pasalkarsachin1

Copy link
Copy Markdown
ContributorAuthor

Can someone take a look at this?

/**
* @deprecated use {@link #setIgnoreSuffix(List)} instead.
*/
public HdfsSpout setIgnoreSuffix(String ignoreSuffix) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Suffixes separated by ','

@pasalkarsachin1

Copy link
Copy Markdown
ContributorAuthor

@roshannaik Can you again review it please?

*/
public static ArrayList<Path> listFilesByModificationTimeWithIgnoreSuffixes(FileSystem fs, Path directory,
long olderThan, List<String> ignoreSuffixes) throws IOException {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove empty line.

* @return
*/
private static boolean filterSufix(String name, List<String> ignoreSuffixes) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here.

@harshach

Copy link
Copy Markdown
Contributor

@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

Copy link
Copy Markdown
ContributorAuthor

@harshach Done. Thanks for review.

@roshannaikroshannaik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(","));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment threadexternal/storm-hdfs/README.md Outdated
| **.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|

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
ContributorAuthor

@roshannaik I have added test case too. We have running this code in our staging environment

Comment threadexternal/storm-hdfs/README.md Outdated
| **.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|

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A minor correction ... it should say "Files with matching suffixes". Looks good otherwise.

@pasalkarsachin1

Copy link
Copy Markdown
ContributorAuthor

@roshannaik Done

@roshannaik

Copy link
Copy Markdown
Contributor

You made the fix in the wrong place. The sentence should read
"Comma separated list of file name suffixes. Files with matching suffixes in the hdfsspout.source.dir location will not be processed ".

@pasalkarsachin1

Copy link
Copy Markdown
ContributorAuthor

@roshannaik My bad. I have corrected it.

@roshannaik

Copy link
Copy Markdown
Contributor

+1
Thanks for the contribution.

@pasalkarsachin1

Copy link
Copy Markdown
ContributorAuthor

Can I squash my changes then?

@roshannaik

Copy link
Copy Markdown
Contributor

sure

@pasalkarsachin1

pasalkarsachin1 commented Mar 1, 2017

Copy link
Copy Markdown
ContributorAuthor

@roshannaik Can you help me in squash this? I am not able to do it :(

@roshannaik

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
ContributorAuthor

@roshannaik Thanks for document. Can you merge 8da34ca? Then I will close PR.

@pasalkarsachin1

Copy link
Copy Markdown
ContributorAuthor

Can someone merge it?

@harshach

Copy link
Copy Markdown
Contributor

@pasalkarsachin1 I am going to merge it in but before can you squash your commits into a single commit.

@pasalkarsachin1

Copy link
Copy Markdown
ContributorAuthor

@harshach I have already squash it in 8da34ca

@harshach

Copy link
Copy Markdown
Contributor

@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

Copy link
Copy Markdown
Contributor

@pasalkarsachin1 its unclear what you have done with the latest (13th) commit.
What you need is the first 12 commits squashed into 1. That will leave you with 1 commit only (and not 13 like you have now). I think you may need to get rid of this latest 13th commit before you squash the remaining 12 ... to get this right.

@pasalkarsachin1

Copy link
Copy Markdown
ContributorAuthor

@roshannaik@harshach Can you help me in merging it. Unfortunately I am not able to squash it :(

d2r pushed a commit to d2r/storm that referenced this pull request Oct 16, 2018
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
d2r pushed a commit to d2r/storm that referenced this pull request Oct 16, 2018
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
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@pasalkarsachin1@harshach@roshannaik