/** * guarantee the existance of a file on the remote system * * @param hdfsPath !null path - on the remote system * @param file !null exitsing file */ @Override public void guaranteeFile(String hdfsPath, File file) { if (isRunningAsUser()) { super.guaranteeFile(hdfsPath, file); return; } final FileSystem fs = getDFS(); Path src = new Path(hdfsPath); try { if (fs.exists(src)) return; this.writeToFileSystem(hdfsPath, file); } catch (IOException e) { throw new RuntimeException(e); } }