/** * {@inheritDoc} * * If the file does not exist in Alluxio, query it from HDFS. */ @Override public FileStatus getFileStatus(Path path) throws IOException { LOG.debug("getFileStatus({})", path); if (mStatistics != null) { mStatistics.incrementReadOps(1); } AlluxioURI uri = new AlluxioURI(HadoopUtils.getPathWithoutScheme(path)); URIStatus fileStatus; try { fileStatus = mFileSystem.getStatus(uri); } catch (FileDoesNotExistException e) { throw new FileNotFoundException(e.getMessage()); } catch (AlluxioException e) { throw new IOException(e); } return new FileStatus(fileStatus.getLength(), fileStatus.isFolder(), getReplica(fileStatus), fileStatus.getBlockSizeBytes(), fileStatus.getLastModificationTimeMs(), fileStatus.getCreationTimeMs(), new FsPermission((short) fileStatus.getMode()), fileStatus.getOwner(), fileStatus.getGroup(), new Path(mAlluxioHeader + uri)); }
mFileSystem.rename(srcPath, dstPath); } catch (FileDoesNotExistException e) { LOG.warn("rename failed: {}", e.getMessage()); return false; } catch (AlluxioException e) {
LOG.warn("Failed to check replication level for inode id {} : {}", inodeId, e.getMessage());
.setBlockSizeBytes(uiFileInfo.getBlockSizeBytes()).setPath(requestPath); } catch (FileDoesNotExistException e) { response.setFatalError("Error: Invalid Path " + e.getMessage()); } catch (IOException e) { response.setInvalidPathError(
@Test public void moveMissingSource() throws Exception { setPathToNotExist("/notExist"); try { assignMovesFail("/notExist", "/dst"); } catch (FileDoesNotExistException e) { Assert.assertEquals(ExceptionMessage.PATH_DOES_NOT_EXIST.getMessage("/notExist"), e.getMessage()); } }
ListStatusPOptions.newBuilder().setLoadMetadataType(LoadMetadataPType.ALWAYS))); } catch (FileDoesNotExistException e) { response.setInvalidPathError("Error: Invalid Path " + e.getMessage()); return response; } catch (InvalidPathException e) { response.setFileDoesNotExistException("Error: non-existing file " + e.getMessage()); return response; } catch (InvalidPathException e) {
/** * Attempts to delete the file or directory with the specified path. * * @param cPath path to delete * @param recursive if true, will attempt to delete all children of the path * @return true if one or more files/directories were deleted; false otherwise * @throws IOException if the path failed to be deleted due to some constraint (ie. non empty * directory with recursive flag disabled) */ @Override public boolean delete(Path cPath, boolean recursive) throws IOException { LOG.info("delete({}, {})", cPath, recursive); if (mStatistics != null) { mStatistics.incrementWriteOps(1); } AlluxioURI path = new AlluxioURI(HadoopUtils.getPathWithoutScheme(cPath)); DeleteOptions options = DeleteOptions.defaults().setRecursive(recursive); try { mFileSystem.delete(path, options); return true; } catch (InvalidPathException e) { LOG.info("delete failed: {}", e.getMessage()); return false; } catch (FileDoesNotExistException e) { LOG.info("delete failed: {}", e.getMessage()); return false; } catch (AlluxioException e) { throw new IOException(e); } }
/** * {@inheritDoc} * * If the file does not exist in Alluxio, query it from HDFS. */ @Override public FileStatus getFileStatus(Path path) throws IOException { LOG.debug("getFileStatus({})", path); if (mStatistics != null) { mStatistics.incrementReadOps(1); } AlluxioURI uri = new AlluxioURI(HadoopUtils.getPathWithoutScheme(path)); URIStatus fileStatus; try { fileStatus = mFileSystem.getStatus(uri); } catch (FileDoesNotExistException e) { throw new FileNotFoundException(e.getMessage()); } catch (AlluxioException e) { throw new IOException(e); } return new FileStatus(fileStatus.getLength(), fileStatus.isFolder(), getReplica(fileStatus), fileStatus.getBlockSizeBytes(), fileStatus.getLastModificationTimeMs(), fileStatus.getCreationTimeMs(), new FsPermission((short) fileStatus.getMode()), fileStatus.getOwner(), fileStatus.getGroup(), new Path(mAlluxioHeader + uri)); }
/** * {@inheritDoc} * * If the file does not exist in Alluxio, query it from HDFS. */ @Override public FileStatus getFileStatus(Path path) throws IOException { AlluxioURI tPath = new AlluxioURI(HadoopUtils.getPathWithoutScheme(path)); Path hdfsPath = HadoopUtils.getHDFSPath(tPath, mUnderFSAddress); LOG.info("getFileStatus({}): HDFS Path: {} Alluxio Path: {}{}", path, hdfsPath, mAlluxioHeader, tPath); if (mStatistics != null) { mStatistics.incrementReadOps(1); } URIStatus fileStatus; try { fileStatus = mFileSystem.getStatus(tPath); } catch (FileDoesNotExistException e) { throw new FileNotFoundException(e.getMessage()); } catch (AlluxioException e) { throw new IOException(e); } FileStatus ret = new FileStatus(fileStatus.getLength(), fileStatus.isFolder(), BLOCK_REPLICATION_CONSTANT, fileStatus.getBlockSizeBytes(), fileStatus.getCreationTimeMs(), fileStatus.getCreationTimeMs(), new FsPermission((short) fileStatus.getPermission()), fileStatus.getUserName(), fileStatus.getGroupName(), new Path(mAlluxioHeader + tPath)); return ret; }
request.setAttribute("invalidPathError", "Error: Invalid Path " + e.getMessage()); getServletContext().getRequestDispatcher("/browse.jsp").forward(request, response); } catch (InvalidPathException e) {
ListStatusOptions.defaults().setLoadMetadataType(LoadMetadataType.Always)); } catch (FileDoesNotExistException e) { request.setAttribute("invalidPathError", "Error: Invalid Path " + e.getMessage()); getServletContext().getRequestDispatcher("/browse.jsp").forward(request, response); return; "Error: non-existing file " + e.getMessage()); getServletContext().getRequestDispatcher("/browse.jsp").forward(request, response); return;
mFileSystem.rename(srcPath, dstPath); } catch (FileDoesNotExistException e) { LOG.warn("rename failed: {}", e.getMessage()); return false; } catch (AlluxioException e) {