@InterfaceAudience.Public @InterfaceStability.Stable public class FilterFileSystem extends FileSystem
FilterFileSystem
contains
some other file system, which it uses as
its basic file system, possibly transforming
the data along the way or providing additional
functionality. The class FilterFileSystem
itself simply overrides all methods of
FileSystem
with versions that
pass all requests to the contained file
system. Subclasses of FilterFileSystem
may further override some of these methods
and may also provide additional methods
and fields.修飾子とタイプ | フィールドと説明 |
---|---|
protected FileSystem |
fs |
protected String |
swapScheme |
DEFAULT_FS, FS_DEFAULT_NAME_KEY, LOG, SHUTDOWN_HOOK_PRIORITY, statistics, TRASH_PREFIX
コンストラクタと説明 |
---|
FilterFileSystem() |
FilterFileSystem(FileSystem fs) |
修飾子とタイプ | メソッドと説明 |
---|---|
void |
access(Path path,
FsAction mode)
Checks if the user can access a path.
|
FSDataOutputStream |
append(Path f,
int bufferSize,
Progressable progress)
Append to an existing file (optional operation).
|
protected URI |
canonicalizeUri(URI uri)
Canonicalize the given URI.
|
protected void |
checkPath(Path path)
Check that a Path belongs to this FileSystem.
|
void |
close()
No more filesystem operations are needed.
|
void |
completeLocalOutput(Path fsOutputFile,
Path tmpLocalFile)
Called when we're all done writing to the target.
|
void |
concat(Path f,
Path[] psrcs)
Concat existing files together.
|
void |
copyFromLocalFile(boolean delSrc,
boolean overwrite,
Path[] srcs,
Path dst)
The src files are on the local disk.
|
void |
copyFromLocalFile(boolean delSrc,
boolean overwrite,
Path src,
Path dst)
The src file is on the local disk.
|
void |
copyFromLocalFile(boolean delSrc,
Path src,
Path dst)
The src file is on the local disk.
|
void |
copyToLocalFile(boolean delSrc,
Path src,
Path dst)
The src file is under FS, and the dst is on the local disk.
|
FSDataOutputStream |
create(Path f,
FsPermission permission,
boolean overwrite,
int bufferSize,
short replication,
long blockSize,
Progressable progress)
Create an FSDataOutputStream at the indicated Path with write-progress
reporting.
|
FSDataOutputStream |
create(Path f,
FsPermission permission,
EnumSet<CreateFlag> flags,
int bufferSize,
short replication,
long blockSize,
Progressable progress,
org.apache.hadoop.fs.Options.ChecksumOpt checksumOpt)
Create an FSDataOutputStream at the indicated Path with a custom
checksum option
|
FSDataOutputStream |
createNonRecursive(Path f,
FsPermission permission,
EnumSet<CreateFlag> flags,
int bufferSize,
short replication,
long blockSize,
Progressable progress)
Opens an FSDataOutputStream at the indicated Path with write-progress
reporting.
|
Path |
createSnapshot(Path path,
String snapshotName)
Create a snapshot
|
void |
createSymlink(Path target,
Path link,
boolean createParent)
|
boolean |
delete(Path f,
boolean recursive)
Delete a file
|
void |
deleteSnapshot(Path path,
String snapshotName)
Delete a snapshot of a directory
|
AclStatus |
getAclStatus(Path path)
Gets the ACL of a file or directory.
|
Collection<? extends BlockStoragePolicySpi> |
getAllStoragePolicies()
Retrieve all the storage policies supported by this file system.
|
protected URI |
getCanonicalUri()
Return a canonicalized form of this FileSystem's URI.
|
FileSystem[] |
getChildFileSystems()
Get all the immediate child FileSystems embedded in this FileSystem.
|
Configuration |
getConf()
Return the configuration used by this object.
|
long |
getDefaultBlockSize()
Return the number of bytes that large input files should be optimally
be split into to minimize i/o time.
|
long |
getDefaultBlockSize(Path f)
Return the number of bytes that large input files should be optimally
be split into to minimize i/o time.
|
short |
getDefaultReplication()
Get the default replication.
|
short |
getDefaultReplication(Path f)
Get the default replication for a path.
|
BlockLocation[] |
getFileBlockLocations(FileStatus file,
long start,
long len)
Return an array containing hostnames, offset and size of
portions of the given file.
|
FileChecksum |
getFileChecksum(Path f)
Get the checksum of a file.
|
FileChecksum |
getFileChecksum(Path f,
long length)
Get the checksum of a file, from the beginning of the file till the
specific length.
|
FileStatus |
getFileLinkStatus(Path f)
|
FileStatus |
getFileStatus(Path f)
Get file status.
|
Path |
getHomeDirectory()
Return the current user's home directory in this filesystem.
|
protected Path |
getInitialWorkingDirectory()
Note: with the new FilesContext class, getWorkingDirectory()
will be removed.
|
Path |
getLinkTarget(Path f)
|
FileSystem |
getRawFileSystem()
Get the raw file system
|
FsServerDefaults |
getServerDefaults()
Return a set of server default configuration values
|
FsServerDefaults |
getServerDefaults(Path f)
Return a set of server default configuration values
|
FsStatus |
getStatus(Path p)
Returns a status object describing the use and capacity of the
file system.
|
BlockStoragePolicySpi |
getStoragePolicy(Path src)
Query the effective storage policy ID for the given file or directory.
|
Path |
getTrashRoot(Path path)
Get the root directory of Trash for current user when the path specified
is deleted.
|
Collection<FileStatus> |
getTrashRoots(boolean allUsers)
Get all the trash roots for current user or all users.
|
URI |
getUri()
Returns a URI whose scheme and authority identify this FileSystem.
|
long |
getUsed()
Return the total size of all files in the filesystem.
|
long |
getUsed(Path path)
Return the total size of all files from a specified path.
|
Path |
getWorkingDirectory()
Get the current working directory for the given file system
|
byte[] |
getXAttr(Path path,
String name)
Get an xattr name and value for a file or directory.
|
Map<String,byte[]> |
getXAttrs(Path path)
Get all of the xattr name/value pairs for a file or directory.
|
Map<String,byte[]> |
getXAttrs(Path path,
List<String> names)
Get all of the xattrs name/value pairs for a file or directory.
|
void |
initialize(URI name,
Configuration conf)
Called after a new FileSystem instance is constructed.
|
org.apache.hadoop.fs.RemoteIterator<Path> |
listCorruptFileBlocks(Path path) |
org.apache.hadoop.fs.RemoteIterator<LocatedFileStatus> |
listLocatedStatus(Path f)
List files and its block locations in a directory.
|
protected org.apache.hadoop.fs.RemoteIterator<LocatedFileStatus> |
listLocatedStatus(Path f,
PathFilter filter)
Listing a directory
The returned results include its block location if it is a file
The results are filtered by the given path filter
|
FileStatus[] |
listStatus(Path f)
List files in a directory.
|
org.apache.hadoop.fs.RemoteIterator<FileStatus> |
listStatusIterator(Path f)
Return a remote iterator for listing in a directory
|
List<String> |
listXAttrs(Path path)
Get all of the xattr names for a file or directory.
|
Path |
makeQualified(Path path)
Make sure that a path specifies a FileSystem.
|
boolean |
mkdirs(Path f,
FsPermission permission)
Make the given file and all non-existent parents into
directories.
|
void |
modifyAclEntries(Path path,
List<AclEntry> aclSpec)
Modifies ACL entries of files and directories.
|
FSDataInputStream |
open(Path f,
int bufferSize)
Opens an FSDataInputStream at the indicated Path.
|
protected FSDataOutputStream |
primitiveCreate(Path f,
FsPermission absolutePermission,
EnumSet<CreateFlag> flag,
int bufferSize,
short replication,
long blockSize,
Progressable progress,
org.apache.hadoop.fs.Options.ChecksumOpt checksumOpt) |
protected boolean |
primitiveMkdir(Path f,
FsPermission abdolutePermission)
This version of the mkdirs method assumes that the permission is absolute.
|
void |
removeAcl(Path path)
Removes all but the base ACL entries of files and directories.
|
void |
removeAclEntries(Path path,
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,
String name)
Remove an xattr of a file or directory.
|
boolean |
rename(Path src,
Path dst)
Renames Path src to Path dst.
|
void |
renameSnapshot(Path path,
String snapshotOldName,
String snapshotNewName)
Rename a snapshot
|
protected Path |
resolveLink(Path f)
|
Path |
resolvePath(Path p)
Return the fully-qualified path of path f resolving the path
through any symlinks or mount point
|
void |
setAcl(Path path,
List<AclEntry> aclSpec)
Fully replaces ACL of files and directories, discarding all existing
entries.
|
void |
setOwner(Path p,
String username,
String groupname)
Set owner of a path (i.e. a file or a directory).
|
void |
setPermission(Path p,
FsPermission permission)
Set permission of a path.
|
boolean |
setReplication(Path src,
short replication)
Set replication for an existing file.
|
void |
setStoragePolicy(Path src,
String policyName)
Set the storage policy for a given file or directory.
|
void |
setTimes(Path p,
long mtime,
long atime)
Set access time of a file
|
void |
setVerifyChecksum(boolean verifyChecksum)
Set the verify checksum flag.
|
void |
setWorkingDirectory(Path newDir)
Set the current working directory for the given file system.
|
void |
setWriteChecksum(boolean writeChecksum)
Set the write checksum flag.
|
void |
setXAttr(Path path,
String name,
byte[] value)
Set an xattr of a file or directory.
|
void |
setXAttr(Path path,
String name,
byte[] value,
EnumSet<XAttrSetFlag> flag)
Set an xattr of a file or directory.
|
Path |
startLocalOutput(Path fsOutputFile,
Path tmpLocalFile)
Returns a local File that the user can write output to.
|
boolean |
supportsSymlinks()
|
boolean |
truncate(Path f,
long newLength)
Truncate the file in the indicated path to the indicated size.
|
void |
unsetStoragePolicy(Path src)
Unset the storage policy set for a given file or directory.
|
append, append, areSymlinksEnabled, cancelDeleteOnExit, clearStatistics, closeAll, closeAllForUGI, copyFromLocalFile, copyToLocalFile, copyToLocalFile, create, create, create, create, create, create, create, create, create, create, create, createNewFile, createNonRecursive, createNonRecursive, createSnapshot, delete, deleteOnExit, enableSymlinks, exists, fixRelativePart, get, get, get, getAllStatistics, getBlockSize, getContentSummary, getDefaultPort, getDefaultUri, getFileBlockLocations, getFileSystemClass, getFSofPath, getGlobalStorageStatistics, getLength, getLocal, getName, getNamed, getQuotaUsage, getReplication, getScheme, getStatistics, getStatistics, getStatus, getStorageStatistics, globStatus, globStatus, isDirectory, isFile, listFiles, listStatus, listStatus, listStatus, mkdirs, mkdirs, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, newInstance, newInstance, newInstance, newInstanceLocal, open, primitiveMkdir, printStatistics, processDeleteOnExit, rename, setDefaultUri, setDefaultUri
setConf
protected FileSystem fs
protected String swapScheme
public FilterFileSystem()
public FilterFileSystem(FileSystem fs)
public FileSystem getRawFileSystem()
public void initialize(URI name, Configuration conf) throws IOException
initialize
クラス内 FileSystem
name
- a uri whose authority section names the host, port, etc.
for this FileSystemconf
- the configurationIOException
public URI getUri()
getUri
クラス内 FileSystem
protected URI getCanonicalUri()
FileSystem
FileSystem.canonicalizeUri(URI)
on the filesystem's own URI, so subclasses typically only need to
implement that method.getCanonicalUri
クラス内 FileSystem
FileSystem.canonicalizeUri(URI)
protected URI canonicalizeUri(URI uri)
FileSystem
canonicalizeUri
クラス内 FileSystem
NetUtils.getCanonicalUri(URI, int)
public Path makeQualified(Path path)
makeQualified
クラス内 FileSystem
path
- to useprotected void checkPath(Path path)
checkPath
クラス内 FileSystem
path
- to checkpublic BlockLocation[] getFileBlockLocations(FileStatus file, long start, long len) throws IOException
FileSystem
getFileBlockLocations
クラス内 FileSystem
file
- FilesStatus to get data fromstart
- offset into the given filelen
- length for which to get locations forIOException
public Path resolvePath(Path p) throws IOException
FileSystem
resolvePath
クラス内 FileSystem
p
- path to be resolvedFileNotFoundException
IOException
public FSDataInputStream open(Path f, int bufferSize) throws IOException
open
クラス内 FileSystem
f
- the file name to openbufferSize
- the size of the buffer to be used.IOException
public FSDataOutputStream append(Path f, int bufferSize, Progressable progress) throws IOException
FileSystem
append
クラス内 FileSystem
f
- the existing file to be appended.bufferSize
- the size of the buffer to be used.progress
- for reporting progress if it is not null.IOException
public void concat(Path f, Path[] psrcs) throws IOException
FileSystem
concat
クラス内 FileSystem
f
- the path to the target destination.psrcs
- the paths to the sources to use for the concatenation.IOException
public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException
FileSystem
create
クラス内 FileSystem
f
- the file name to openpermission
- file permissionoverwrite
- if a file with this name already exists, then if true,
the file will be overwritten, and if false an error will be thrown.bufferSize
- the size of the buffer to be used.replication
- required block replication for the file.blockSize
- block sizeprogress
- the progress reporterIOException
FileSystem.setPermission(Path, FsPermission)
public FSDataOutputStream create(Path f, FsPermission permission, EnumSet<CreateFlag> flags, int bufferSize, short replication, long blockSize, Progressable progress, org.apache.hadoop.fs.Options.ChecksumOpt checksumOpt) throws IOException
FileSystem
create
クラス内 FileSystem
f
- the file name to openpermission
- file permissionflags
- CreateFlag
s to use for this stream.bufferSize
- the size of the buffer to be used.replication
- required block replication for the file.blockSize
- block sizeprogress
- the progress reporterchecksumOpt
- checksum parameter. If null, the values
found in conf will be used.IOException
FileSystem.setPermission(Path, FsPermission)
protected org.apache.hadoop.fs.RemoteIterator<LocatedFileStatus> listLocatedStatus(Path f, PathFilter filter) throws FileNotFoundException, IOException
FileSystem
listLocatedStatus
クラス内 FileSystem
f
- a pathfilter
- a path filterFileNotFoundException
- if f
does not existIOException
- if any I/O error occurredpublic FSDataOutputStream createNonRecursive(Path f, FsPermission permission, EnumSet<CreateFlag> flags, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException
FileSystem
createNonRecursive
クラス内 FileSystem
f
- the file name to openpermission
- file permissionflags
- CreateFlag
s to use for this stream.bufferSize
- the size of the buffer to be used.replication
- required block replication for the file.blockSize
- block sizeprogress
- the progress reporterIOException
FileSystem.setPermission(Path, FsPermission)
public boolean setReplication(Path src, short replication) throws IOException
setReplication
クラス内 FileSystem
src
- file namereplication
- new replicationIOException
public boolean rename(Path src, Path dst) throws IOException
rename
クラス内 FileSystem
src
- path to be renameddst
- new path after renameIOException
- on failurepublic boolean truncate(Path f, long newLength) throws IOException
FileSystem
truncate
クラス内 FileSystem
f
- The path to the file to be truncatednewLength
- The size the file is to be truncated totrue
if the file has been truncated to the desired
newLength
and is immediately available to be reused for
write operations such as append
, or
false
if a background process of adjusting the length of
the last block has been started, and clients should wait for it to
complete before proceeding with further file updates.IOException
public boolean delete(Path f, boolean recursive) throws IOException
delete
クラス内 FileSystem
f
- the path to delete.recursive
- if path is a directory and set to
true, the directory is deleted else throws an exception. In
case of a file the recursive can be set to either true or false.IOException
public FileStatus[] listStatus(Path f) throws IOException
listStatus
クラス内 FileSystem
f
- given pathFileNotFoundException
- when the path does not exist;
IOException see specific implementationIOException
public org.apache.hadoop.fs.RemoteIterator<Path> listCorruptFileBlocks(Path path) throws IOException
listCorruptFileBlocks
クラス内 FileSystem
IOException
public org.apache.hadoop.fs.RemoteIterator<LocatedFileStatus> listLocatedStatus(Path f) throws IOException
listLocatedStatus
クラス内 FileSystem
f
- is the pathFileNotFoundException
- If f
does not existIOException
- If an I/O error occurredpublic org.apache.hadoop.fs.RemoteIterator<FileStatus> listStatusIterator(Path f) throws IOException
listStatusIterator
クラス内 FileSystem
f
- target pathIOException
public Path getHomeDirectory()
FileSystem
getHomeDirectory
クラス内 FileSystem
public void setWorkingDirectory(Path newDir)
setWorkingDirectory
クラス内 FileSystem
newDir
- public Path getWorkingDirectory()
getWorkingDirectory
クラス内 FileSystem
protected Path getInitialWorkingDirectory()
FileSystem
getInitialWorkingDirectory
クラス内 FileSystem
public FsStatus getStatus(Path p) throws IOException
FileSystem
getStatus
クラス内 FileSystem
p
- Path for which status should be obtained. null means
the default partition.IOException
- see specific implementationpublic boolean mkdirs(Path f, FsPermission permission) throws IOException
FileSystem
mkdirs
クラス内 FileSystem
f
- path to createpermission
- to apply to fIOException
public void copyFromLocalFile(boolean delSrc, Path src, Path dst) throws IOException
copyFromLocalFile
クラス内 FileSystem
delSrc
- whether to delete the srcsrc
- pathdst
- pathIOException
public void copyFromLocalFile(boolean delSrc, boolean overwrite, Path[] srcs, Path dst) throws IOException
copyFromLocalFile
クラス内 FileSystem
delSrc
- whether to delete the srcoverwrite
- whether to overwrite an existing filesrcs
- array of paths which are sourcedst
- pathIOException
public void copyFromLocalFile(boolean delSrc, boolean overwrite, Path src, Path dst) throws IOException
copyFromLocalFile
クラス内 FileSystem
delSrc
- whether to delete the srcoverwrite
- whether to overwrite an existing filesrc
- pathdst
- pathIOException
public void copyToLocalFile(boolean delSrc, Path src, Path dst) throws IOException
copyToLocalFile
クラス内 FileSystem
delSrc
- whether to delete the srcsrc
- pathdst
- pathIOException
public Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile) throws IOException
startLocalOutput
クラス内 FileSystem
fsOutputFile
- path of output filetmpLocalFile
- path of local tmp fileIOException
public void completeLocalOutput(Path fsOutputFile, Path tmpLocalFile) throws IOException
completeLocalOutput
クラス内 FileSystem
fsOutputFile
- path of output filetmpLocalFile
- path to local tmp fileIOException
public long getUsed() throws IOException
getUsed
クラス内 FileSystem
IOException
public long getUsed(Path path) throws IOException
getUsed
クラス内 FileSystem
IOException
public long getDefaultBlockSize()
FileSystem
getDefaultBlockSize
クラス内 FileSystem
public short getDefaultReplication()
FileSystem
getDefaultReplication
クラス内 FileSystem
public FsServerDefaults getServerDefaults() throws IOException
FileSystem
getServerDefaults
クラス内 FileSystem
IOException
public long getDefaultBlockSize(Path f)
FileSystem
getDefaultBlockSize
クラス内 FileSystem
f
- path of filepublic short getDefaultReplication(Path f)
FileSystem
getDefaultReplication
クラス内 FileSystem
f
- of the filepublic FsServerDefaults getServerDefaults(Path f) throws IOException
FileSystem
getServerDefaults
クラス内 FileSystem
f
- path is used to identify an FS since an FS could have
another FS that it could be delegating the call toIOException
public FileStatus getFileStatus(Path f) throws IOException
getFileStatus
クラス内 FileSystem
f
- The path we want information fromFileNotFoundException
- when the path does not exist;
IOException see specific implementationIOException
public void access(Path path, FsAction mode) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, IOException
FileSystem
AccessControlException
.
The default implementation of this method calls FileSystem.getFileStatus(Path)
and checks the returned permissions against the requested permissions.
Note that the getFileStatus call will be subject to authorization checks.
Typically, this requires search (execute) permissions on each directory in
the path's prefix, but this is implementation-defined. Any file system
that provides a richer authorization model (such as ACLs) may override the
default implementation so that it checks against that model instead.
In general, applications should avoid using this method, due to the risk of
time-of-check/time-of-use race conditions. The permissions on a file may
change immediately after the access call returns. Most applications should
prefer running specific file system actions as the desired user represented
by a UserGroupInformation
.
path
- Path to checkmode
- type of access to checkorg.apache.hadoop.security.AccessControlException
- if access is deniedFileNotFoundException
- if the path does not existIOException
- see specific implementationpublic void createSymlink(Path target, Path link, boolean createParent) throws org.apache.hadoop.security.AccessControlException, FileAlreadyExistsException, FileNotFoundException, ParentNotDirectoryException, UnsupportedFileSystemException, IOException
FileSystem
createSymlink
クラス内 FileSystem
org.apache.hadoop.security.AccessControlException
FileAlreadyExistsException
FileNotFoundException
ParentNotDirectoryException
UnsupportedFileSystemException
IOException
public FileStatus getFileLinkStatus(Path f) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, UnsupportedFileSystemException, IOException
FileSystem
getFileLinkStatus
クラス内 FileSystem
org.apache.hadoop.security.AccessControlException
FileNotFoundException
UnsupportedFileSystemException
IOException
public boolean supportsSymlinks()
FileSystem
supportsSymlinks
クラス内 FileSystem
public Path getLinkTarget(Path f) throws IOException
FileSystem
getLinkTarget
クラス内 FileSystem
IOException
protected Path resolveLink(Path f) throws IOException
FileSystem
resolveLink
クラス内 FileSystem
IOException
public FileChecksum getFileChecksum(Path f) throws IOException
FileSystem
getFileChecksum
クラス内 FileSystem
f
- The file pathIOException
public FileChecksum getFileChecksum(Path f, long length) throws IOException
FileSystem
getFileChecksum
クラス内 FileSystem
f
- The file pathlength
- The length of the file range for checksum calculationIOException
public void setVerifyChecksum(boolean verifyChecksum)
FileSystem
setVerifyChecksum
クラス内 FileSystem
verifyChecksum
- Verify checksum flagpublic void setWriteChecksum(boolean writeChecksum)
FileSystem
setWriteChecksum
クラス内 FileSystem
writeChecksum
- Write checsum flagpublic Configuration getConf()
Configurable
getConf
インタフェース内 Configurable
getConf
クラス内 Configured
public void close() throws IOException
FileSystem
close
インタフェース内 Closeable
close
インタフェース内 AutoCloseable
close
クラス内 FileSystem
IOException
public void setOwner(Path p, String username, String groupname) throws IOException
FileSystem
setOwner
クラス内 FileSystem
p
- The pathusername
- If it is null, the original username remains unchanged.groupname
- If it is null, the original groupname remains unchanged.IOException
public void setTimes(Path p, long mtime, long atime) throws IOException
FileSystem
setTimes
クラス内 FileSystem
p
- The pathmtime
- Set the modification time of this file.
The number of milliseconds since Jan 1, 1970.
A value of -1 means that this call should not set modification time.atime
- Set the access time of this file.
The number of milliseconds since Jan 1, 1970.
A value of -1 means that this call should not set access time.IOException
public void setPermission(Path p, FsPermission permission) throws IOException
FileSystem
setPermission
クラス内 FileSystem
p
- The pathpermission
- permissionIOException
protected FSDataOutputStream primitiveCreate(Path f, FsPermission absolutePermission, EnumSet<CreateFlag> flag, int bufferSize, short replication, long blockSize, Progressable progress, org.apache.hadoop.fs.Options.ChecksumOpt checksumOpt) throws IOException
primitiveCreate
クラス内 FileSystem
IOException
protected boolean primitiveMkdir(Path f, FsPermission abdolutePermission) throws IOException
FileSystem
primitiveMkdir
クラス内 FileSystem
IOException
public FileSystem[] getChildFileSystems()
FileSystem
public Path createSnapshot(Path path, String snapshotName) throws IOException
FileSystem
createSnapshot
クラス内 FileSystem
path
- The directory where snapshots will be taken.snapshotName
- The name of the snapshotIOException
public void renameSnapshot(Path path, String snapshotOldName, String snapshotNewName) throws IOException
FileSystem
renameSnapshot
クラス内 FileSystem
path
- The directory path where the snapshot was takensnapshotOldName
- Old name of the snapshotsnapshotNewName
- New name of the snapshotIOException
public void deleteSnapshot(Path path, String snapshotName) throws IOException
FileSystem
deleteSnapshot
クラス内 FileSystem
path
- The directory that the to-be-deleted snapshot belongs tosnapshotName
- The name of the snapshotIOException
public void modifyAclEntries(Path path, List<AclEntry> aclSpec) throws IOException
FileSystem
modifyAclEntries
クラス内 FileSystem
path
- Path to modifyaclSpec
- ListIOException
- if an ACL could not be modifiedpublic void removeAclEntries(Path path, List<AclEntry> aclSpec) throws IOException
FileSystem
removeAclEntries
クラス内 FileSystem
path
- Path to modifyaclSpec
- ListIOException
- if an ACL could not be modifiedpublic void removeDefaultAcl(Path path) throws IOException
FileSystem
removeDefaultAcl
クラス内 FileSystem
path
- Path to modifyIOException
- if an ACL could not be modifiedpublic void removeAcl(Path path) throws IOException
FileSystem
removeAcl
クラス内 FileSystem
path
- Path to modifyIOException
- if an ACL could not be removedpublic void setAcl(Path path, List<AclEntry> aclSpec) throws IOException
FileSystem
setAcl
クラス内 FileSystem
path
- Path to modifyaclSpec
- ListIOException
- if an ACL could not be modifiedpublic AclStatus getAclStatus(Path path) throws IOException
FileSystem
getAclStatus
クラス内 FileSystem
path
- Path to getIOException
- if an ACL could not be readpublic void setXAttr(Path path, String name, byte[] value) throws IOException
FileSystem
setXAttr
クラス内 FileSystem
path
- Path to modifyname
- xattr name.value
- xattr value.IOException
public void setXAttr(Path path, String name, byte[] value, EnumSet<XAttrSetFlag> flag) throws IOException
FileSystem
setXAttr
クラス内 FileSystem
path
- Path to modifyname
- xattr name.value
- xattr value.flag
- xattr set flagIOException
public byte[] getXAttr(Path path, String name) throws IOException
FileSystem
getXAttr
クラス内 FileSystem
path
- Path to get extended attributename
- xattr name.IOException
public Map<String,byte[]> getXAttrs(Path path) throws IOException
FileSystem
getXAttrs
クラス内 FileSystem
path
- Path to get extended attributesIOException
public Map<String,byte[]> getXAttrs(Path path, List<String> names) throws IOException
FileSystem
getXAttrs
クラス内 FileSystem
path
- Path to get extended attributesnames
- XAttr names.IOException
public List<String> listXAttrs(Path path) throws IOException
FileSystem
listXAttrs
クラス内 FileSystem
path
- Path to get extended attributesIOException
public void removeXAttr(Path path, String name) throws IOException
FileSystem
removeXAttr
クラス内 FileSystem
path
- Path to remove extended attributename
- xattr nameIOException
public void setStoragePolicy(Path src, String policyName) throws IOException
FileSystem
setStoragePolicy
クラス内 FileSystem
src
- file or directory path.policyName
- the name of the target storage policy. The list
of supported Storage policies can be retrieved
via FileSystem.getAllStoragePolicies()
.IOException
public void unsetStoragePolicy(Path src) throws IOException
FileSystem
unsetStoragePolicy
クラス内 FileSystem
src
- file or directory path.IOException
public BlockStoragePolicySpi getStoragePolicy(Path src) throws IOException
FileSystem
getStoragePolicy
クラス内 FileSystem
src
- file or directory path.IOException
public Collection<? extends BlockStoragePolicySpi> getAllStoragePolicies() throws IOException
FileSystem
getAllStoragePolicies
クラス内 FileSystem
IOException
public Path getTrashRoot(Path path)
FileSystem
getTrashRoot
クラス内 FileSystem
path
- the trash root of the path to be determined.public Collection<FileStatus> getTrashRoots(boolean allUsers)
FileSystem
getTrashRoots
クラス内 FileSystem
allUsers
- return trash roots for all users if true.Copyright © 2016 Apache Software Foundation. All rights reserved.