} else if (!cur.getName().endsWith(Constants.S3_MULTIPART_TEMPORARY_DIR_SUFFIX)) {
break; case 'N': resp = status.getName(); break; case 'Y':
for (URIStatus status : statuses) { try { File subDstFile = new File(dstFile.getAbsolutePath(), status.getName()); copyToLocal( new AlluxioURI(srcPath.getScheme(), srcPath.getAuthority(), status.getPath()),
/** * Reads the contents of a directory. * * @param path The FS path of the directory * @param buff The FUSE buffer to fill * @param filter FUSE filter * @param offset Ignored in alluxio-fuse * @param fi FileInfo data structure kept by FUSE * @return 0 on success, a negative value on error */ @Override public int readdir(String path, Pointer buff, FuseFillDir filter, @off_t long offset, FuseFileInfo fi) { final AlluxioURI turi = mPathResolverCache.getUnchecked(path); LOG.trace("readdir({}) [Alluxio: {}]", path, turi); try { final List<URIStatus> ls = mFileSystem.listStatus(turi); // standard . and .. entries filter.apply(buff, ".", null, 0); filter.apply(buff, "..", null, 0); for (final URIStatus file : ls) { filter.apply(buff, file.getName(), null, 0); } } catch (Throwable t) { LOG.error("Failed to read directory {}", path, t); return AlluxioFuseUtils.getErrorCode(t); } return 0; }
/** * @param status the status of the part file * @return the {@link Part} parsed from the status */ public static Part fromURIStatus(URIStatus status) { Part result = new Part(); result.setPartNumber(Integer.parseInt(status.getName())); result.setLastModified(S3RestUtils.toS3Date(status.getLastModificationTimeMs())); result.setSize(status.getLength()); return result; }
@Override public FileInStream openFile(AlluxioURI path, OpenFilePOptions options) throws FileDoesNotExistException, IOException, AlluxioException { checkUri(path); URIStatus status = getStatus(path); if (status.isFolder()) { throw new FileDoesNotExistException( ExceptionMessage.CANNOT_READ_DIRECTORY.getMessage(status.getName())); } InStreamOptions inStreamOptions = new InStreamOptions(status, options, mFsContext.getConf()); return new FileInStream(status, inStreamOptions, mFsContext); }
copy(new AlluxioURI(srcPath.getScheme(), srcPath.getAuthority(), status.getPath()), new AlluxioURI(dstPath.getScheme(), dstPath.getAuthority(), PathUtils.concatPath(dstPath.getPath(), status.getName())), recursive); } catch (IOException e) { errorMessages.add(e.getMessage());
/** * Creates a new instance of {@link alluxio.util.webui.UIFileInfo}. * * @param status underlying {@link URIStatus} */ public UIFileInfo(URIStatus status) { // detect the extended acls boolean hasExtended = status.getAcl().hasExtended() || !status.getDefaultAcl().isEmpty(); mId = status.getFileId(); mName = status.getName(); mAbsolutePath = status.getPath(); mBlockSizeBytes = status.getBlockSizeBytes(); mSize = status.getLength(); mCreationTimeMs = status.getCreationTimeMs(); mLastModificationTimeMs = status.getLastModificationTimeMs(); mInAlluxio = (100 == status.getInAlluxioPercentage()); mInAlluxioPercentage = status.getInAlluxioPercentage(); mIsDirectory = status.isFolder(); mPinned = status.isPinned(); mOwner = status.getOwner(); mGroup = status.getGroup(); mMode = FormatUtils.formatMode((short) status.getMode(), status.isFolder(), hasExtended); mPersistenceState = status.getPersistenceState(); mFileLocations = new ArrayList<>(); }
fileInfo.getLastModificationTimeMs()); Assert.assertEquals(uriStatus.getLength(), fileInfo.getLength()); Assert.assertEquals(uriStatus.getName(), fileInfo.getName()); Assert.assertEquals(uriStatus.getPath(), fileInfo.getPath()); Assert.assertEquals(uriStatus.getMode(), fileInfo.getMode());
} else if (!cur.getName().endsWith(Constants.S3_MULTIPART_TEMPORARY_DIR_SUFFIX)) {
@Override public FileInStream openFile(AlluxioURI path, OpenFileOptions options) throws FileDoesNotExistException, IOException, AlluxioException { URIStatus status = getStatus(path); if (status.isFolder()) { throw new FileNotFoundException( ExceptionMessage.CANNOT_READ_DIRECTORY.getMessage(status.getName())); } return new FileInStream(status, options.toInStreamOptions()); }
/** * @param status the status of the part file * @return the {@link Part} parsed from the status */ public static Part fromURIStatus(URIStatus status) { Part result = new Part(); result.setPartNumber(Integer.parseInt(status.getName())); result.setLastModified(S3RestUtils.toS3Date(status.getLastModificationTimeMs())); result.setSize(status.getLength()); return result; }
/** * Creates a new instance of {@link UIFileInfo}. * * @param status underlying {@link URIStatus} */ public UIFileInfo(URIStatus status) { mId = status.getFileId(); mName = status.getName(); mAbsolutePath = status.getPath(); mBlockSizeBytes = status.getBlockSizeBytes(); mSize = status.getLength(); mCreationTimeMs = status.getCreationTimeMs(); mLastModificationTimeMs = status.getLastModificationTimeMs(); mInAlluxio = (100 == status.getInAlluxioPercentage()); mInAlluxioPercentage = status.getInAlluxioPercentage(); mIsDirectory = status.isFolder(); mPinned = status.isPinned(); mOwner = status.getOwner(); mGroup = status.getGroup(); mMode = FormatUtils.formatMode((short) status.getMode(), status.isFolder()); mPersistenceState = status.getPersistenceState(); mFileLocations = new ArrayList<>(); }