void registerDagDir(String pathString, String appId, int dagIdentifier, String user, long expiry) throws IOException {
    // The path string contains the dag Identifier
    Path path = FileSystems.getDefault().getPath(pathString);
    WatchedPathInfo watchedPathInfo =
        new WatchedPathInfo(System.currentTimeMillis() + expiry, Type.BASE, appId, dagIdentifier,
            user);
    watchedPaths.put(path, watchedPathInfo);
    WatchKey watchKey = path.register(watchService, ENTRY_CREATE);
    watchedPathInfo.setWatchKey(watchKey);
    watchedPathQueue.add(watchedPathInfo);

    // TODO Watches on the output dirs need to be cancelled at some point. For now - via the expiry.
  }
Register a base dir for an application
@param pathString the full path including jobId, user - /${local.dir}/appCache/${appId}/userCache/${user}
@param appId the appId
@param user the user
@param expiry when to expire the watch - in ms
@throws IOException
llap-server/src/java/org/apache/hadoop/hive/llap/shufflehandler/DirWatcher.java