@InterfaceAudience.Private @InterfaceStability.Evolving public interface ClientProtocol
DistributedFileSystem
class to communicate
with the NameNode. User code can manipulate the directory namespace,
as well as open/close file streams, etc.Modifier and Type | Field and Description |
---|---|
static int |
GET_STATS_CAPACITY_IDX |
static int |
GET_STATS_CORRUPT_BLOCKS_IDX |
static int |
GET_STATS_MISSING_BLOCKS_IDX |
static int |
GET_STATS_REMAINING_IDX |
static int |
GET_STATS_UNDER_REPLICATED_IDX |
static int |
GET_STATS_USED_IDX |
static long |
versionID
Until version 69, this class ClientProtocol served as both
the client interface to the NN AND the RPC protocol used to
communicate with the NN.
|
Modifier and Type | Method and Description |
---|---|
void |
abandonBlock(ExtendedBlock b,
String src,
String holder)
The client can give up on a block by calling abandonBlock().
|
LocatedBlock |
addBlock(String src,
String clientName,
ExtendedBlock previous,
DatanodeInfo[] excludeNodes,
long fileId,
String[] favoredNodes)
A client that wants to write an additional block to the
indicated filename (which must currently be open for writing)
should call addBlock().
|
void |
allowSnapshot(String snapshotRoot)
Allow snapshot on a directory.
|
LocatedBlock |
append(String src,
String clientName)
Append to the end of the file.
|
void |
cancelDelegationToken(Token<DelegationTokenIdentifier> token)
Cancel an existing delegation token.
|
boolean |
complete(String src,
String clientName,
ExtendedBlock last,
long fileId)
The client is done writing data to the given filename, and would
like to complete it.
|
void |
concat(String trg,
String[] srcs)
Moves blocks from srcs to trg and delete srcs
|
HdfsFileStatus |
create(String src,
FsPermission masked,
String clientName,
EnumSetWritable<CreateFlag> flag,
boolean createParent,
short replication,
long blockSize)
Create a new file entry in the namespace.
|
String |
createSnapshot(String snapshotRoot,
String snapshotName)
Create a snapshot
|
void |
createSymlink(String target,
String link,
FsPermission dirPerm,
boolean createParent)
Create symlink to a file or directory.
|
boolean |
delete(String src,
boolean recursive)
Delete the given file or directory from the file system.
|
void |
deleteSnapshot(String snapshotRoot,
String snapshotName)
Delete a specific snapshot of a snapshottable directory
|
void |
disallowSnapshot(String snapshotRoot)
Disallow snapshot on a directory.
|
void |
finalizeUpgrade()
Finalize previous upgrade.
|
void |
fsync(String src,
String client,
long lastBlockLength)
Write all metadata for this file into persistent storage.
|
LocatedBlock |
getAdditionalDatanode(String src,
ExtendedBlock blk,
DatanodeInfo[] existings,
DatanodeInfo[] excludes,
int numAdditionalNodes,
String clientName)
Get a datanode for an existing pipeline.
|
LocatedBlocks |
getBlockLocations(String src,
long offset,
long length)
Get locations of the blocks of the specified file within the specified range.
|
ContentSummary |
getContentSummary(String path)
Get
ContentSummary rooted at the specified directory. |
DataEncryptionKey |
getDataEncryptionKey() |
DatanodeInfo[] |
getDatanodeReport(HdfsConstants.DatanodeReportType type)
Get a report on the system's current datanodes.
|
Token<DelegationTokenIdentifier> |
getDelegationToken(Text renewer)
Get a valid Delegation Token.
|
HdfsFileStatus |
getFileInfo(String src)
Get the file info for a specific file or directory.
|
HdfsFileStatus |
getFileLinkInfo(String src)
Get the file info for a specific file or directory.
|
String |
getLinkTarget(String path)
Return the target of the given symlink.
|
DirectoryListing |
getListing(String src,
byte[] startAfter,
boolean needLocation)
Get a partial listing of the indicated directory
|
long |
getPreferredBlockSize(String filename)
Get the block size for the given file.
|
FsServerDefaults |
getServerDefaults()
Get server default values for a number of configuration params.
|
SnapshotDiffReport |
getSnapshotDiffReport(String snapshotRoot,
String fromSnapshot,
String toSnapshot)
Get the difference between two snapshots, or between a snapshot and the
current tree of a directory.
|
SnapshottableDirectoryStatus[] |
getSnapshottableDirListing()
Get listing of all the snapshottable directories
|
long[] |
getStats()
Get a set of statistics about the filesystem.
|
boolean |
isFileClosed(String src)
Get the close status of a file
|
CorruptFileBlocks |
listCorruptFileBlocks(String path,
String cookie) |
void |
metaSave(String filename)
Dumps namenode data structures into specified file.
|
boolean |
mkdirs(String src,
FsPermission masked,
boolean createParent)
Create a directory (or hierarchy of directories) with the given
name and permission.
|
boolean |
recoverLease(String src,
String clientName)
Start lease recovery.
|
void |
refreshNodes()
Tells the namenode to reread the hosts and exclude files.
|
boolean |
rename(String src,
String dst)
Rename an item in the file system namespace.
|
void |
rename2(String src,
String dst,
Options.Rename... options)
Rename src to dst.
|
void |
renameSnapshot(String snapshotRoot,
String snapshotOldName,
String snapshotNewName)
Rename a snapshot
|
long |
renewDelegationToken(Token<DelegationTokenIdentifier> token)
Renew an existing delegation token.
|
void |
renewLease(String clientName)
Client programs can cause stateful changes in the NameNode
that affect other clients.
|
void |
reportBadBlocks(LocatedBlock[] blocks)
The client wants to report corrupted blocks (blocks with specified
locations on datanodes).
|
boolean |
restoreFailedStorage(String arg)
Enable/Disable restore failed storage.
|
long |
rollEdits()
Roll the edit log.
|
void |
saveNamespace()
Save namespace image.
|
void |
setBalancerBandwidth(long bandwidth)
Tell all datanodes to use a new, non-persistent bandwidth value for
dfs.balance.bandwidthPerSec.
|
void |
setOwner(String src,
String username,
String groupname)
Set Owner of a path (i.e.
|
void |
setPermission(String src,
FsPermission permission)
Set permissions for an existing file/directory.
|
void |
setQuota(String path,
long namespaceQuota,
long diskspaceQuota)
Set the quota for a directory.
|
boolean |
setReplication(String src,
short replication)
Set replication for an existing file.
|
boolean |
setSafeMode(HdfsConstants.SafeModeAction action,
boolean isChecked)
Enter, leave or get safe mode.
|
void |
setTimes(String src,
long mtime,
long atime)
Sets the modification and access time of the file to the specified time.
|
LocatedBlock |
updateBlockForPipeline(ExtendedBlock block,
String clientName)
Get a new generation stamp together with an access token for
a block under construction
This method is called only when a client needs to recover a failed
pipeline or set up a pipeline for appending to a block.
|
void |
updatePipeline(String clientName,
ExtendedBlock oldBlock,
ExtendedBlock newBlock,
DatanodeID[] newNodes)
Update a pipeline for a block under construction
|
static final long versionID
static final int GET_STATS_CAPACITY_IDX
static final int GET_STATS_USED_IDX
static final int GET_STATS_REMAINING_IDX
static final int GET_STATS_UNDER_REPLICATED_IDX
static final int GET_STATS_CORRUPT_BLOCKS_IDX
static final int GET_STATS_MISSING_BLOCKS_IDX
LocatedBlocks getBlockLocations(String src, long offset, long length) throws AccessControlException, FileNotFoundException, UnresolvedLinkException, IOException
Return LocatedBlocks
which contains
file length, blocks and their locations.
DataNode locations for each block are sorted by
the distance to the client's address.
The client will then have to contact one of the indicated DataNodes to obtain the actual data.
src
- file nameoffset
- range start offsetlength
- range lengthAccessControlException
- If access is deniedFileNotFoundException
- If file src
does not existUnresolvedLinkException
- If src
contains a symlinkIOException
- If an I/O error occurredFsServerDefaults getServerDefaults() throws IOException
IOException
HdfsFileStatus create(String src, FsPermission masked, String clientName, EnumSetWritable<CreateFlag> flag, boolean createParent, short replication, long blockSize) throws AccessControlException, AlreadyBeingCreatedException, DSQuotaExceededException, FileAlreadyExistsException, FileNotFoundException, NSQuotaExceededException, ParentNotDirectoryException, SafeModeException, UnresolvedLinkException, SnapshotAccessControlException, IOException
This will create an empty file specified by the source path. The path should reflect a full path originated at the root. The name-node does not have a notion of "current" directory for a client.
Once created, the file is visible and available for read to other clients.
Although, other clients cannot delete(String, boolean)
, re-create or
rename(String, String)
it until the file is completed
or explicitly as a result of lease expiration.
Blocks have a maximum size. Clients that intend to create
multi-block files must also use
addBlock(java.lang.String, java.lang.String, org.apache.hadoop.hdfs.protocol.ExtendedBlock, org.apache.hadoop.hdfs.protocol.DatanodeInfo[], long, java.lang.String[])
src
- path of the file being created.masked
- masked permission.clientName
- name of the current client.flag
- indicates whether the file should be
overwritten if it already exists or create if it does not exist or append.createParent
- create missing parent directory if truereplication
- block replication factor.blockSize
- maximum block size.AccessControlException
- If access is deniedAlreadyBeingCreatedException
- if the path does not exist.DSQuotaExceededException
- If file creation violates disk space
quota restrictionFileAlreadyExistsException
- If file src
already existsFileNotFoundException
- If parent of src
does not exist
and createParent
is falseParentNotDirectoryException
- If parent of src
is not a
directory.NSQuotaExceededException
- If file creation violates name space
quota restrictionSafeModeException
- create not allowed in safemodeUnresolvedLinkException
- If src
contains a symlinkSnapshotAccessControlException
- if path is in RO snapshotIOException
- If an I/O error occurred
RuntimeExceptions:InvalidPathException
- Path src
is invalid
Note that create with CreateFlag.OVERWRITE
is idempotent.
LocatedBlock append(String src, String clientName) throws AccessControlException, DSQuotaExceededException, FileNotFoundException, SafeModeException, UnresolvedLinkException, SnapshotAccessControlException, IOException
src
- path of the file being created.clientName
- name of the current client.AccessControlException
- if permission to append file is
denied by the system. As usually on the client side the exception will
be wrapped into RemoteException
.
Allows appending to an existing file if the server is
configured with the parameter dfs.support.append set to true, otherwise
throws an IOException.AccessControlException
- If permission to append to file is deniedFileNotFoundException
- If file src
is not foundDSQuotaExceededException
- If append violates disk space quota
restrictionSafeModeException
- append not allowed in safemodeUnresolvedLinkException
- If src
contains a symlinkSnapshotAccessControlException
- if path is in RO snapshotIOException
- If an I/O error occurred.
RuntimeExceptions:UnsupportedOperationException
- if append is not supportedboolean setReplication(String src, short replication) throws AccessControlException, DSQuotaExceededException, FileNotFoundException, SafeModeException, UnresolvedLinkException, SnapshotAccessControlException, IOException
The NameNode sets replication to the new value and returns. The actual block replication is not expected to be performed during this method call. The blocks will be populated or removed in the background as the result of the routine block maintenance procedures.
src
- file namereplication
- new replicationAccessControlException
- If access is deniedDSQuotaExceededException
- If replication violates disk space
quota restrictionFileNotFoundException
- If file src
is not foundSafeModeException
- not allowed in safemodeUnresolvedLinkException
- if src
contains a symlinkSnapshotAccessControlException
- if path is in RO snapshotIOException
- If an I/O error occurredvoid setPermission(String src, FsPermission permission) throws AccessControlException, FileNotFoundException, SafeModeException, UnresolvedLinkException, SnapshotAccessControlException, IOException
AccessControlException
- If access is deniedFileNotFoundException
- If file src
is not foundSafeModeException
- not allowed in safemodeUnresolvedLinkException
- If src
contains a symlinkSnapshotAccessControlException
- if path is in RO snapshotIOException
- If an I/O error occurredvoid setOwner(String src, String username, String groupname) throws AccessControlException, FileNotFoundException, SafeModeException, UnresolvedLinkException, SnapshotAccessControlException, IOException
src
- username
- If it is null, the original username remains unchanged.groupname
- If it is null, the original groupname remains unchanged.AccessControlException
- If access is deniedFileNotFoundException
- If file src
is not foundSafeModeException
- not allowed in safemodeUnresolvedLinkException
- If src
contains a symlinkSnapshotAccessControlException
- if path is in RO snapshotIOException
- If an I/O error occurredvoid abandonBlock(ExtendedBlock b, String src, String holder) throws AccessControlException, FileNotFoundException, UnresolvedLinkException, IOException
AccessControlException
- If access is deniedFileNotFoundException
- file src
is not foundUnresolvedLinkException
- If src
contains a symlinkIOException
- If an I/O error occurredLocatedBlock addBlock(String src, String clientName, ExtendedBlock previous, DatanodeInfo[] excludeNodes, long fileId, String[] favoredNodes) throws AccessControlException, FileNotFoundException, NotReplicatedYetException, SafeModeException, UnresolvedLinkException, IOException
src
- the file being createdclientName
- the name of the client that adds the blockprevious
- previous blockexcludeNodes
- a list of nodes that should not be
allocated for the current blockfileId
- the id uniquely identifying a filefavoredNodes
- the list of nodes where the client wants the blocks.
Nodes are identified by either host name or address.AccessControlException
- If access is deniedFileNotFoundException
- If file src
is not foundNotReplicatedYetException
- previous blocks of the file are not
replicated yet. Blocks cannot be added until replication
completes.SafeModeException
- create not allowed in safemodeUnresolvedLinkException
- If src
contains a symlinkIOException
- If an I/O error occurredLocatedBlock getAdditionalDatanode(String src, ExtendedBlock blk, DatanodeInfo[] existings, DatanodeInfo[] excludes, int numAdditionalNodes, String clientName) throws AccessControlException, FileNotFoundException, SafeModeException, UnresolvedLinkException, IOException
src
- the file being writtenblk
- the block being writtenexistings
- the existing nodes in the pipelineexcludes
- the excluded nodesnumAdditionalNodes
- number of additional datanodesclientName
- the name of the clientAccessControlException
- If access is deniedFileNotFoundException
- If file src
is not foundSafeModeException
- create not allowed in safemodeUnresolvedLinkException
- If src
contains a symlinkIOException
- If an I/O error occurredboolean complete(String src, String clientName, ExtendedBlock last, long fileId) throws AccessControlException, FileNotFoundException, SafeModeException, UnresolvedLinkException, IOException
src
- the file being createdclientName
- the name of the client that adds the blocklast
- the last block infofileId
- the id uniquely identifying a fileAccessControlException
- If access is deniedFileNotFoundException
- If file src
is not foundSafeModeException
- create not allowed in safemodeUnresolvedLinkException
- If src
contains a symlinkIOException
- If an I/O error occurredvoid reportBadBlocks(LocatedBlock[] blocks) throws IOException
blocks
- Array of located blocks to reportIOException
boolean rename(String src, String dst) throws UnresolvedLinkException, SnapshotAccessControlException, IOException
src
- existing file or directory name.dst
- new name.SnapshotAccessControlException
- if path is in RO snapshotIOException
- an I/O error occurredUnresolvedLinkException
void concat(String trg, String[] srcs) throws IOException, UnresolvedLinkException, SnapshotAccessControlException
trg
- existing filesrcs
- - list of existing files (same block size, same replication)IOException
- if some arguments are invalidUnresolvedLinkException
- if trg
or srcs
contains a symlinkSnapshotAccessControlException
- if path is in RO snapshotvoid rename2(String src, String dst, Options.Rename... options) throws AccessControlException, DSQuotaExceededException, FileAlreadyExistsException, FileNotFoundException, NSQuotaExceededException, ParentNotDirectoryException, SafeModeException, UnresolvedLinkException, SnapshotAccessControlException, IOException
Without OVERWRITE option, rename fails if the dst already exists. With OVERWRITE option, rename overwrites the dst, if it is a file or an empty directory. Rename fails if dst is a non-empty directory.
This implementation of rename is atomic.
src
- existing file or directory name.dst
- new name.options
- Rename optionsAccessControlException
- If access is deniedDSQuotaExceededException
- If rename violates disk space
quota restrictionFileAlreadyExistsException
- If dst
already exists and
options has Options.Rename.OVERWRITE
option
false.
FileNotFoundException
- If src
does not existNSQuotaExceededException
- If rename violates namespace
quota restrictionParentNotDirectoryException
- If parent of dst
is not a directorySafeModeException
- rename not allowed in safemodeUnresolvedLinkException
- If src
or
dst
contains a symlinkSnapshotAccessControlException
- if path is in RO snapshotIOException
- If an I/O error occurredboolean delete(String src, boolean recursive) throws AccessControlException, FileNotFoundException, SafeModeException, UnresolvedLinkException, SnapshotAccessControlException, IOException
same as delete but provides a way to avoid accidentally deleting non empty directories programmatically.
src
- existing namerecursive
- if true deletes a non empty directory recursively,
else throws an exception.AccessControlException
- If access is deniedFileNotFoundException
- If file src
is not foundSafeModeException
- create not allowed in safemodeUnresolvedLinkException
- If src
contains a symlinkSnapshotAccessControlException
- if path is in RO snapshotIOException
- If an I/O error occurredboolean mkdirs(String src, FsPermission masked, boolean createParent) throws AccessControlException, FileAlreadyExistsException, FileNotFoundException, NSQuotaExceededException, ParentNotDirectoryException, SafeModeException, UnresolvedLinkException, SnapshotAccessControlException, IOException
src
- The path of the directory being createdmasked
- The masked permission of the directory being createdcreateParent
- create missing parent directory if trueAccessControlException
- If access is deniedFileAlreadyExistsException
- If src
already existsFileNotFoundException
- If parent of src
does not exist
and createParent
is falseNSQuotaExceededException
- If file creation violates quota restrictionParentNotDirectoryException
- If parent of src
is not a directorySafeModeException
- create not allowed in safemodeUnresolvedLinkException
- If src
contains a symlinkSnapshotAccessControlException
- if path is in RO snapshotIOException
- If an I/O error occurred.
RunTimeExceptions:InvalidPathException
- If src
is invalidDirectoryListing getListing(String src, byte[] startAfter, boolean needLocation) throws AccessControlException, FileNotFoundException, UnresolvedLinkException, IOException
src
- the directory namestartAfter
- the name to start listing after encoded in java UTF8needLocation
- if the FileStatus should contain block locationsAccessControlException
- permission deniedFileNotFoundException
- file src
is not foundUnresolvedLinkException
- If src
contains a symlinkIOException
- If an I/O error occurredSnapshottableDirectoryStatus[] getSnapshottableDirListing() throws IOException
IOException
- If an I/O error occurredvoid renewLease(String clientName) throws AccessControlException, IOException
So, the NameNode will revoke the locks and live file-creates for clients that it thinks have died. A client tells the NameNode that it is still alive by periodically calling renewLease(). If a certain amount of time passes since the last call to renewLease(), the NameNode assumes the client has died.
AccessControlException
- permission deniedIOException
- If an I/O error occurredboolean recoverLease(String src, String clientName) throws IOException
src
- path of the file to start lease recoveryclientName
- name of the current clientIOException
long[] getStats() throws IOException
GET_STATS_CAPACITY_IDX
in place of
actual numbers to index into the array.IOException
DatanodeInfo[] getDatanodeReport(HdfsConstants.DatanodeReportType type) throws IOException
IOException
long getPreferredBlockSize(String filename) throws IOException, UnresolvedLinkException
filename
- The name of the fileIOException
UnresolvedLinkException
- if the path contains a symlink.boolean setSafeMode(HdfsConstants.SafeModeAction action, boolean isChecked) throws IOException
Safe mode is a name node state when it
Safe mode is entered automatically at name node startup.
Safe mode can also be entered manually using
setSafeMode(SafeModeAction.SAFEMODE_ENTER,false)
.
At startup the name node accepts data node reports collecting information about block locations. In order to leave safe mode it needs to collect a configurable percentage called threshold of blocks, which satisfy the minimal replication condition. The minimal replication condition is that each block must have at least dfs.namenode.replication.min replicas. When the threshold is reached the name node extends safe mode for a configurable amount of time to let the remaining data nodes to check in before it will start replicating missing blocks. Then the name node leaves safe mode.
If safe mode is turned on manually using
setSafeMode(SafeModeAction.SAFEMODE_ENTER,false)
then the name node stays in safe mode until it is manually turned off
using setSafeMode(SafeModeAction.SAFEMODE_LEAVE,false)
.
Current state of the name node can be verified using
setSafeMode(SafeModeAction.SAFEMODE_GET,false)
action
- isChecked
- If true then action will be done only in ActiveNN.IOException
void saveNamespace() throws AccessControlException, IOException
Saves current namespace into storage directories and reset edits log. Requires superuser privilege and safe mode.
AccessControlException
- if the superuser privilege is violated.IOException
- if image creation failed.long rollEdits() throws AccessControlException, IOException
AccessControlException
- if the superuser privilege is violatedIOException
- if log roll failsboolean restoreFailedStorage(String arg) throws AccessControlException, IOException
sets flag to enable restore of failed storage replicas
AccessControlException
- if the superuser privilege is violated.IOException
void refreshNodes() throws IOException
IOException
void finalizeUpgrade() throws IOException
IOException
CorruptFileBlocks listCorruptFileBlocks(String path, String cookie) throws IOException
IOException
- Each call returns a subset of the corrupt files in the system. To obtain
all corrupt files, call this method repeatedly and each time pass in the
cookie returned from the previous call.void metaSave(String filename) throws IOException
IOException
void setBalancerBandwidth(long bandwidth) throws IOException
bandwidth
- Blanacer bandwidth in bytes per second for this datanode.IOException
HdfsFileStatus getFileInfo(String src) throws AccessControlException, FileNotFoundException, UnresolvedLinkException, IOException
src
- The string representation of the path to the fileAccessControlException
- permission deniedFileNotFoundException
- file src
is not foundUnresolvedLinkException
- if the path contains a symlink.IOException
- If an I/O error occurredboolean isFileClosed(String src) throws AccessControlException, FileNotFoundException, UnresolvedLinkException, IOException
src
- The string representation of the path to the fileAccessControlException
- permission deniedFileNotFoundException
- file src
is not foundUnresolvedLinkException
- if the path contains a symlink.IOException
- If an I/O error occurredHdfsFileStatus getFileLinkInfo(String src) throws AccessControlException, UnresolvedLinkException, IOException
src
- The string representation of the path to the fileAccessControlException
- permission deniedUnresolvedLinkException
- if src
contains a symlinkIOException
- If an I/O error occurredContentSummary getContentSummary(String path) throws AccessControlException, FileNotFoundException, UnresolvedLinkException, IOException
ContentSummary
rooted at the specified directory.path
- The string representation of the pathAccessControlException
- permission deniedFileNotFoundException
- file path
is not foundUnresolvedLinkException
- if path
contains a symlink.IOException
- If an I/O error occurredvoid setQuota(String path, long namespaceQuota, long diskspaceQuota) throws AccessControlException, FileNotFoundException, UnresolvedLinkException, SnapshotAccessControlException, IOException
path
- The string representation of the path to the directorynamespaceQuota
- Limit on the number of names in the tree rooted
at the directorydiskspaceQuota
- Limit on disk space occupied all the files under
this directory.
HdfsConstants.QUOTA_DONT_SET
implies
the quota will not be changed, and (3) HdfsConstants.QUOTA_RESET
implies the quota will be reset. Any other value is a runtime error.AccessControlException
- permission deniedFileNotFoundException
- file path
is not foundQuotaExceededException
- if the directory size
is greater than the given quotaUnresolvedLinkException
- if the path
contains a symlink.SnapshotAccessControlException
- if path is in RO snapshotIOException
- If an I/O error occurredvoid fsync(String src, String client, long lastBlockLength) throws AccessControlException, FileNotFoundException, UnresolvedLinkException, IOException
src
- The string representation of the pathclient
- The string representation of the clientlastBlockLength
- The length of the last block (under construction)
to be reported to NameNodeAccessControlException
- permission deniedFileNotFoundException
- file src
is not foundUnresolvedLinkException
- if src
contains a symlink.IOException
- If an I/O error occurredvoid setTimes(String src, long mtime, long atime) throws AccessControlException, FileNotFoundException, UnresolvedLinkException, SnapshotAccessControlException, IOException
src
- The string representation of the pathmtime
- The number of milliseconds since Jan 1, 1970.
Setting mtime to -1 means that modification time should not be set
by this call.atime
- The number of milliseconds since Jan 1, 1970.
Setting atime to -1 means that access time should not be set
by this call.AccessControlException
- permission deniedFileNotFoundException
- file src
is not foundUnresolvedLinkException
- if src
contains a symlink.SnapshotAccessControlException
- if path is in RO snapshotIOException
- If an I/O error occurredvoid createSymlink(String target, String link, FsPermission dirPerm, boolean createParent) throws AccessControlException, FileAlreadyExistsException, FileNotFoundException, ParentNotDirectoryException, SafeModeException, UnresolvedLinkException, SnapshotAccessControlException, IOException
target
- The path of the destination that the
link points to.link
- The path of the link being created.dirPerm
- permissions to use when creating parent directoriescreateParent
- - if true then missing parent dirs are created
if false then parent must existAccessControlException
- permission deniedFileAlreadyExistsException
- If file link
already existsFileNotFoundException
- If parent of link
does not exist
and createParent
is falseParentNotDirectoryException
- If parent of link
is not a
directory.UnresolvedLinkException
- if link contains a symlink.
SnapshotAccessControlException
- if path is in RO snapshotIOException
- If an I/O error occurredSafeModeException
String getLinkTarget(String path) throws AccessControlException, FileNotFoundException, IOException
path
- The path with a link that needs resolution.AccessControlException
- permission deniedFileNotFoundException
- If path
does not existIOException
- If the given path does not refer to a symlink
or an I/O error occurredLocatedBlock updateBlockForPipeline(ExtendedBlock block, String clientName) throws IOException
block
- a blockclientName
- the name of the clientIOException
- if any error occursvoid updatePipeline(String clientName, ExtendedBlock oldBlock, ExtendedBlock newBlock, DatanodeID[] newNodes) throws IOException
clientName
- the name of the clientoldBlock
- the old blocknewBlock
- the new block containing new generation stamp and lengthnewNodes
- datanodes in the pipelineIOException
- if any error occursToken<DelegationTokenIdentifier> getDelegationToken(Text renewer) throws IOException
renewer
- the designated renewer for the tokenIOException
long renewDelegationToken(Token<DelegationTokenIdentifier> token) throws IOException
token
- delegation token obtained earlierIOException
void cancelDelegationToken(Token<DelegationTokenIdentifier> token) throws IOException
token
- delegation tokenIOException
DataEncryptionKey getDataEncryptionKey() throws IOException
IOException
String createSnapshot(String snapshotRoot, String snapshotName) throws IOException
snapshotRoot
- the path that is being snapshottedsnapshotName
- name of the snapshot createdIOException
void deleteSnapshot(String snapshotRoot, String snapshotName) throws IOException
snapshotRoot
- The snapshottable directorysnapshotName
- Name of the snapshot for the snapshottable directoryIOException
void renameSnapshot(String snapshotRoot, String snapshotOldName, String snapshotNewName) throws IOException
snapshotRoot
- the directory path where the snapshot was takensnapshotOldName
- old name of the snapshotsnapshotNewName
- new name of the snapshotIOException
void allowSnapshot(String snapshotRoot) throws IOException
snapshotRoot
- the directory to be snappedIOException
- on errorvoid disallowSnapshot(String snapshotRoot) throws IOException
snapshotRoot
- the directory to disallow snapshotIOException
- on errorSnapshotDiffReport getSnapshotDiffReport(String snapshotRoot, String fromSnapshot, String toSnapshot) throws IOException
snapshotRoot
- full path of the directory where snapshots are takenfromSnapshot
- snapshot name of the from point. Null indicates the current
treetoSnapshot
- snapshot name of the to point. Null indicates the current
tree.SnapshotDiffReport
.IOException
- on errorCopyright © 2013 Apache Software Foundation. All rights reserved.