/** * main() has some simple utility methods * @param argv the command and its arguments * @throws Exception upon error */ public static void main(String argv[]) throws Exception { FsShell shell = newShellInstance(); Configuration conf = new Configuration(); conf.setQuietMode(false); shell.setConf(conf); int res; try { res = ToolRunner.run(shell, argv); } finally { shell.close(); } System.exit(res); }
public static void main(String argv[]) throws Exception { FsShell shell = new HdfsFindTool(); int res; try { res = ToolRunner.run(shell, argv); } finally { shell.close(); } System.exit(res); }
/** * main() has some simple utility methods */ public static void main(String argv[]) throws Exception { FsShell shell = new FsShell(); int res; try { res = ToolRunner.run(shell, argv); } finally { shell.close(); } System.exit(res); }
/** * main() has some simple utility methods */ public static void main(String argv[]) throws Exception { FsShell shell = new FsShell(); int res; try { res = ToolRunner.run(shell, argv); } finally { shell.close(); } System.exit(res); }
/** * Copies a files. * @param srcFile File to copy from. * @param destFile File to copy to. The file should not exist. * @throws IOException if there is an error copying the file. */ private static void copyFile(Path srcFile, Path destFile) throws IOException { String[] copyArgs = {"-cp", srcFile.toString(), destFile.toString()}; FsShell shell = new FsShell(); try { LOG.debug("Using shell to copy with args " + Arrays.asList(copyArgs)); ToolRunner.run(shell, copyArgs); } catch (Exception e) { throw new IOException(e); } finally { shell.close(); } } }
/** * Copies a files. * @param srcFile File to copy from. * @param destFile File to copy to. The file should not exist. * @throws IOException if there is an error copying the file. */ private static void copyFile(Path srcFile, Path destFile) throws IOException { String[] copyArgs = {"-cp", srcFile.toString(), destFile.toString()}; FsShell shell = new FsShell(); try { LOG.debug("Using shell to copy with args " + Arrays.asList(copyArgs)); ToolRunner.run(shell, copyArgs); } catch (Exception e) { throw new IOException(e); } finally { shell.close(); } } }
/** * main() has some simple utility methods * @param argv the command and its arguments * @throws Exception upon error */ public static void main(String argv[]) throws Exception { FsShell shell = newShellInstance(); Configuration conf = new Configuration(); conf.setQuietMode(false); shell.setConf(conf); int res; try { res = ToolRunner.run(shell, argv); } finally { shell.close(); } System.exit(res); }
/** * main() has some simple utility methods * @param argv the command and its arguments * @throws Exception upon error */ public static void main(String argv[]) throws Exception { FsShell shell = newShellInstance(); Configuration conf = new Configuration(); conf.setQuietMode(false); shell.setConf(conf); int res; try { res = ToolRunner.run(shell, argv); } finally { shell.close(); } System.exit(res); }
/** * main() has some simple utility methods * @param argv the command and its arguments * @throws Exception upon error */ public static void main(String argv[]) throws Exception { FsShell shell = newShellInstance(); Configuration conf = new Configuration(); conf.setQuietMode(false); shell.setConf(conf); int res; try { res = ToolRunner.run(shell, argv); } finally { shell.close(); } System.exit(res); }
/** * main() has some simple utility methods * @param argv the command and its arguments * @throws Exception upon error */ public static void main(String argv[]) throws Exception { FsShell shell = newShellInstance(); Configuration conf = new Configuration(); conf.setQuietMode(false); shell.setConf(conf); int res; try { res = ToolRunner.run(shell, argv); } finally { shell.close(); } System.exit(res); }
throw new DistCpException(e); } finally { shell.close();
try { fs.close(); shell.close(); } catch (IOException ignored) {}
private void runTruncateShellCommand(Path src, int oldLength, String[] shellOpts) throws Exception { // create file and write data writeContents(AppendTestUtil.initBuffer(oldLength), oldLength, src); assertThat(fs.getFileStatus(src).getLen(), is((long)oldLength)); // truncate file using shell FsShell shell = null; try { shell = new FsShell(conf); assertThat(ToolRunner.run(shell, shellOpts), is(0)); } finally { if(shell != null) { shell.close(); } } }
} finally { if (null != shell) shell.close();
} finally { if (null != shell) { shell.close();
try { fs.close(); shell.close(); } catch (IOException ignored) {}
} finally { if (null != shell) { shell.close();
} finally { if (null != shell) { shell.close();
} finally { if (shell != null) { shell.close();