Set<String> jarPaths = FileUtils.getJarFilesByPath(renewableJarPath, sessionConf);
Set<String> jarPaths = FileUtils.getJarFilesByPath(renewableJarPath, sessionConf);
@Test public void testGetJarFilesByPath() { HiveConf conf = new HiveConf(this.getClass()); File tmpDir = Files.createTempDir(); String jarFileName1 = tmpDir.getAbsolutePath() + File.separator + "a.jar"; String jarFileName2 = tmpDir.getAbsolutePath() + File.separator + "b.jar"; File jarFile1 = new File(jarFileName1); try { org.apache.commons.io.FileUtils.touch(jarFile1); Set<String> jars = FileUtils.getJarFilesByPath(tmpDir.getAbsolutePath(), conf); Assert.assertEquals(Sets.newHashSet("file://" + jarFileName1), jars); jars = FileUtils.getJarFilesByPath("/folder/not/exist", conf); Assert.assertTrue(jars.isEmpty()); File jarFile2 = new File(jarFileName2); org.apache.commons.io.FileUtils.touch(jarFile2); String newPath = "file://" + jarFileName1 + "," + "file://" + jarFileName2 + ",/file/not/exist"; jars = FileUtils.getJarFilesByPath(newPath, conf); Assert.assertEquals(Sets.newHashSet("file://" + jarFileName1, "file://" + jarFileName2), jars); } catch (IOException e) { LOG.error("failed to copy file to reloading folder", e); Assert.fail(e.getMessage()); } finally { org.apache.commons.io.FileUtils.deleteQuietly(tmpDir); } }
auxJars = StringUtils.join(FileUtils.getJarFilesByPath(this.get(ConfVars.HIVEAUXJARS.varname), this), ',');
auxJars = StringUtils.join(FileUtils.getJarFilesByPath(this.get(ConfVars.HIVEAUXJARS.varname), this), ',');