if (watcher != null) {
LOG.info("removed dir " + f);
LOG.info("stopping watcher for dir: " + f);
// stop is not thread-safe, but since this watcher belongs only to
// this current thread it is safe to call it
watcher.stop();
// calling check explicitly to notify about deleted subdirs,
// so that subdirs watchers can be stopped
watcher.check();
subdirsDeleted.incrementAndGet();
return;