private void cancelWatchesForAttempt(AttemptPathIdentifier pathIdentifier) {
    // TODO May be possible to do finer-grained locks.
    synchronized(watchesPerAttempt) {
      List<WatchKey> list = watchesPerAttempt.remove(pathIdentifier);
      if (list != null) {
        for (WatchKey watchKey : list) {
          watchKey.cancel();
        }
      }
    }
  }
Invoke when a pathIdentifier has been found, or is no longer of interest
@param pathIdentifier
llap-server/src/java/org/apache/hadoop/hive/llap/shufflehandler/DirWatcher.java