@Test(expected = IOException.class) public void testAddJarDirectoryThatDoesntExist() throws IOException { DistCache.addJarDirToDistributedCache(testConf, "/garbage/doesntexist"); }
public static void addJarDirToDistributedCache(Configuration conf, File jarDirectory) throws IOException { if (!jarDirectory.exists() || !jarDirectory.isDirectory()) { throw new IOException("Jar directory: " + jarDirectory.getCanonicalPath() + " does not " + "exist or is not a directory."); } for (File file : jarDirectory.listFiles()) { if (!file.isDirectory() && file.getName().endsWith(".jar")) { addJarToDistributedCache(conf, file); } } }
DistCache { public static void addJarDirToDistributedCache(Configuration conf, File jarDirectory) throws IOException { if (!jarDirectory.exists() || !jarDirectory.isDirectory()) { throw new IOException("Jar directory: " + jarDirectory.getCanonicalPath() + " does not " + "exist or is not a directory."); } for (File file : jarDirectory.listFiles()) { if (!file.isDirectory() && file.getName().endsWith(".jar")) { addJarToDistributedCache(conf, file); } } } }
DistCache { public static void addJarDirToDistributedCache(Configuration conf, File jarDirectory) throws IOException { if (!jarDirectory.exists() || !jarDirectory.isDirectory()) { throw new IOException("Jar directory: " + jarDirectory.getCanonicalPath() + " does not " + "exist or is not a directory."); } for (File file : jarDirectory.listFiles()) { if (!file.isDirectory() && file.getName().endsWith(".jar")) { addJarToDistributedCache(conf, file); } } }  }
DistCache { public static void addJarDirToDistributedCache(Configuration conf, File jarDirectory) throws IOException { if (!jarDirectory.exists() || !jarDirectory.isDirectory()) { throw new IOException("Jar directory: " + jarDirectory.getCanonicalPath() + " does not " + "exist or is not a directory."); } for (File file : jarDirectory.listFiles()) { if (!file.isDirectory() && file.getName().endsWith(".jar")) { addJarToDistributedCache(conf, file); } } }  static void write(Configuration conf, Path path, Object value); static Object read(Configuration conf, Path path); static void addJarToDistributedCache(Configuration conf, File jarFile); static void addJarToDistributedCache(Configuration conf, String jarFile); static String findContainingJar(Class jarClass); static void addJarDirToDistributedCache(Configuration conf, File jarDirectory); static void addJarDirToDistributedCache(Configuration conf, String jarDirectory); }
DistCache { public static void addJarDirToDistributedCache(Configuration conf, File jarDirectory) throws IOException { if (!jarDirectory.exists() || !jarDirectory.isDirectory()) { throw new IOException("Jar directory: " + jarDirectory.getCanonicalPath() + " does not " + "exist or is not a directory."); } for (File file : jarDirectory.listFiles()) { if (!file.isDirectory() && file.getName().endsWith(".jar")) { addJarToDistributedCache(conf, file); } } }  static void write(Configuration conf, Path path, Object value); static Object read(Configuration conf, Path path); static void addJarToDistributedCache(Configuration conf, File jarFile); static void addJarToDistributedCache(Configuration conf, String jarFile); static String findContainingJar(Class jarClass); static void addJarDirToDistributedCache(Configuration conf, File jarDirectory); static void addJarDirToDistributedCache(Configuration conf, String jarDirectory);  }