PathCapabilities@Public @Evolving public class ViewFs extends AbstractFileSystem
To use viewfs one would typically set the default file system in the config (i.e. fs.defaultFS < = viewfs:///) along with the mount table config variables as described below.
** Config variables to specify the mount table entries **
The file system is initialized from the standard Hadoop config through
config variables.
See FsConstants for URI and Scheme constants;
See Constants for config var constants;
see ConfigUtil for convenient lib.
All the mount table config entries for view fs are prefixed by fs.viewfs.mounttable. For example the above example can be specified with the following config variables:
**** Merge Mounts **** (NOTE: merge mounts are not implemented yet.)
One can also use "MergeMounts" to merge several directories (this is sometimes called union-mounts or junction-mounts in the literature. For example of the home directories are stored on say two file systems (because they do not fit on one) then one could specify a mount entry such as following merges two dirs:
| Modifier and Type | Class | Description |
|---|---|---|
static class |
ViewFs.MountPoint |
statistics| Constructor | Description |
|---|---|
ViewFs(Configuration conf) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
access(Path path,
FsAction mode) |
The specification of this method matches that of
FileContext.access(Path, FsAction)
except that an UnresolvedLinkException may be thrown if a symlink is
encountered in the path. |
FSDataOutputStream |
createInternal(Path f,
java.util.EnumSet<CreateFlag> flag,
FsPermission absolutePermission,
int bufferSize,
short replication,
long blockSize,
Progressable progress,
Options.ChecksumOpt checksumOpt,
boolean createParent) |
The specification of this method matches that of
AbstractFileSystem.create(Path, EnumSet, Options.CreateOpts...) except that the opts
have been declared explicitly. |
Path |
createSnapshot(Path path,
java.lang.String snapshotName) |
The specification of this method matches that of
FileContext.createSnapshot(Path, String). |
void |
createSymlink(Path target,
Path link,
boolean createParent) |
The specification of this method matches that of
FileContext.createSymlink(Path, Path, boolean); |
boolean |
delete(Path f,
boolean recursive) |
The specification of this method matches that of
FileContext.delete(Path, boolean) except that Path f must be for
this file system. |
void |
deleteSnapshot(Path path,
java.lang.String snapshotName) |
The specification of this method matches that of
FileContext.deleteSnapshot(Path, String). |
AclStatus |
getAclStatus(Path path) |
Gets the ACLs of files and directories.
|
java.util.List<Token<?>> |
getDelegationTokens(java.lang.String renewer) |
Get one or more delegation tokens associated with the filesystem.
|
BlockLocation[] |
getFileBlockLocations(Path f,
long start,
long len) |
The specification of this method matches that of
FileContext.getFileBlockLocations(Path, long, long) except that
Path f must be for this file system. |
FileChecksum |
getFileChecksum(Path f) |
The specification of this method matches that of
FileContext.getFileChecksum(Path) except that Path f must be for
this file system. |
FileStatus |
getFileLinkStatus(Path f) |
The specification of this method matches that of
FileContext.getFileLinkStatus(Path)
except that an UnresolvedLinkException may be thrown if a symlink is
encountered in the path leading up to the final path component. |
FileStatus |
getFileStatus(Path f) |
The specification of this method matches that of
FileContext.getFileStatus(Path)
except that an UnresolvedLinkException may be thrown if a symlink is
encountered in the path. |
FsStatus |
getFsStatus() |
The specification of this method matches that of
FileContext.getFsStatus(Path). |
Path |
getHomeDirectory() |
Return the current user's home directory in this file system.
|
Path |
getLinkTarget(Path f) |
Partially resolves the path.
|
ViewFs.MountPoint[] |
getMountPoints() |
|
FsServerDefaults |
getServerDefaults() |
Deprecated.
|
FsServerDefaults |
getServerDefaults(Path f) |
Return a set of server default configuration values based on path.
|
BlockStoragePolicySpi |
getStoragePolicy(Path src) |
Retrieve the storage policy for a given file or directory.
|
int |
getUriDefaultPort() |
The default port of this file system.
|
byte[] |
getXAttr(Path path,
java.lang.String name) |
Get an xattr for a file or directory.
|
java.util.Map<java.lang.String,byte[]> |
getXAttrs(Path path) |
Get all of the xattrs for a file or directory.
|
java.util.Map<java.lang.String,byte[]> |
getXAttrs(Path path,
java.util.List<java.lang.String> names) |
Get all of the xattrs for a file or directory.
|
boolean |
isValidName(java.lang.String src) |
Returns true if the specified string is considered valid in the path part
of a URI by this file system.
|
RemoteIterator<LocatedFileStatus> |
listLocatedStatus(Path f) |
The specification of this method matches that of
FileContext.listLocatedStatus(Path) except that Path f
must be for this file system. |
FileStatus[] |
listStatus(Path f) |
The specification of this method matches that of
FileContext.Util.listStatus(Path) except that Path f must be
for this file system. |
RemoteIterator<FileStatus> |
listStatusIterator(Path f) |
The specification of this method matches that of
FileContext.listStatus(Path) except that Path f must be for this
file system. |
java.util.List<java.lang.String> |
listXAttrs(Path path) |
Get all of the xattr names for a file or directory.
|
void |
mkdir(Path dir,
FsPermission permission,
boolean createParent) |
The specification of this method matches that of
FileContext.mkdir(Path, FsPermission, boolean) except that the Path
f must be fully qualified and the permission is absolute (i.e. |
void |
modifyAclEntries(Path path,
java.util.List<AclEntry> aclSpec) |
Modifies ACL entries of files and directories.
|
FSDataInputStream |
open(Path f,
int bufferSize) |
The specification of this method matches that of
FileContext.open(Path, int) except that Path f must be for this
file system. |
void |
removeAcl(Path path) |
Removes all but the base ACL entries of files and directories.
|
void |
removeAclEntries(Path path,
java.util.List<AclEntry> aclSpec) |
Removes ACL entries from files and directories.
|
void |
removeDefaultAcl(Path path) |
Removes all default ACL entries from files and directories.
|
void |
removeXAttr(Path path,
java.lang.String name) |
Remove an xattr of a file or directory.
|
void |
renameInternal(Path src,
Path dst) |
The specification of this method matches that of
FileContext.rename(Path, Path, Options.Rename...) except that Path
f must be for this file system and NO OVERWRITE is performed. |
void |
renameInternal(Path src,
Path dst,
boolean overwrite) |
The specification of this method matches that of
FileContext.rename(Path, Path, Options.Rename...) except that Path
f must be for this file system. |
void |
renameSnapshot(Path path,
java.lang.String snapshotOldName,
java.lang.String snapshotNewName) |
The specification of this method matches that of
FileContext.renameSnapshot(Path, String, String). |
Path |
resolvePath(Path f) |
Return the fully-qualified path of path f resolving the path
through any internal symlinks or mount point
|
void |
satisfyStoragePolicy(Path path) |
Set the source path to satisfy storage policy.
|
void |
setAcl(Path path,
java.util.List<AclEntry> aclSpec) |
Fully replaces ACL of files and directories, discarding all existing
entries.
|
void |
setOwner(Path f,
java.lang.String username,
java.lang.String groupname) |
The specification of this method matches that of
FileContext.setOwner(Path, String, String) except that Path f must
be for this file system. |
void |
setPermission(Path f,
FsPermission permission) |
The specification of this method matches that of
FileContext.setPermission(Path, FsPermission) except that Path f
must be for this file system. |
boolean |
setReplication(Path f,
short replication) |
The specification of this method matches that of
FileContext.setReplication(Path, short) except that Path f must be
for this file system. |
void |
setStoragePolicy(Path path,
java.lang.String policyName) |
Set the storage policy for a given file or directory.
|
void |
setTimes(Path f,
long mtime,
long atime) |
The specification of this method matches that of
FileContext.setTimes(Path, long, long) except that Path f must be
for this file system. |
void |
setVerifyChecksum(boolean verifyChecksum) |
The specification of this method matches that of
FileContext.setVerifyChecksum(boolean, Path) except that Path f
must be for this file system. |
void |
setXAttr(Path path,
java.lang.String name,
byte[] value,
java.util.EnumSet<XAttrSetFlag> flag) |
Set an xattr of a file or directory.
|
boolean |
supportsSymlinks() |
Returns true if the file system supports symlinks, false otherwise.
|
boolean |
truncate(Path f,
long newLength) |
The specification of this method matches that of
FileContext.truncate(Path, long) except that Path f must be for
this file system. |
void |
unsetStoragePolicy(Path src) |
Unset the storage policy set for a given file or directory.
|
checkPath, checkScheme, clearStatistics, create, createFileSystem, createMultipartUploader, equals, get, getAllStatistics, getAllStoragePolicies, getCanonicalServiceName, getEnclosingRoot, getFsStatus, getInitialWorkingDirectory, getStatistics, getStatistics, getUri, getUriPath, hashCode, hasPathCapability, listCorruptFileBlocks, makeQualified, methodNotSupported, msync, open, openFileWithOptions, printStatistics, rename, setXAttrpublic ViewFs(Configuration conf) throws java.io.IOException, java.net.URISyntaxException
java.io.IOExceptionjava.net.URISyntaxException@Deprecated public FsServerDefaults getServerDefaults() throws java.io.IOException
AbstractFileSystemgetServerDefaults in class AbstractFileSystemjava.io.IOException - an I/O error occurredpublic FsServerDefaults getServerDefaults(Path f) throws java.io.IOException
AbstractFileSystemgetServerDefaults in class AbstractFileSystemf - path to fetch server defaultsjava.io.IOException - an I/O error occurredpublic int getUriDefaultPort()
AbstractFileSystemgetUriDefaultPort in class AbstractFileSystempublic Path getHomeDirectory()
AbstractFileSystemgetHomeDirectory in class AbstractFileSystempublic Path resolvePath(Path f) throws java.io.FileNotFoundException, AccessControlException, UnresolvedLinkException, java.io.IOException
AbstractFileSystemresolvePath in class AbstractFileSystemf - path to be resolvedjava.io.FileNotFoundException - when file not find throw.AccessControlException - when accees control error throw.UnresolvedLinkException - if symbolic link on path cannot be
resolved internallyjava.io.IOException - raised on errors performing I/O.public FSDataOutputStream createInternal(Path f, java.util.EnumSet<CreateFlag> flag, FsPermission absolutePermission, int bufferSize, short replication, long blockSize, Progressable progress, Options.ChecksumOpt checksumOpt, boolean createParent) throws AccessControlException, FileAlreadyExistsException, java.io.FileNotFoundException, ParentNotDirectoryException, UnsupportedFileSystemException, UnresolvedLinkException, java.io.IOException
AbstractFileSystemAbstractFileSystem.create(Path, EnumSet, Options.CreateOpts...) except that the opts
have been declared explicitly.createInternal in class AbstractFileSystemf - the path.flag - create flag.absolutePermission - absolute permission.bufferSize - buffer size.replication - replications.blockSize - block size.progress - progress.checksumOpt - check sum opt.createParent - create parent.AccessControlException - access control exception.FileAlreadyExistsException - file already exists exception.java.io.FileNotFoundException - file not found exception.ParentNotDirectoryException - parent not directory exception.UnsupportedFileSystemException - unsupported filesystem exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public boolean delete(Path f, boolean recursive) throws AccessControlException, java.io.FileNotFoundException, UnresolvedLinkException, java.io.IOException
AbstractFileSystemFileContext.delete(Path, boolean) except that Path f must be for
this file system.delete in class AbstractFileSystemf - the path.recursive - recursive flag.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public BlockLocation[] getFileBlockLocations(Path f, long start, long len) throws AccessControlException, java.io.FileNotFoundException, UnresolvedLinkException, java.io.IOException
AbstractFileSystemFileContext.getFileBlockLocations(Path, long, long) except that
Path f must be for this file system.getFileBlockLocations in class AbstractFileSystemf - the path.start - start.len - length.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public FileChecksum getFileChecksum(Path f) throws AccessControlException, java.io.FileNotFoundException, UnresolvedLinkException, java.io.IOException
AbstractFileSystemFileContext.getFileChecksum(Path) except that Path f must be for
this file system.getFileChecksum in class AbstractFileSystemf - the path.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public FileStatus getFileStatus(Path f) throws AccessControlException, java.io.FileNotFoundException, UnresolvedLinkException, java.io.IOException
FileContext.getFileStatus(Path)
except that an UnresolvedLinkException may be thrown if a symlink is
encountered in the path.
If the given path is a symlink(mount link), the path will be resolved to a
target path and it will get the resolved path's FileStatus object. It will
not be represented as a symlink and isDirectory API returns true if the
resolved path is a directory, false otherwise.getFileStatus in class AbstractFileSystemf - the path.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public void access(Path path, FsAction mode) throws AccessControlException, java.io.FileNotFoundException, UnresolvedLinkException, java.io.IOException
AbstractFileSystemFileContext.access(Path, FsAction)
except that an UnresolvedLinkException may be thrown if a symlink is
encountered in the path.access in class AbstractFileSystempath - the path.mode - fsaction mode.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public FileStatus getFileLinkStatus(Path f) throws AccessControlException, java.io.FileNotFoundException, UnsupportedFileSystemException, java.io.IOException
AbstractFileSystemFileContext.getFileLinkStatus(Path)
except that an UnresolvedLinkException may be thrown if a symlink is
encountered in the path leading up to the final path component.
If the file system does not support symlinks then the behavior is
equivalent to AbstractFileSystem.getFileStatus(Path).getFileLinkStatus in class AbstractFileSystemf - the path.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnsupportedFileSystemException - UnSupported File System Exception.java.io.IOException - raised on errors performing I/O.public FsStatus getFsStatus() throws AccessControlException, java.io.FileNotFoundException, java.io.IOException
AbstractFileSystemFileContext.getFsStatus(Path).getFsStatus in class AbstractFileSystemAccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.java.io.IOException - raised on errors performing I/O.public RemoteIterator<FileStatus> listStatusIterator(Path f) throws AccessControlException, java.io.FileNotFoundException, UnresolvedLinkException, java.io.IOException
AbstractFileSystemFileContext.listStatus(Path) except that Path f must be for this
file system.listStatusIterator in class AbstractFileSystemf - path.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public RemoteIterator<LocatedFileStatus> listLocatedStatus(Path f) throws AccessControlException, java.io.FileNotFoundException, UnresolvedLinkException, java.io.IOException
AbstractFileSystemFileContext.listLocatedStatus(Path) except that Path f
must be for this file system.
In HDFS implementation, the BlockLocation of returned LocatedFileStatus
will have different formats for replicated and erasure coded file. Please
refer to FileSystem.getFileBlockLocations(FileStatus, long, long)
for more details.listLocatedStatus in class AbstractFileSystemf - the path.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public FileStatus[] listStatus(Path f) throws AccessControlException, java.io.FileNotFoundException, UnresolvedLinkException, java.io.IOException
FileContext.Util.listStatus(Path) except that Path f must be
for this file system.
Note: listStatus considers listing from fallbackLink if available. If the
same directory path is present in configured mount path as well as in
fallback fs, then only the fallback path will be listed in the returned
result except for link.
If any of the the immediate children of the given path f is a symlink(mount
link), the returned FileStatus object of that children would be represented
as a symlink. It will not be resolved to the target path and will not get
the target path FileStatus object. The target path will be available via
getSymlink on that children's FileStatus object. Since it represents as
symlink, isDirectory on that children's FileStatus will return false.
This behavior can be changed by setting an advanced configuration
fs.viewfs.mount.links.as.symlinks to false. In this case, mount points will
be represented as non-symlinks and all the file/directory attributes like
permissions, isDirectory etc will be assigned from it's resolved target
directory/file.
If you want to get the FileStatus of target path for that children, you may
want to use GetFileStatus API with that children's symlink path. Please see
getFileStatus(Path f)
Note: In ViewFs, by default the mount links are represented as symlinks.listStatus in class AbstractFileSystemf - the path.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public void mkdir(Path dir, FsPermission permission, boolean createParent) throws AccessControlException, FileAlreadyExistsException, java.io.FileNotFoundException, UnresolvedLinkException, java.io.IOException
AbstractFileSystemFileContext.mkdir(Path, FsPermission, boolean) except that the Path
f must be fully qualified and the permission is absolute (i.e.
umask has been applied).mkdir in class AbstractFileSystemdir - directory.permission - permission.createParent - create parent flag.AccessControlException - access control exception.FileAlreadyExistsException - file already exists exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public FSDataInputStream open(Path f, int bufferSize) throws AccessControlException, java.io.FileNotFoundException, UnresolvedLinkException, java.io.IOException
AbstractFileSystemFileContext.open(Path, int) except that Path f must be for this
file system.open in class AbstractFileSystemf - the path.bufferSize - buffer size.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public boolean truncate(Path f, long newLength) throws AccessControlException, java.io.FileNotFoundException, UnresolvedLinkException, java.io.IOException
AbstractFileSystemFileContext.truncate(Path, long) except that Path f must be for
this file system.truncate in class AbstractFileSystemf - the path.newLength - new length.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public void renameInternal(Path src, Path dst, boolean overwrite) throws java.io.IOException, UnresolvedLinkException
AbstractFileSystemFileContext.rename(Path, Path, Options.Rename...) except that Path
f must be for this file system.renameInternal in class AbstractFileSystemsrc - src.dst - dst.overwrite - overwrite flag.AccessControlException - access control exception.FileAlreadyExistsException - file already exists exception.java.io.FileNotFoundException - file not found exception.ParentNotDirectoryException - parent not directory exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public void renameInternal(Path src, Path dst) throws AccessControlException, FileAlreadyExistsException, java.io.FileNotFoundException, ParentNotDirectoryException, UnresolvedLinkException, java.io.IOException
AbstractFileSystemFileContext.rename(Path, Path, Options.Rename...) except that Path
f must be for this file system and NO OVERWRITE is performed.
File systems that do not have a built in overwrite need implement only this
method and can take advantage of the default impl of the other
AbstractFileSystem.renameInternal(Path, Path, boolean)renameInternal in class AbstractFileSystemsrc - src.dst - dst.AccessControlException - access control exception.FileAlreadyExistsException - file already exists exception.java.io.FileNotFoundException - file not found exception.ParentNotDirectoryException - parent not directory exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public boolean supportsSymlinks()
AbstractFileSystemsupportsSymlinks in class AbstractFileSystempublic void createSymlink(Path target, Path link, boolean createParent) throws java.io.IOException, UnresolvedLinkException
AbstractFileSystemFileContext.createSymlink(Path, Path, boolean);createSymlink in class AbstractFileSystemtarget - target.link - link.createParent - create parent.java.io.IOException - raised on errors performing I/O.UnresolvedLinkException - unresolved link exception.public Path getLinkTarget(Path f) throws java.io.IOException
AbstractFileSystemFSLinkResolver, and differs from the similarly named method
FileContext.getLinkTarget(Path).getLinkTarget in class AbstractFileSystemf - the path.java.io.IOException - subclass implementations may throw IOExceptionpublic void setOwner(Path f, java.lang.String username, java.lang.String groupname) throws AccessControlException, java.io.FileNotFoundException, UnresolvedLinkException, java.io.IOException
AbstractFileSystemFileContext.setOwner(Path, String, String) except that Path f must
be for this file system.setOwner in class AbstractFileSystemf - the path.username - username.groupname - groupname.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public void setPermission(Path f, FsPermission permission) throws AccessControlException, java.io.FileNotFoundException, UnresolvedLinkException, java.io.IOException
AbstractFileSystemFileContext.setPermission(Path, FsPermission) except that Path f
must be for this file system.setPermission in class AbstractFileSystemf - the path.permission - permission.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public boolean setReplication(Path f, short replication) throws AccessControlException, java.io.FileNotFoundException, UnresolvedLinkException, java.io.IOException
AbstractFileSystemFileContext.setReplication(Path, short) except that Path f must be
for this file system.setReplication in class AbstractFileSystemf - the path.replication - replication.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public void setTimes(Path f, long mtime, long atime) throws AccessControlException, java.io.FileNotFoundException, UnresolvedLinkException, java.io.IOException
AbstractFileSystemFileContext.setTimes(Path, long, long) except that Path f must be
for this file system.setTimes in class AbstractFileSystemf - the path.mtime - modify time.atime - access time.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public void setVerifyChecksum(boolean verifyChecksum)
throws AccessControlException,
java.io.IOException
AbstractFileSystemFileContext.setVerifyChecksum(boolean, Path) except that Path f
must be for this file system.setVerifyChecksum in class AbstractFileSystemverifyChecksum - verify check sum flag.AccessControlException - access control exception.java.io.IOException - raised on errors performing I/O.public ViewFs.MountPoint[] getMountPoints()
public java.util.List<Token<?>> getDelegationTokens(java.lang.String renewer) throws java.io.IOException
AbstractFileSystemgetDelegationTokens in class AbstractFileSystemrenewer - the account name that is allowed to renew the token.java.io.IOException - raised on errors performing I/O.public boolean isValidName(java.lang.String src)
AbstractFileSystemisValidName in class AbstractFileSystemsrc - String source filename to check, path part of the URIpublic void modifyAclEntries(Path path, java.util.List<AclEntry> aclSpec) throws java.io.IOException
AbstractFileSystemmodifyAclEntries in class AbstractFileSystempath - Path to modifyaclSpec - List<AclEntry> describing modificationsjava.io.IOException - if an ACL could not be modifiedpublic void removeAclEntries(Path path, java.util.List<AclEntry> aclSpec) throws java.io.IOException
AbstractFileSystemremoveAclEntries in class AbstractFileSystempath - Path to modifyaclSpec - List<AclEntry> describing entries to removejava.io.IOException - if an ACL could not be modifiedpublic void removeDefaultAcl(Path path) throws java.io.IOException
AbstractFileSystemremoveDefaultAcl in class AbstractFileSystempath - Path to modifyjava.io.IOException - if an ACL could not be modifiedpublic void removeAcl(Path path) throws java.io.IOException
AbstractFileSystemremoveAcl in class AbstractFileSystempath - Path to modifyjava.io.IOException - if an ACL could not be removedpublic void setAcl(Path path, java.util.List<AclEntry> aclSpec) throws java.io.IOException
AbstractFileSystemsetAcl in class AbstractFileSystempath - Path to modifyaclSpec - List<AclEntry> describing modifications, must
include entries for user, group, and others for compatibility with
permission bits.java.io.IOException - if an ACL could not be modifiedpublic AclStatus getAclStatus(Path path) throws java.io.IOException
AbstractFileSystemgetAclStatus in class AbstractFileSystempath - Path to getjava.io.IOException - if an ACL could not be readpublic void setXAttr(Path path, java.lang.String name, byte[] value, java.util.EnumSet<XAttrSetFlag> flag) throws java.io.IOException
AbstractFileSystemRefer to the HDFS extended attributes user documentation for details.
setXAttr in class AbstractFileSystempath - Path to modifyname - xattr name.value - xattr value.flag - xattr set flagjava.io.IOException - raised on errors performing I/O.public byte[] getXAttr(Path path, java.lang.String name) throws java.io.IOException
AbstractFileSystemRefer to the HDFS extended attributes user documentation for details.
getXAttr in class AbstractFileSystempath - Path to get extended attributename - xattr name.java.io.IOException - raised on errors performing I/O.public java.util.Map<java.lang.String,byte[]> getXAttrs(Path path) throws java.io.IOException
AbstractFileSystemRefer to the HDFS extended attributes user documentation for details.
getXAttrs in class AbstractFileSystempath - Path to get extended attributesjava.io.IOException - raised on errors performing I/O.public java.util.Map<java.lang.String,byte[]> getXAttrs(Path path, java.util.List<java.lang.String> names) throws java.io.IOException
AbstractFileSystemRefer to the HDFS extended attributes user documentation for details.
getXAttrs in class AbstractFileSystempath - Path to get extended attributesnames - XAttr names.java.io.IOException - raised on errors performing I/O.public java.util.List<java.lang.String> listXAttrs(Path path) throws java.io.IOException
AbstractFileSystemRefer to the HDFS extended attributes user documentation for details.
listXAttrs in class AbstractFileSystempath - Path to get extended attributesjava.io.IOException - raised on errors performing I/O.public void removeXAttr(Path path, java.lang.String name) throws java.io.IOException
AbstractFileSystemRefer to the HDFS extended attributes user documentation for details.
removeXAttr in class AbstractFileSystempath - Path to remove extended attributename - xattr namejava.io.IOException - raised on errors performing I/O.public Path createSnapshot(Path path, java.lang.String snapshotName) throws java.io.IOException
AbstractFileSystemFileContext.createSnapshot(Path, String).createSnapshot in class AbstractFileSystempath - the path.snapshotName - snapshot name.java.io.IOException - raised on errors performing I/O.public void renameSnapshot(Path path, java.lang.String snapshotOldName, java.lang.String snapshotNewName) throws java.io.IOException
AbstractFileSystemFileContext.renameSnapshot(Path, String, String).renameSnapshot in class AbstractFileSystempath - the path.snapshotOldName - snapshot old name.snapshotNewName - snapshot new name.java.io.IOException - raised on errors performing I/O.public void deleteSnapshot(Path path, java.lang.String snapshotName) throws java.io.IOException
AbstractFileSystemFileContext.deleteSnapshot(Path, String).deleteSnapshot in class AbstractFileSystempath - snapshot dir.snapshotName - snapshot name.java.io.IOException - raised on errors performing I/O.public void satisfyStoragePolicy(Path path) throws java.io.IOException
AbstractFileSystemsatisfyStoragePolicy in class AbstractFileSystempath - The source path referring to either a directory or a file.java.io.IOException - raised on errors performing I/O.public void setStoragePolicy(Path path, java.lang.String policyName) throws java.io.IOException
AbstractFileSystemsetStoragePolicy in class AbstractFileSystempath - file or directory path.policyName - the name of the target storage policy. The list
of supported Storage policies can be retrieved
via AbstractFileSystem.getAllStoragePolicies().java.io.IOException - raised on errors performing I/O.public void unsetStoragePolicy(Path src) throws java.io.IOException
AbstractFileSystemunsetStoragePolicy in class AbstractFileSystemsrc - file or directory path.java.io.IOException - raised on errors performing I/O.public BlockStoragePolicySpi getStoragePolicy(Path src) throws java.io.IOException
getStoragePolicy in class AbstractFileSystemsrc - file or directory path.java.io.IOException - raised on errors performing I/O.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.