/** * Adds the jars from a directory into the distributed cache of a job. * * @param job The job to configure. * @param jarDirectory A path to a directory of jar files. * @throws IOException If there is a problem reading from the file system. */ public static void addJarsToDistributedCache(Job job, String jarDirectory) throws IOException { addJarsToDistributedCache(job, new File(jarDirectory)); }
/** * Adds the jars from a directory into the distributed cache of a job. * * @param job The job to configure. * @param jarDirectory A path to a directory of jar files. * @throws IOException If there is a problem reading from the file system. */ public static void addJarsToDistributedCache(Job job, File jarDirectory) throws IOException { if (null == jarDirectory) { throw new IllegalArgumentException("Jar directory may not be null"); } if (!jarDirectory.exists()) { throw new IOException("The jar directory " + jarDirectory.getPath() + " does not exist."); } List<String> allJars = new ArrayList<String>(); // Get existing jars named in configuration. allJars.addAll(getJarsFromConfiguration(job.getConfiguration())); // Add jars from jarDirectory. allJars.addAll(getJarsFromDirectory(job.getConfiguration(), jarDirectory)); // De-dupe List<String> deDupedJars = deDuplicateJarNames(allJars); job.getConfiguration().set(CONF_TMPJARS, StringUtils.join(deDupedJars, ",")); }
DistributedCacheJars.addJarsToDistributedCache( job, new File(System.getenv("FIJI_HOME"), "lib")); FijiMRPlatformBridge.get().setUserClassesTakesPrecedence(job, true);
DistributedCacheJars.addJarsToDistributedCache( job, new File(System.getenv("FIJI_HOME"), "lib")); FijiMRPlatformBridge.get().setUserClassesTakesPrecedence(job, true);
DistributedCacheJars.addJarsToDistributedCache(job, new File(System.getenv("FIJI_HOME"), "lib")); FijiMRPlatformBridge.get().setUserClassesTakesPrecedence(job, true);