@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, resolvePath
public int getUriDefaultPort()
AbstractFileSystem
getUriDefaultPort
in class AbstractFileSystem
public HdfsDataOutputStream createInternal(Path f, EnumSet<CreateFlag> createFlag, FsPermission absolutePermission, int bufferSize, short replication, long blockSize, Progressable progress, Options.ChecksumOpt checksumOpt, boolean createParent) throws IOException
AbstractFileSystem
AbstractFileSystem.create(Path, EnumSet, Options.CreateOpts...)
except that the opts
have been declared explicitly.createInternal
in class AbstractFileSystem
IOException
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 p, 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() 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 RemoteIterator<LocatedFileStatus> listLocatedStatus(Path p) throws FileNotFoundException, IOException
AbstractFileSystem
FileContext.listLocatedStatus(Path)
except that Path f
must be for this file system.listLocatedStatus
in class AbstractFileSystem
FileNotFoundException
IOException
public RemoteIterator<FileStatus> listStatusIterator(Path f) throws AccessControlException, FileNotFoundException, UnresolvedLinkException, IOException
AbstractFileSystem
FileContext.listStatus(Path)
except that Path f must be for this
file system.listStatusIterator
in class AbstractFileSystem
AccessControlException
FileNotFoundException
UnresolvedLinkException
IOException
public 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 HdfsDataInputStream 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 IOException, UnresolvedLinkException
AbstractFileSystem
FileContext.rename(Path, Path, Options.Rename...)
except that Path
f must be for this file system.renameInternal
in class AbstractFileSystem
IOException
UnresolvedLinkException
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
AbstractFileSystem
FileContext.setVerifyChecksum(boolean, Path)
except that Path f
must be for this file system.setVerifyChecksum
in class AbstractFileSystem
IOException
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 p) 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 long renewDelegationToken(Token<? extends AbstractDelegationTokenIdentifier> token) throws SecretManager.InvalidToken, IOException
token
- delegation token obtained earlierSecretManager.InvalidToken
IOException
public void cancelDelegationToken(Token<? extends AbstractDelegationTokenIdentifier> token) throws SecretManager.InvalidToken, IOException
token
- delegation tokenSecretManager.InvalidToken
IOException
Copyright © 2013 Apache Software Foundation. All rights reserved.