try { destUrl = ConverterUtils.getYarnUrlFromPath( FileContext.getFileContext().makeQualified(dfsPath)); } catch (UnsupportedFileSystemException e) { throw new DfsFacadeException(
src.checkNotSchemeWithRelative(); dst.checkNotSchemeWithRelative(); Path qSrc = makeQualified(src); Path qDst = makeQualified(dst); checkDest(qSrc.getName(), qDst, overwrite); FileStatus fs = FileContext.this.getFileStatus(qSrc); FileStatus[] contents = listStatus(qSrc); for (FileStatus content : contents) { copy(makeQualified(content.getPath()), makeQualified(new Path(qDst, content.getPath().getName())), deleteSource, overwrite);
protected boolean deleteDir(FileStatus serialDir) throws AccessControlException, FileNotFoundException, UnsupportedFileSystemException, IOException { return doneDirFc.delete(doneDirFc.makeQualified(serialDir.getPath()), true); }
protected boolean deleteDir(FileStatus serialDir) throws AccessControlException, FileNotFoundException, UnsupportedFileSystemException, IOException { return doneDirFc.delete(doneDirFc.makeQualified(serialDir.getPath()), true); }
protected synchronized void delete() throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("deleting " + historyFile + " and " + confFile); } state = HistoryInfoState.DELETED; doneDirFc.delete(doneDirFc.makeQualified(historyFile), false); doneDirFc.delete(doneDirFc.makeQualified(confFile), false); }
protected synchronized void delete() throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("deleting " + historyFile + " and " + confFile); } state = HistoryInfoState.DELETED; doneDirFc.delete(doneDirFc.makeQualified(historyFile), false); doneDirFc.delete(doneDirFc.makeQualified(confFile), false); }
protected synchronized void delete() throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("deleting " + historyFile + " and " + confFile); } state = HistoryInfoState.DELETED; doneDirFc.delete(doneDirFc.makeQualified(historyFile), false); doneDirFc.delete(doneDirFc.makeQualified(confFile), false); }
protected boolean deleteDir(FileStatus serialDir) throws AccessControlException, FileNotFoundException, UnsupportedFileSystemException, IOException { return doneDirFc.delete(doneDirFc.makeQualified(serialDir.getPath()), true); }
private Path getFullyQualifiedPath(String pathString) { return useFCOption ? mfc.makeQualified(new Path(ROOT_DIR, pathString)) : mfs.makeQualified(new Path(ROOT_DIR, pathString)); }
static void linkUpFirstComponents(Configuration conf, String path, FileContext fsTarget, String info) { int indexOfEnd = path.indexOf('/', 1); if (Shell.WINDOWS) { indexOfEnd = path.indexOf('/', indexOfEnd + 1); } String firstComponent = path.substring(0, indexOfEnd); URI linkTarget = fsTarget.makeQualified(new Path(firstComponent)).toUri(); ConfigUtil.addLink(conf, firstComponent, linkTarget); Log.info("Added link for " + info + " " + firstComponent + "->" + linkTarget); }
static void linkUpFirstComponents(Configuration conf, String path, FileContext fsTarget, String info) { int indexOfEnd = path.indexOf('/', 1); if (Shell.WINDOWS) { indexOfEnd = path.indexOf('/', indexOfEnd + 1); } String firstComponent = path.substring(0, indexOfEnd); URI linkTarget = fsTarget.makeQualified(new Path(firstComponent)).toUri(); ConfigUtil.addLink(conf, firstComponent, linkTarget); Log.info("Added link for " + info + " " + firstComponent + "->" + linkTarget); }
@BeforeClass public static void clusterSetupAtBegining() throws IOException, LoginException, URISyntaxException { Configuration conf = new HdfsConfiguration(); cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build(); fc = FileContext.getFileContext(cluster.getURI(), conf); defaultWorkingDirectory = fc.makeQualified( new Path("/user/" + UserGroupInformation.getCurrentUser().getShortUserName())); fc.mkdir(defaultWorkingDirectory, FileContext.DEFAULT_PERM, true); }
@BeforeClass public static void clusterSetupAtBegining() throws IOException, LoginException, URISyntaxException { Configuration conf = new HdfsConfiguration(); cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build(); fc = FileContext.getFileContext(cluster.getURI(), conf); defaultWorkingDirectory = fc.makeQualified( new Path("/user/" + UserGroupInformation.getCurrentUser().getShortUserName())); fc.mkdir(defaultWorkingDirectory, FileContext.DEFAULT_PERM, true); }
@BeforeClass public static void clusterSetupAtBegining() throws IOException, LoginException, URISyntaxException { cluster = new MiniDFSCluster.Builder(CONF).numDataNodes(2).build(); cluster.waitClusterUp(); fc = FileContext.getFileContext(cluster.getURI(), CONF); defaultWorkingDirectory = fc.makeQualified( new Path("/user/" + UserGroupInformation.getCurrentUser().getShortUserName())); fc.mkdir(defaultWorkingDirectory, FileContext.DEFAULT_PERM, true); }
private static void restartCluster() throws IOException, LoginException { if (cluster != null) { cluster.shutdown(); cluster = null; } cluster = new MiniDFSCluster.Builder(CONF).numDataNodes(1) .format(false).build(); cluster.waitClusterUp(); fc = FileContext.getFileContext(cluster.getURI(), CONF); defaultWorkingDirectory = fc.makeQualified( new Path("/user/" + UserGroupInformation.getCurrentUser().getShortUserName())); fc.mkdir(defaultWorkingDirectory, FileContext.DEFAULT_PERM, true); }
private static Path getJobConfInIntermediateDoneDir(Configuration conf, JobId jobId) throws IOException { Path userDoneDir = new Path( JobHistoryUtils.getHistoryIntermediateDoneDirForUser(conf)); Path doneDirPrefix = FileContext.getFileContext(conf).makeQualified(userDoneDir); return new Path( doneDirPrefix, JobHistoryUtils.getIntermediateConfFileName(jobId)); }
@BeforeClass public static void clusterSetupAtBegining() throws IOException, LoginException, URISyntaxException { Configuration conf = new HdfsConfiguration(); // set permissions very restrictive conf.set(CommonConfigurationKeys.FS_PERMISSIONS_UMASK_KEY, "077"); cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build(); fc = FileContext.getFileContext(cluster.getURI(0), conf); defaultWorkingDirectory = fc.makeQualified( new Path("/user/" + UserGroupInformation.getCurrentUser().getShortUserName())); fc.mkdir(defaultWorkingDirectory, FileContext.DEFAULT_PERM, true); }
@BeforeClass public static void clusterSetupAtBegining() throws IOException, LoginException, URISyntaxException { Configuration conf = new HdfsConfiguration(); cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build(); fc = FileContext.getFileContext(cluster.getURI(0), conf); defaultWorkingDirectory = fc.makeQualified( new Path("/user/" + UserGroupInformation.getCurrentUser().getShortUserName())); fc.mkdir(defaultWorkingDirectory, FileContext.DEFAULT_PERM, true); }
@BeforeClass public static void clusterSetupAtBegining() throws IOException, LoginException, URISyntaxException { Configuration conf = new HdfsConfiguration(); cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build(); fc = FileContext.getFileContext(cluster.getURI(0), conf); defaultWorkingDirectory = fc.makeQualified( new Path("/user/" + UserGroupInformation.getCurrentUser().getShortUserName())); fc.mkdir(defaultWorkingDirectory, FileContext.DEFAULT_PERM, true); }
@BeforeClass public static void clusterSetupAtBegining() throws IOException, LoginException, URISyntaxException { cluster = new MiniDFSCluster.Builder(CONF).numDataNodes(2).build(); cluster.waitClusterUp(); URI uri0 = cluster.getURI(0); fc = FileContext.getFileContext(uri0, CONF); defaultWorkingDirectory = fc.makeQualified( new Path("/user/" + UserGroupInformation.getCurrentUser().getShortUserName())); fc.mkdir(defaultWorkingDirectory, FileContext.DEFAULT_PERM, true); }