LocalDirsHandlerService extends AbstractService implements HealthReporter { public List<String> getLocalDirs() { return localDirs.getGoodDirs(); } LocalDirsHandlerService();  LocalDirsHandlerService(NodeManagerMetrics nodeManagerMetrics); void registerLocalDirsChangeListener(DirsChangeListener listener); void registerLogDirsChangeListener(DirsChangeListener listener); void deregisterLocalDirsChangeListener(DirsChangeListener listener); void deregisterLogDirsChangeListener(DirsChangeListener listener); List<String> getLocalDirs(); List<String> getLogDirs(); List<String> getDiskFullLocalDirs(); List<String> getDiskFullLogDirs(); List<String> getLocalDirsForRead(); List<String> getLocalDirsForCleanup(); List<String> getLogDirsForRead(); List<String> getLogDirsForCleanup(); String getDisksHealthReport(boolean listGoodDirs); @Override String getHealthReport(); boolean areDisksHealthy(); @Override boolean isHealthy(); long getLastDisksCheckTime(); @Override long getLastHealthReportTime(); boolean isGoodLocalDir(String path); boolean isGoodLogDir(String path); @VisibleForTesting void checkDirs(); Path getLocalPathForWrite(String pathStr); Path getLocalPathForWrite(String pathStr, long size,
      boolean checkWrite); Path getLocalPathForRead(String pathStr); Iterable<Path> getAllLocalPathsForRead(String pathStr); Path getLogPathForWrite(String pathStr, boolean checkWrite); Path getLogPathToRead(String pathStr); static String[] validatePaths(String[] paths);  }
@Test public void testDirStructure() throws Exception { Configuration conf = new YarnConfiguration(); String localDir1 = new File("file: conf.set(YarnConfiguration.NM_LOCAL_DIRS, localDir1); String logDir1 = new File("file: conf.set(YarnConfiguration.NM_LOG_DIRS, logDir1); LocalDirsHandlerService dirSvc = new LocalDirsHandlerService(); dirSvc.init(conf); Assert.assertEquals(1, dirSvc.getLocalDirs().size()); dirSvc.close(); }