private static Stream<Path> findOpenFileDescriptors(Pattern searchPattern) throws IOException {
    return Files.walk(Paths.get("/proc/self/fd")).filter(p -> {
      Path resolved = p;
      if (Files.isSymbolicLink(p)) {
        try {
          resolved = Files.readSymbolicLink(p);
        } catch (IOException exception) {
          throw new UncheckedIOException(exception);
        }
      }
      return searchPattern.matcher(resolved.toString()).find();
    });
  }
Tests for the log4j configuration of the LLAP daemons.
llap-server/src/test/org/apache/hadoop/hive/llap/daemon/impl/TestLlapDaemonLogging.java