@InterfaceAudience.Private @InterfaceStability.Evolving public class Hdfs extends AbstractFileSystem
statistics| Modifier and Type | Method and Description |
|---|---|
void |
cancelDelegationToken(Token<? extends AbstractDelegationTokenIdentifier> token)
Deprecated.
Use Token.cancel instead.
|
HdfsDataOutputStream |
createInternal(Path f,
EnumSet<CreateFlag> createFlag,
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 p,
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 |
getLinkTarget(Path p)
Partially resolves the path.
|
FsServerDefaults |
getServerDefaults()
Return a set of server default configuration values.
|
int |
getUriDefaultPort()
The default port of this file system.
|
RemoteIterator<Path> |
listCorruptFileBlocks(Path path) |
RemoteIterator<LocatedFileStatus> |
listLocatedStatus(Path p)
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. |
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. |
HdfsDataInputStream |
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. |
long |
renewDelegationToken(Token<? extends AbstractDelegationTokenIdentifier> token)
Deprecated.
Use Token.renew instead.
|
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.
|
checkPath, checkScheme, clearStatistics, create, createFileSystem, equals, get, getAllStatistics, getFsStatus, getHomeDirectory, getInitialWorkingDirectory, getStatistics, getStatistics, getUri, getUriPath, hashCode, isValidName, makeQualified, open, printStatistics, rename, resolvePathpublic int getUriDefaultPort()
AbstractFileSystemgetUriDefaultPort in class AbstractFileSystempublic HdfsDataOutputStream createInternal(Path f, EnumSet<CreateFlag> createFlag, FsPermission absolutePermission, int bufferSize, short replication, long blockSize, Progressable progress, Options.ChecksumOpt checksumOpt, boolean createParent) throws IOException
AbstractFileSystemAbstractFileSystem.create(Path, EnumSet, Options.CreateOpts...) except that the opts
have been declared explicitly.createInternal in class AbstractFileSystemIOExceptionpublic boolean delete(Path f, boolean recursive) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.delete(Path, boolean) except that Path f must be for
this file system.delete in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic BlockLocation[] getFileBlockLocations(Path p, long start, long len) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.getFileBlockLocations(Path, long, long) except that
Path f must be for this file system.getFileBlockLocations in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic FileChecksum getFileChecksum(Path f) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.getFileChecksum(Path) except that Path f must be for
this file system.getFileChecksum in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic FileStatus getFileStatus(Path f) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.getFileStatus(Path)
except that an UnresolvedLinkException may be thrown if a symlink is
encountered in the path.getFileStatus in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic FileStatus getFileLinkStatus(Path f) throws IOException, UnresolvedLinkException
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 AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic FsStatus getFsStatus() throws IOException
AbstractFileSystemFileContext.getFsStatus(Path).getFsStatus in class AbstractFileSystemIOExceptionpublic FsServerDefaults getServerDefaults() throws IOException
AbstractFileSystemgetServerDefaults in class AbstractFileSystemIOException - an I/O error occurredpublic RemoteIterator<LocatedFileStatus> listLocatedStatus(Path p) throws FileNotFoundException, IOException
AbstractFileSystemFileContext.listLocatedStatus(Path) except that Path f
must be for this file system.listLocatedStatus in class AbstractFileSystemFileNotFoundExceptionIOExceptionpublic RemoteIterator<FileStatus> listStatusIterator(Path f) throws AccessControlException, FileNotFoundException, UnresolvedLinkException, IOException
AbstractFileSystemFileContext.listStatus(Path) except that Path f must be for this
file system.listStatusIterator in class AbstractFileSystemAccessControlExceptionFileNotFoundExceptionUnresolvedLinkExceptionIOExceptionpublic FileStatus[] listStatus(Path f) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.Util.listStatus(Path) except that Path f must be
for this file system.listStatus in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic RemoteIterator<Path> listCorruptFileBlocks(Path path) throws IOException
listCorruptFileBlocks in class AbstractFileSystemIOExceptionpublic void mkdir(Path dir, FsPermission permission, boolean createParent) throws IOException, UnresolvedLinkException
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 AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic HdfsDataInputStream open(Path f, int bufferSize) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.open(Path, int) except that Path f must be for this
file system.open in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic void renameInternal(Path src, Path dst) throws IOException, UnresolvedLinkException
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 AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic void renameInternal(Path src, Path dst, boolean overwrite) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.rename(Path, Path, Options.Rename...) except that Path
f must be for this file system.renameInternal in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic void setOwner(Path f, String username, String groupname) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.setOwner(Path, String, String) except that Path f must
be for this file system.setOwner in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic void setPermission(Path f, FsPermission permission) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.setPermission(Path, FsPermission) except that Path f
must be for this file system.setPermission in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic boolean setReplication(Path f, short replication) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.setReplication(Path, short) except that Path f must be
for this file system.setReplication in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic void setTimes(Path f, long mtime, long atime) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.setTimes(Path, long, long) except that Path f must be
for this file system.setTimes in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic void setVerifyChecksum(boolean verifyChecksum)
throws IOException
AbstractFileSystemFileContext.setVerifyChecksum(boolean, Path) except that Path f
must be for this file system.setVerifyChecksum in class AbstractFileSystemIOExceptionpublic boolean supportsSymlinks()
AbstractFileSystemsupportsSymlinks in class AbstractFileSystempublic void createSymlink(Path target, Path link, boolean createParent) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.createSymlink(Path, Path, boolean);createSymlink in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic Path getLinkTarget(Path p) throws IOException
AbstractFileSystemFSLinkResolver, and differs from the similarly named method
FileContext.getLinkTarget(Path).getLinkTarget in class AbstractFileSystemIOExceptionpublic String getCanonicalServiceName()
AbstractFileSystemgetCanonicalServiceName in class AbstractFileSystempublic List<Token<?>> getDelegationTokens(String renewer) throws IOException
AbstractFileSystemgetDelegationTokens in class AbstractFileSystemrenewer - the account name that is allowed to renew the token.IOExceptionpublic long renewDelegationToken(Token<? extends AbstractDelegationTokenIdentifier> token) throws SecretManager.InvalidToken, IOException
token - delegation token obtained earlierSecretManager.InvalidTokenIOExceptionpublic void cancelDelegationToken(Token<? extends AbstractDelegationTokenIdentifier> token) throws SecretManager.InvalidToken, IOException
token - delegation tokenSecretManager.InvalidTokenIOExceptionCopyright © 2013 Apache Software Foundation. All rights reserved.