Abhinay, nice catch, looks good. Could you add a test case that checks this behavior in TestDirWatcher? Thanks, Jon.
FLUME-263: DirWatcher does not match filename of deleted files against supplied REGEX
Review Request #989 — Created Oct. 7, 2010 and submitted
If you supply a regex to TailDirSource then it also supplies the regex to DirWatcher, so that DirWatcher only informs TailDirSource about the files that match the regex. Now when files are deleted from a directory, DirWatcher will match the file's name against the supplied regex and only if a match occurs will it fire an event to TailDirSource about the deleted file.
Tail a directory on our server with files not matching the supplied regex being created and deleted without killing the DirWatcher thread.
Having problem uploading patch from here https://issues.cloudera.org/secure/attachment/10245/0001-FLUME-263-DirWatcher-does-not-match-filename-of-dele.patch but it looks good.