@InterfaceAudience.Private @InterfaceStability.Evolving public abstract class FilterFs extends AbstractFileSystem
FilterFs
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 FilterFs
itself simply
overrides all methods of AbstractFileSystem
with versions that
pass all requests to the contained file system. Subclasses of
FilterFs
may further override some of these methods and may also
provide additional methods and fields.statistics
Modifier | Constructor and Description |
---|---|
protected |
FilterFs(AbstractFileSystem fs) |
Modifier and Type | Method and Description |
---|---|
void |
checkPath(Path path)
Check that a Path belongs to this FileSystem.
|
FSDataOutputStream |
createInternal(Path f,
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. |
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. |
String |
getCanonicalServiceName()
Get a canonical name for this file system.
|
List<Token<?>> |
getDelegationTokens(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) . |
FsStatus |
getFsStatus(Path f)
The specification of this method matches that of
FileContext.getFsStatus(Path) except that Path f must be for this
file system. |
Path |
getHomeDirectory()
Return the current user's home directory in this file system.
|
Path |
getInitialWorkingDirectory()
Some file systems like LocalFileSystem have an initial workingDir
that is used as the starting workingDir.
|
Path |
getLinkTarget(Path f)
Partially resolves the path.
|
protected AbstractFileSystem |
getMyFs() |
FsServerDefaults |
getServerDefaults()
Return a set of server default configuration values.
|
FileSystem.Statistics |
getStatistics() |
URI |
getUri()
Returns a URI whose scheme and authority identify this FileSystem.
|
int |
getUriDefaultPort()
The default port of this file system.
|
String |
getUriPath(Path p)
Get the path-part of a pathname.
|
boolean |
isValidName(String src)
Returns true if the specified string is considered valid in the path part
of a URI by this file system.
|
RemoteIterator<Path> |
listCorruptFileBlocks(Path path) |
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. |
Path |
makeQualified(Path path)
Make the path fully qualified to this file system
|
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. |
FSDataInputStream |
open(Path f)
The specification of this method matches that of
FileContext.open(Path) except that Path f must be for this
file system. |
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 |
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. |
Path |
resolvePath(Path p)
Return the fully-qualified path of path f resolving the path
through any internal symlinks or mount point
|
void |
setOwner(Path f,
String username,
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 |
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. |
boolean |
supportsSymlinks()
Returns true if the file system supports symlinks, false otherwise.
|
checkScheme, clearStatistics, create, createFileSystem, equals, get, getAllStatistics, getStatistics, hashCode, listLocatedStatus, listStatusIterator, printStatistics, rename
protected FilterFs(AbstractFileSystem fs) throws IOException, URISyntaxException
IOException
URISyntaxException
protected AbstractFileSystem getMyFs()
public FileSystem.Statistics getStatistics()
getStatistics
in class AbstractFileSystem
public Path makeQualified(Path path)
AbstractFileSystem
makeQualified
in class AbstractFileSystem
public Path getInitialWorkingDirectory()
AbstractFileSystem
getInitialWorkingDirectory
in class AbstractFileSystem
public Path getHomeDirectory()
AbstractFileSystem
getHomeDirectory
in class AbstractFileSystem
public FSDataOutputStream createInternal(Path f, EnumSet<CreateFlag> flag, FsPermission absolutePermission, int bufferSize, short replication, long blockSize, Progressable progress, Options.ChecksumOpt checksumOpt, boolean createParent) throws IOException, UnresolvedLinkException
AbstractFileSystem
AbstractFileSystem.create(Path, EnumSet, Options.CreateOpts...)
except that the opts
have been declared explicitly.createInternal
in class AbstractFileSystem
IOException
UnresolvedLinkException
public boolean delete(Path f, boolean recursive) throws IOException, UnresolvedLinkException
AbstractFileSystem
FileContext.delete(Path, boolean)
except that Path f must be for
this file system.delete
in class AbstractFileSystem
IOException
UnresolvedLinkException
public BlockLocation[] getFileBlockLocations(Path f, long start, long len) throws IOException, UnresolvedLinkException
AbstractFileSystem
FileContext.getFileBlockLocations(Path, long, long)
except that
Path f must be for this file system.getFileBlockLocations
in class AbstractFileSystem
IOException
UnresolvedLinkException
public FileChecksum getFileChecksum(Path f) throws IOException, UnresolvedLinkException
AbstractFileSystem
FileContext.getFileChecksum(Path)
except that Path f must be for
this file system.getFileChecksum
in class AbstractFileSystem
IOException
UnresolvedLinkException
public FileStatus getFileStatus(Path f) throws IOException, UnresolvedLinkException
AbstractFileSystem
FileContext.getFileStatus(Path)
except that an UnresolvedLinkException may be thrown if a symlink is
encountered in the path.getFileStatus
in class AbstractFileSystem
IOException
UnresolvedLinkException
public FileStatus getFileLinkStatus(Path f) throws IOException, UnresolvedLinkException
AbstractFileSystem
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.
If the file system does not support symlinks then the behavior is
equivalent to AbstractFileSystem.getFileStatus(Path)
.getFileLinkStatus
in class AbstractFileSystem
IOException
UnresolvedLinkException
public FsStatus getFsStatus(Path f) throws AccessControlException, FileNotFoundException, UnresolvedLinkException, IOException
AbstractFileSystem
FileContext.getFsStatus(Path)
except that Path f must be for this
file system.getFsStatus
in class AbstractFileSystem
AccessControlException
FileNotFoundException
UnresolvedLinkException
IOException
public FsStatus getFsStatus() throws IOException
AbstractFileSystem
FileContext.getFsStatus(Path)
.getFsStatus
in class AbstractFileSystem
IOException
public FsServerDefaults getServerDefaults() throws IOException
AbstractFileSystem
getServerDefaults
in class AbstractFileSystem
IOException
- an I/O error occurredpublic Path resolvePath(Path p) throws FileNotFoundException, UnresolvedLinkException, AccessControlException, IOException
AbstractFileSystem
resolvePath
in class AbstractFileSystem
p
- path to be resolvedFileNotFoundException
UnresolvedLinkException
AccessControlException
IOException
public int getUriDefaultPort()
AbstractFileSystem
getUriDefaultPort
in class AbstractFileSystem
public URI getUri()
AbstractFileSystem
getUri
in class AbstractFileSystem
public void checkPath(Path path)
AbstractFileSystem
checkPath
in class AbstractFileSystem
public String getUriPath(Path p)
AbstractFileSystem
getUriPath
in class AbstractFileSystem
p
- pathpublic FileStatus[] listStatus(Path f) throws IOException, UnresolvedLinkException
AbstractFileSystem
FileContext.Util.listStatus(Path)
except that Path f must be
for this file system.listStatus
in class AbstractFileSystem
IOException
UnresolvedLinkException
public RemoteIterator<Path> listCorruptFileBlocks(Path path) throws IOException
listCorruptFileBlocks
in class AbstractFileSystem
IOException
public void mkdir(Path dir, FsPermission permission, boolean createParent) throws IOException, UnresolvedLinkException
AbstractFileSystem
FileContext.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 AbstractFileSystem
IOException
UnresolvedLinkException
public FSDataInputStream open(Path f) throws AccessControlException, FileNotFoundException, UnresolvedLinkException, IOException
AbstractFileSystem
FileContext.open(Path)
except that Path f must be for this
file system.open
in class AbstractFileSystem
AccessControlException
FileNotFoundException
UnresolvedLinkException
IOException
public FSDataInputStream open(Path f, int bufferSize) throws IOException, UnresolvedLinkException
AbstractFileSystem
FileContext.open(Path, int)
except that Path f must be for this
file system.open
in class AbstractFileSystem
IOException
UnresolvedLinkException
public void renameInternal(Path src, Path dst) throws IOException, UnresolvedLinkException
AbstractFileSystem
FileContext.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 AbstractFileSystem
IOException
UnresolvedLinkException
public void renameInternal(Path src, Path dst, boolean overwrite) throws AccessControlException, FileAlreadyExistsException, FileNotFoundException, ParentNotDirectoryException, UnresolvedLinkException, IOException
AbstractFileSystem
FileContext.rename(Path, Path, Options.Rename...)
except that Path
f must be for this file system.public void setOwner(Path f, String username, String groupname) throws IOException, UnresolvedLinkException
AbstractFileSystem
FileContext.setOwner(Path, String, String)
except that Path f must
be for this file system.setOwner
in class AbstractFileSystem
IOException
UnresolvedLinkException
public void setPermission(Path f, FsPermission permission) throws IOException, UnresolvedLinkException
AbstractFileSystem
FileContext.setPermission(Path, FsPermission)
except that Path f
must be for this file system.setPermission
in class AbstractFileSystem
IOException
UnresolvedLinkException
public boolean setReplication(Path f, short replication) throws IOException, UnresolvedLinkException
AbstractFileSystem
FileContext.setReplication(Path, short)
except that Path f must be
for this file system.setReplication
in class AbstractFileSystem
IOException
UnresolvedLinkException
public void setTimes(Path f, long mtime, long atime) throws IOException, UnresolvedLinkException
AbstractFileSystem
FileContext.setTimes(Path, long, long)
except that Path f must be
for this file system.setTimes
in class AbstractFileSystem
IOException
UnresolvedLinkException
public void setVerifyChecksum(boolean verifyChecksum) throws IOException, UnresolvedLinkException
AbstractFileSystem
FileContext.setVerifyChecksum(boolean, Path)
except that Path f
must be for this file system.setVerifyChecksum
in class AbstractFileSystem
IOException
UnresolvedLinkException
public boolean supportsSymlinks()
AbstractFileSystem
supportsSymlinks
in class AbstractFileSystem
public void createSymlink(Path target, Path link, boolean createParent) throws IOException, UnresolvedLinkException
AbstractFileSystem
FileContext.createSymlink(Path, Path, boolean)
;createSymlink
in class AbstractFileSystem
IOException
UnresolvedLinkException
public Path getLinkTarget(Path f) throws IOException
AbstractFileSystem
FSLinkResolver
, and differs from the similarly named method
FileContext.getLinkTarget(Path)
.getLinkTarget
in class AbstractFileSystem
IOException
public String getCanonicalServiceName()
AbstractFileSystem
getCanonicalServiceName
in class AbstractFileSystem
public List<Token<?>> getDelegationTokens(String renewer) throws IOException
AbstractFileSystem
getDelegationTokens
in class AbstractFileSystem
renewer
- the account name that is allowed to renew the token.IOException
public boolean isValidName(String src)
AbstractFileSystem
isValidName
in class AbstractFileSystem
src
- String source filename to check, path part of the URICopyright © 2013 Apache Software Foundation. All rights reserved.