public class AuthorizationProviderProxyClientProtocol extends Object implements org.apache.hadoop.hdfs.protocol.ClientProtocol
| Constructor and Description |
|---|
AuthorizationProviderProxyClientProtocol(org.apache.hadoop.hdfs.protocol.ClientProtocol server) |
| Modifier and Type | Method and Description |
|---|---|
void |
abandonBlock(org.apache.hadoop.hdfs.protocol.ExtendedBlock b,
long fileId,
String src,
String holder)
The client can give up on a block by calling abandonBlock().
|
org.apache.hadoop.hdfs.protocol.LocatedBlock |
addBlock(String src,
String clientName,
org.apache.hadoop.hdfs.protocol.ExtendedBlock previous,
org.apache.hadoop.hdfs.protocol.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().
|
long |
addCacheDirective(CacheDirectiveInfo directive,
EnumSet<CacheFlag> flags)
Add a CacheDirective to the CacheManager.
|
void |
addCachePool(CachePoolInfo info)
Add a new cache pool.
|
void |
allowSnapshot(String snapshotRoot)
Allow snapshot on a directory.
|
org.apache.hadoop.hdfs.protocol.LocatedBlock |
append(String src,
String clientName)
Append to the end of the file.
|
void |
cancelDelegationToken(org.apache.hadoop.security.token.Token<org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier> token)
Cancel an existing delegation token.
|
void |
checkAccess(String path,
org.apache.hadoop.fs.permission.FsAction mode)
Checks if the user can access a path.
|
boolean |
complete(String src,
String clientName,
org.apache.hadoop.hdfs.protocol.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
|
org.apache.hadoop.hdfs.protocol.HdfsFileStatus |
create(String src,
org.apache.hadoop.fs.permission.FsPermission masked,
String clientName,
org.apache.hadoop.io.EnumSetWritable<org.apache.hadoop.fs.CreateFlag> flag,
boolean createParent,
short replication,
long blockSize,
org.apache.hadoop.crypto.CryptoProtocolVersion[] supportedVersions)
Create a new file entry in the namespace.
|
void |
createEncryptionZone(String src,
String keyName)
Create an encryption zone
|
String |
createSnapshot(String snapshotRoot,
String snapshotName)
Create a snapshot
|
void |
createSymlink(String target,
String link,
org.apache.hadoop.fs.permission.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,
long inodeId,
String client,
long lastBlockLength)
Write all metadata for this file into persistent storage.
|
org.apache.hadoop.fs.permission.AclStatus |
getAclStatus(String src)
Gets the ACLs of files and directories.
|
org.apache.hadoop.hdfs.protocol.LocatedBlock |
getAdditionalDatanode(String src,
long fileId,
org.apache.hadoop.hdfs.protocol.ExtendedBlock blk,
org.apache.hadoop.hdfs.protocol.DatanodeInfo[] existings,
String[] existingStorageIDs,
org.apache.hadoop.hdfs.protocol.DatanodeInfo[] excludes,
int numAdditionalNodes,
String clientName)
Get a datanode for an existing pipeline.
|
org.apache.hadoop.hdfs.protocol.LocatedBlocks |
getBlockLocations(String src,
long offset,
long length)
Get locations of the blocks of the specified file within the specified range.
|
org.apache.hadoop.fs.ContentSummary |
getContentSummary(String path)
Get
ContentSummary rooted at the specified directory. |
long |
getCurrentEditLogTxid()
Get the highest txid the NameNode knows has been written to the edit
log, or -1 if the NameNode's edit log is not yet open for write.
|
org.apache.hadoop.hdfs.security.token.block.DataEncryptionKey |
getDataEncryptionKey() |
org.apache.hadoop.hdfs.protocol.DatanodeInfo[] |
getDatanodeReport(HdfsConstants.DatanodeReportType type)
Get a report on the system's current datanodes.
|
DatanodeStorageReport[] |
getDatanodeStorageReport(HdfsConstants.DatanodeReportType type)
Get a report on the current datanode storages.
|
org.apache.hadoop.security.token.Token<org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier> |
getDelegationToken(org.apache.hadoop.io.Text renewer)
Get a valid Delegation Token.
|
org.apache.hadoop.hdfs.inotify.EventBatchList |
getEditsFromTxid(long txid)
Get an ordered list of batches of events corresponding to the edit log
transactions for txids equal to or greater than txid.
|
EncryptionZone |
getEZForPath(String src)
Get the encryption zone for a path.
|
org.apache.hadoop.hdfs.protocol.HdfsFileStatus |
getFileInfo(String src)
Get the file info for a specific file or directory.
|
org.apache.hadoop.hdfs.protocol.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.
|
org.apache.hadoop.hdfs.protocol.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.
|
org.apache.hadoop.fs.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.
|
org.apache.hadoop.hdfs.protocol.BlockStoragePolicy[] |
getStoragePolicies()
Get all the available block storage policies.
|
List<org.apache.hadoop.fs.XAttr> |
getXAttrs(String src,
List<org.apache.hadoop.fs.XAttr> xAttrs)
Get xattrs of a file or directory.
|
boolean |
isFileClosed(String src)
Get the close status of a file
|
org.apache.hadoop.fs.BatchedRemoteIterator.BatchedEntries<CacheDirectiveEntry> |
listCacheDirectives(long prevId,
CacheDirectiveInfo filter)
List the set of cached paths of a cache pool.
|
org.apache.hadoop.fs.BatchedRemoteIterator.BatchedEntries<CachePoolEntry> |
listCachePools(String prevPool)
List the set of cache pools.
|
CorruptFileBlocks |
listCorruptFileBlocks(String path,
String cookie) |
org.apache.hadoop.fs.BatchedRemoteIterator.BatchedEntries<EncryptionZone> |
listEncryptionZones(long prevId)
Used to implement cursor-based batched listing of s.
|
List<org.apache.hadoop.fs.XAttr> |
listXAttrs(String src)
List the xattrs names for a file or directory.
|
void |
metaSave(String filename)
Dumps namenode data structures into specified file.
|
boolean |
mkdirs(String src,
org.apache.hadoop.fs.permission.FsPermission masked,
boolean createParent)
Create a directory (or hierarchy of directories) with the given
name and permission.
|
void |
modifyAclEntries(String src,
List<org.apache.hadoop.fs.permission.AclEntry> aclSpec)
Modifies ACL entries of files and directories.
|
void |
modifyCacheDirective(CacheDirectiveInfo directive,
EnumSet<CacheFlag> flags)
Modify a CacheDirective in the CacheManager.
|
void |
modifyCachePool(CachePoolInfo req)
Modify an existing cache pool.
|
boolean |
recoverLease(String src,
String clientName)
Start lease recovery.
|
void |
refreshNodes()
Tells the namenode to reread the hosts and exclude files.
|
void |
removeAcl(String src)
Removes all but the base ACL entries of files and directories.
|
void |
removeAclEntries(String src,
List<org.apache.hadoop.fs.permission.AclEntry> aclSpec)
Removes ACL entries from files and directories.
|
void |
removeCacheDirective(long id)
Remove a CacheDirectiveInfo from the CacheManager.
|
void |
removeCachePool(String pool)
Remove a cache pool.
|
void |
removeDefaultAcl(String src)
Removes all default ACL entries from files and directories.
|
void |
removeXAttr(String src,
org.apache.hadoop.fs.XAttr xAttr)
Remove xattr of a file or directory.Value in xAttr parameter is ignored.
|
boolean |
rename(String src,
String dst)
Rename an item in the file system namespace.
|
void |
rename2(String src,
String dst,
org.apache.hadoop.fs.Options.Rename... options)
Rename src to dst.
|
void |
renameSnapshot(String snapshotRoot,
String snapshotOldName,
String snapshotNewName)
Rename a snapshot
|
long |
renewDelegationToken(org.apache.hadoop.security.token.Token<org.apache.hadoop.hdfs.security.token.delegation.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(org.apache.hadoop.hdfs.protocol.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.
|
org.apache.hadoop.hdfs.protocol.RollingUpgradeInfo |
rollingUpgrade(HdfsConstants.RollingUpgradeAction action)
Rolling upgrade operations.
|
void |
saveNamespace()
Save namespace image.
|
void |
setAcl(String src,
List<org.apache.hadoop.fs.permission.AclEntry> aclSpec)
Fully replaces ACL of files and directories, discarding all existing
entries.
|
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,
org.apache.hadoop.fs.permission.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 |
setStoragePolicy(String src,
String policyName)
Set the storage policy for a file/directory
|
void |
setTimes(String src,
long mtime,
long atime)
Sets the modification and access time of the file to the specified time.
|
void |
setXAttr(String src,
org.apache.hadoop.fs.XAttr xAttr,
EnumSet<org.apache.hadoop.fs.XAttrSetFlag> flag)
Set xattr of a file or directory.
|
org.apache.hadoop.hdfs.protocol.LocatedBlock |
updateBlockForPipeline(org.apache.hadoop.hdfs.protocol.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,
org.apache.hadoop.hdfs.protocol.ExtendedBlock oldBlock,
org.apache.hadoop.hdfs.protocol.ExtendedBlock newBlock,
org.apache.hadoop.hdfs.protocol.DatanodeID[] newNodes,
String[] newStorageIDs)
Update a pipeline for a block under construction
|
public AuthorizationProviderProxyClientProtocol(org.apache.hadoop.hdfs.protocol.ClientProtocol server)
public org.apache.hadoop.hdfs.protocol.LocatedBlocks getBlockLocations(String src, long offset, long length) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocol
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.
getBlockLocations in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - file nameoffset - range start offsetlength - range lengthorg.apache.hadoop.security.AccessControlException - If access is deniedFileNotFoundException - If file src does not existorg.apache.hadoop.fs.UnresolvedLinkException - If src contains a symlinkIOException - If an I/O error occurredpublic org.apache.hadoop.fs.FsServerDefaults getServerDefaults() throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolgetServerDefaults in interface org.apache.hadoop.hdfs.protocol.ClientProtocolIOExceptionpublic org.apache.hadoop.hdfs.protocol.HdfsFileStatus create(String src, org.apache.hadoop.fs.permission.FsPermission masked, String clientName, org.apache.hadoop.io.EnumSetWritable<org.apache.hadoop.fs.CreateFlag> flag, boolean createParent, short replication, long blockSize, org.apache.hadoop.crypto.CryptoProtocolVersion[] supportedVersions) throws org.apache.hadoop.security.AccessControlException, org.apache.hadoop.hdfs.protocol.AlreadyBeingCreatedException, org.apache.hadoop.hdfs.protocol.DSQuotaExceededException, org.apache.hadoop.fs.FileAlreadyExistsException, FileNotFoundException, org.apache.hadoop.hdfs.protocol.NSQuotaExceededException, org.apache.hadoop.fs.ParentNotDirectoryException, org.apache.hadoop.hdfs.server.namenode.SafeModeException, org.apache.hadoop.fs.UnresolvedLinkException, SnapshotAccessControlException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolThis 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 ClientProtocol.delete(String, boolean), re-create or
ClientProtocol.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
ClientProtocol.addBlock(java.lang.String, java.lang.String, org.apache.hadoop.hdfs.protocol.ExtendedBlock, org.apache.hadoop.hdfs.protocol.DatanodeInfo[], long, java.lang.String[])
create in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - 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.supportedVersions - CryptoProtocolVersions supported by the clientorg.apache.hadoop.security.AccessControlException - If access is deniedSnapshotAccessControlException - if path is in RO snapshotorg.apache.hadoop.hdfs.protocol.AlreadyBeingCreatedException - if the path does not exist.org.apache.hadoop.hdfs.protocol.DSQuotaExceededException - If file creation violates disk space
quota restrictionorg.apache.hadoop.fs.FileAlreadyExistsException - If file src already existsFileNotFoundException - If parent of src does not exist
and createParent is falseorg.apache.hadoop.hdfs.protocol.NSQuotaExceededException - If file creation violates name space
quota restrictionorg.apache.hadoop.fs.ParentNotDirectoryException - If parent of src is not a
directory.org.apache.hadoop.hdfs.server.namenode.SafeModeException - create not allowed in safemodeorg.apache.hadoop.fs.UnresolvedLinkException - If src contains a symlinkIOException - If an I/O error occurred
RuntimeExceptions:public org.apache.hadoop.hdfs.protocol.LocatedBlock append(String src, String clientName) throws org.apache.hadoop.security.AccessControlException, org.apache.hadoop.hdfs.protocol.DSQuotaExceededException, FileNotFoundException, org.apache.hadoop.hdfs.server.namenode.SafeModeException, org.apache.hadoop.fs.UnresolvedLinkException, SnapshotAccessControlException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolappend in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - path of the file being created.clientName - name of the current client.org.apache.hadoop.security.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.SnapshotAccessControlException - if path is in RO snapshotorg.apache.hadoop.hdfs.protocol.DSQuotaExceededException - If append violates disk space quota
restrictionFileNotFoundException - If file src is not foundorg.apache.hadoop.hdfs.server.namenode.SafeModeException - append not allowed in safemodeorg.apache.hadoop.fs.UnresolvedLinkException - If src contains a symlinkIOException - If an I/O error occurred.
RuntimeExceptions:public boolean setReplication(String src, short replication) throws org.apache.hadoop.security.AccessControlException, org.apache.hadoop.hdfs.protocol.DSQuotaExceededException, FileNotFoundException, org.apache.hadoop.hdfs.server.namenode.SafeModeException, org.apache.hadoop.fs.UnresolvedLinkException, SnapshotAccessControlException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolThe 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.
setReplication in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - file namereplication - new replicationorg.apache.hadoop.security.AccessControlException - If access is deniedSnapshotAccessControlException - if path is in RO snapshotorg.apache.hadoop.hdfs.protocol.DSQuotaExceededException - If replication violates disk space
quota restrictionFileNotFoundException - If file src is not foundorg.apache.hadoop.hdfs.server.namenode.SafeModeException - not allowed in safemodeorg.apache.hadoop.fs.UnresolvedLinkException - if src contains a symlinkIOException - If an I/O error occurredpublic org.apache.hadoop.hdfs.protocol.BlockStoragePolicy[] getStoragePolicies() throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolgetStoragePolicies in interface org.apache.hadoop.hdfs.protocol.ClientProtocolIOExceptionpublic void setStoragePolicy(String src, String policyName) throws SnapshotAccessControlException, org.apache.hadoop.fs.UnresolvedLinkException, FileNotFoundException, org.apache.hadoop.hdfs.protocol.QuotaExceededException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolsetStoragePolicy in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - Path of an existing file/directory.policyName - The name of the storage policySnapshotAccessControlException - If access is deniedorg.apache.hadoop.fs.UnresolvedLinkException - if src contains a symlinkFileNotFoundException - If file/dir src is not foundorg.apache.hadoop.hdfs.protocol.QuotaExceededException - If changes violate the quota restrictionIOExceptionpublic void setPermission(String src, org.apache.hadoop.fs.permission.FsPermission permission) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.hdfs.server.namenode.SafeModeException, org.apache.hadoop.fs.UnresolvedLinkException, SnapshotAccessControlException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolsetPermission in interface org.apache.hadoop.hdfs.protocol.ClientProtocolorg.apache.hadoop.security.AccessControlException - If access is deniedSnapshotAccessControlException - if path is in RO snapshotFileNotFoundException - If file src is not foundorg.apache.hadoop.hdfs.server.namenode.SafeModeException - not allowed in safemodeorg.apache.hadoop.fs.UnresolvedLinkException - If src contains a symlinkIOException - If an I/O error occurredpublic void setOwner(String src, String username, String groupname) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.hdfs.server.namenode.SafeModeException, org.apache.hadoop.fs.UnresolvedLinkException, SnapshotAccessControlException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolsetOwner in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - file pathusername - If it is null, the original username remains unchanged.groupname - If it is null, the original groupname remains unchanged.org.apache.hadoop.security.AccessControlException - If access is deniedSnapshotAccessControlException - if path is in RO snapshotFileNotFoundException - If file src is not foundorg.apache.hadoop.hdfs.server.namenode.SafeModeException - not allowed in safemodeorg.apache.hadoop.fs.UnresolvedLinkException - If src contains a symlinkIOException - If an I/O error occurredpublic void abandonBlock(org.apache.hadoop.hdfs.protocol.ExtendedBlock b, long fileId, String src, String holder) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolabandonBlock in interface org.apache.hadoop.hdfs.protocol.ClientProtocolb - Block to abandonfileId - The id of the file where the block resides. Older clients
will pass GRANDFATHER_INODE_ID here.src - The path of the file where the block resides.holder - Lease holder.org.apache.hadoop.security.AccessControlException - If access is deniedFileNotFoundException - file src is not foundorg.apache.hadoop.fs.UnresolvedLinkException - If src contains a symlinkIOException - If an I/O error occurredpublic org.apache.hadoop.hdfs.protocol.LocatedBlock addBlock(String src, String clientName, org.apache.hadoop.hdfs.protocol.ExtendedBlock previous, org.apache.hadoop.hdfs.protocol.DatanodeInfo[] excludeNodes, long fileId, String[] favoredNodes) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.hdfs.server.namenode.NotReplicatedYetException, org.apache.hadoop.hdfs.server.namenode.SafeModeException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocoladdBlock in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - 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.org.apache.hadoop.security.AccessControlException - If access is deniedFileNotFoundException - If file src is not foundorg.apache.hadoop.hdfs.server.namenode.NotReplicatedYetException - previous blocks of the file are not
replicated yet. Blocks cannot be added until replication
completes.org.apache.hadoop.hdfs.server.namenode.SafeModeException - create not allowed in safemodeorg.apache.hadoop.fs.UnresolvedLinkException - If src contains a symlinkIOException - If an I/O error occurredpublic org.apache.hadoop.hdfs.protocol.LocatedBlock getAdditionalDatanode(String src, long fileId, org.apache.hadoop.hdfs.protocol.ExtendedBlock blk, org.apache.hadoop.hdfs.protocol.DatanodeInfo[] existings, String[] existingStorageIDs, org.apache.hadoop.hdfs.protocol.DatanodeInfo[] excludes, int numAdditionalNodes, String clientName) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.hdfs.server.namenode.SafeModeException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolgetAdditionalDatanode in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - the file being writtenfileId - the ID of 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 clientorg.apache.hadoop.security.AccessControlException - If access is deniedFileNotFoundException - If file src is not foundorg.apache.hadoop.hdfs.server.namenode.SafeModeException - create not allowed in safemodeorg.apache.hadoop.fs.UnresolvedLinkException - If src contains a symlinkIOException - If an I/O error occurredpublic boolean complete(String src, String clientName, org.apache.hadoop.hdfs.protocol.ExtendedBlock last, long fileId) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.hdfs.server.namenode.SafeModeException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolcomplete in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - the file being createdclientName - the name of the client that adds the blocklast - the last block infofileId - the id uniquely identifying a fileorg.apache.hadoop.security.AccessControlException - If access is deniedFileNotFoundException - If file src is not foundorg.apache.hadoop.hdfs.server.namenode.SafeModeException - create not allowed in safemodeorg.apache.hadoop.fs.UnresolvedLinkException - If src contains a symlinkIOException - If an I/O error occurredpublic void reportBadBlocks(org.apache.hadoop.hdfs.protocol.LocatedBlock[] blocks) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolreportBadBlocks in interface org.apache.hadoop.hdfs.protocol.ClientProtocolblocks - Array of located blocks to reportIOExceptionpublic boolean rename(String src, String dst) throws org.apache.hadoop.fs.UnresolvedLinkException, SnapshotAccessControlException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolrename in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - existing file or directory name.dst - new name.SnapshotAccessControlException - if path is in RO snapshotIOException - an I/O error occurredorg.apache.hadoop.fs.UnresolvedLinkExceptionpublic void concat(String trg, String[] srcs) throws IOException, org.apache.hadoop.fs.UnresolvedLinkException, SnapshotAccessControlException
org.apache.hadoop.hdfs.protocol.ClientProtocolconcat in interface org.apache.hadoop.hdfs.protocol.ClientProtocoltrg - existing filesrcs - - list of existing files (same block size, same replication)IOException - if some arguments are invalidorg.apache.hadoop.fs.UnresolvedLinkException - if trg or srcs
contains a symlinkSnapshotAccessControlException - if path is in RO snapshotpublic void rename2(String src, String dst, org.apache.hadoop.fs.Options.Rename... options) throws org.apache.hadoop.security.AccessControlException, org.apache.hadoop.hdfs.protocol.DSQuotaExceededException, org.apache.hadoop.fs.FileAlreadyExistsException, FileNotFoundException, org.apache.hadoop.hdfs.protocol.NSQuotaExceededException, org.apache.hadoop.fs.ParentNotDirectoryException, org.apache.hadoop.hdfs.server.namenode.SafeModeException, org.apache.hadoop.fs.UnresolvedLinkException, SnapshotAccessControlException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolWithout 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.
rename2 in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - existing file or directory name.dst - new name.options - Rename optionsorg.apache.hadoop.security.AccessControlException - If access is deniedSnapshotAccessControlException - if path is in RO snapshotorg.apache.hadoop.hdfs.protocol.DSQuotaExceededException - If rename violates disk space
quota restrictionorg.apache.hadoop.fs.FileAlreadyExistsException - If dst already exists and
options has Options.Rename.OVERWRITE option
false.FileNotFoundException - If src does not existorg.apache.hadoop.hdfs.protocol.NSQuotaExceededException - If rename violates namespace
quota restrictionorg.apache.hadoop.fs.ParentNotDirectoryException - If parent of dst
is not a directoryorg.apache.hadoop.hdfs.server.namenode.SafeModeException - rename not allowed in safemodeorg.apache.hadoop.fs.UnresolvedLinkException - If src or
dst contains a symlinkIOException - If an I/O error occurredpublic boolean delete(String src, boolean recursive) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.hdfs.server.namenode.SafeModeException, org.apache.hadoop.fs.UnresolvedLinkException, SnapshotAccessControlException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolsame as delete but provides a way to avoid accidentally deleting non empty directories programmatically.
delete in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - existing namerecursive - if true deletes a non empty directory recursively,
else throws an exception.org.apache.hadoop.security.AccessControlException - If access is deniedSnapshotAccessControlException - if path is in RO snapshotFileNotFoundException - If file src is not foundorg.apache.hadoop.hdfs.server.namenode.SafeModeException - create not allowed in safemodeorg.apache.hadoop.fs.UnresolvedLinkException - If src contains a symlinkIOException - If an I/O error occurredpublic boolean mkdirs(String src, org.apache.hadoop.fs.permission.FsPermission masked, boolean createParent) throws org.apache.hadoop.security.AccessControlException, org.apache.hadoop.fs.FileAlreadyExistsException, FileNotFoundException, org.apache.hadoop.hdfs.protocol.NSQuotaExceededException, org.apache.hadoop.fs.ParentNotDirectoryException, org.apache.hadoop.hdfs.server.namenode.SafeModeException, org.apache.hadoop.fs.UnresolvedLinkException, SnapshotAccessControlException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolmkdirs in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - The path of the directory being createdmasked - The masked permission of the directory being createdcreateParent - create missing parent directory if trueorg.apache.hadoop.security.AccessControlException - If access is deniedSnapshotAccessControlException - if path is in RO snapshotorg.apache.hadoop.fs.FileAlreadyExistsException - If src already existsFileNotFoundException - If parent of src does not exist
and createParent is falseorg.apache.hadoop.hdfs.protocol.NSQuotaExceededException - If file creation violates quota restrictionorg.apache.hadoop.fs.ParentNotDirectoryException - If parent of src
is not a directoryorg.apache.hadoop.hdfs.server.namenode.SafeModeException - create not allowed in safemodeorg.apache.hadoop.fs.UnresolvedLinkException - If src contains a symlinkIOException - If an I/O error occurred.
RunTimeExceptions:public org.apache.hadoop.hdfs.protocol.DirectoryListing getListing(String src, byte[] startAfter, boolean needLocation) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolgetListing in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - the directory namestartAfter - the name to start listing after encoded in java UTF8needLocation - if the FileStatus should contain block locationsorg.apache.hadoop.security.AccessControlException - permission deniedFileNotFoundException - file src is not foundorg.apache.hadoop.fs.UnresolvedLinkException - If src contains a symlinkIOException - If an I/O error occurredpublic SnapshottableDirectoryStatus[] getSnapshottableDirListing() throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolgetSnapshottableDirListing in interface org.apache.hadoop.hdfs.protocol.ClientProtocolIOException - If an I/O error occurredpublic void renewLease(String clientName) throws org.apache.hadoop.security.AccessControlException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolSo, 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.
renewLease in interface org.apache.hadoop.hdfs.protocol.ClientProtocolorg.apache.hadoop.security.AccessControlException - permission deniedIOException - If an I/O error occurredpublic boolean recoverLease(String src, String clientName) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolrecoverLease in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - path of the file to start lease recoveryclientName - name of the current clientIOExceptionpublic long[] getStats() throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolClientProtocol.GET_STATS_CAPACITY_IDX in place of
actual numbers to index into the array.getStats in interface org.apache.hadoop.hdfs.protocol.ClientProtocolIOExceptionpublic org.apache.hadoop.hdfs.protocol.DatanodeInfo[] getDatanodeReport(HdfsConstants.DatanodeReportType type) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolgetDatanodeReport in interface org.apache.hadoop.hdfs.protocol.ClientProtocolIOExceptionpublic DatanodeStorageReport[] getDatanodeStorageReport(HdfsConstants.DatanodeReportType type) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolgetDatanodeStorageReport in interface org.apache.hadoop.hdfs.protocol.ClientProtocolIOExceptionpublic long getPreferredBlockSize(String filename) throws IOException, org.apache.hadoop.fs.UnresolvedLinkException
org.apache.hadoop.hdfs.protocol.ClientProtocolgetPreferredBlockSize in interface org.apache.hadoop.hdfs.protocol.ClientProtocolfilename - The name of the fileIOExceptionorg.apache.hadoop.fs.UnresolvedLinkException - if the path contains a symlink.public boolean setSafeMode(HdfsConstants.SafeModeAction action, boolean isChecked) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolSafe 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)
setSafeMode in interface org.apache.hadoop.hdfs.protocol.ClientProtocolaction - isChecked - If true then action will be done only in ActiveNN.IOExceptionpublic void saveNamespace() throws org.apache.hadoop.security.AccessControlException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolSaves current namespace into storage directories and reset edits log. Requires superuser privilege and safe mode.
saveNamespace in interface org.apache.hadoop.hdfs.protocol.ClientProtocolorg.apache.hadoop.security.AccessControlException - if the superuser privilege is violated.IOException - if image creation failed.public long rollEdits() throws org.apache.hadoop.security.AccessControlException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolrollEdits in interface org.apache.hadoop.hdfs.protocol.ClientProtocolorg.apache.hadoop.security.AccessControlException - if the superuser privilege is violatedIOException - if log roll failspublic boolean restoreFailedStorage(String arg) throws org.apache.hadoop.security.AccessControlException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolsets flag to enable restore of failed storage replicas
restoreFailedStorage in interface org.apache.hadoop.hdfs.protocol.ClientProtocolorg.apache.hadoop.security.AccessControlException - if the superuser privilege is violated.IOExceptionpublic void refreshNodes() throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolrefreshNodes in interface org.apache.hadoop.hdfs.protocol.ClientProtocolIOExceptionpublic void finalizeUpgrade() throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolfinalizeUpgrade in interface org.apache.hadoop.hdfs.protocol.ClientProtocolIOExceptionpublic org.apache.hadoop.hdfs.protocol.RollingUpgradeInfo rollingUpgrade(HdfsConstants.RollingUpgradeAction action) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolrollingUpgrade in interface org.apache.hadoop.hdfs.protocol.ClientProtocolaction - either query, prepare or finalize.IOExceptionpublic CorruptFileBlocks listCorruptFileBlocks(String path, String cookie) throws IOException
listCorruptFileBlocks in interface org.apache.hadoop.hdfs.protocol.ClientProtocolIOException - 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.public void metaSave(String filename) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolmetaSave in interface org.apache.hadoop.hdfs.protocol.ClientProtocolIOExceptionpublic void setBalancerBandwidth(long bandwidth) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolsetBalancerBandwidth in interface org.apache.hadoop.hdfs.protocol.ClientProtocolbandwidth - Blanacer bandwidth in bytes per second for this datanode.IOExceptionpublic org.apache.hadoop.hdfs.protocol.HdfsFileStatus getFileInfo(String src) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolgetFileInfo in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - The string representation of the path to the fileorg.apache.hadoop.security.AccessControlException - permission deniedFileNotFoundException - file src is not foundorg.apache.hadoop.fs.UnresolvedLinkException - if the path contains a symlink.IOException - If an I/O error occurredpublic boolean isFileClosed(String src) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolisFileClosed in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - The string representation of the path to the fileorg.apache.hadoop.security.AccessControlException - permission deniedFileNotFoundException - file src is not foundorg.apache.hadoop.fs.UnresolvedLinkException - if the path contains a symlink.IOException - If an I/O error occurredpublic org.apache.hadoop.hdfs.protocol.HdfsFileStatus getFileLinkInfo(String src) throws org.apache.hadoop.security.AccessControlException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolgetFileLinkInfo in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - The string representation of the path to the fileorg.apache.hadoop.security.AccessControlException - permission deniedorg.apache.hadoop.fs.UnresolvedLinkException - if src contains a symlinkIOException - If an I/O error occurredpublic org.apache.hadoop.fs.ContentSummary getContentSummary(String path) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolContentSummary rooted at the specified directory.getContentSummary in interface org.apache.hadoop.hdfs.protocol.ClientProtocolpath - The string representation of the pathorg.apache.hadoop.security.AccessControlException - permission deniedFileNotFoundException - file path is not foundorg.apache.hadoop.fs.UnresolvedLinkException - if path contains a symlink.IOException - If an I/O error occurredpublic void setQuota(String path, long namespaceQuota, long diskspaceQuota) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, SnapshotAccessControlException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolsetQuota in interface org.apache.hadoop.hdfs.protocol.ClientProtocolpath - 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.org.apache.hadoop.security.AccessControlException - permission deniedSnapshotAccessControlException - if path is in RO snapshotFileNotFoundException - file path is not foundorg.apache.hadoop.fs.UnresolvedLinkException - if the path contains a symlink.org.apache.hadoop.hdfs.protocol.QuotaExceededException - if the directory size
is greater than the given quotaIOException - If an I/O error occurredpublic void fsync(String src, long inodeId, String client, long lastBlockLength) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolfsync in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - The string representation of the pathinodeId - The inode ID, or GRANDFATHER_INODE_ID if the client is
too old to support fsync with inode IDs.client - The string representation of the clientlastBlockLength - The length of the last block (under construction)
to be reported to NameNodeorg.apache.hadoop.security.AccessControlException - permission deniedFileNotFoundException - file src is not foundorg.apache.hadoop.fs.UnresolvedLinkException - if src contains a symlink.IOException - If an I/O error occurredpublic void setTimes(String src, long mtime, long atime) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, org.apache.hadoop.fs.UnresolvedLinkException, SnapshotAccessControlException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolsetTimes in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - 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.org.apache.hadoop.security.AccessControlException - permission deniedSnapshotAccessControlException - if path is in RO snapshotFileNotFoundException - file src is not foundorg.apache.hadoop.fs.UnresolvedLinkException - if src contains a symlink.IOException - If an I/O error occurredpublic void createSymlink(String target, String link, org.apache.hadoop.fs.permission.FsPermission dirPerm, boolean createParent) throws org.apache.hadoop.security.AccessControlException, org.apache.hadoop.fs.FileAlreadyExistsException, FileNotFoundException, org.apache.hadoop.fs.ParentNotDirectoryException, org.apache.hadoop.hdfs.server.namenode.SafeModeException, org.apache.hadoop.fs.UnresolvedLinkException, SnapshotAccessControlException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolcreateSymlink in interface org.apache.hadoop.hdfs.protocol.ClientProtocoltarget - 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 existorg.apache.hadoop.security.AccessControlException - permission deniedSnapshotAccessControlException - if path is in RO snapshotorg.apache.hadoop.fs.FileAlreadyExistsException - If file link already existsFileNotFoundException - If parent of link does not exist
and createParent is falseorg.apache.hadoop.fs.ParentNotDirectoryException - If parent of link is not a
directory.org.apache.hadoop.fs.UnresolvedLinkException - if link contains a symlink.IOException - If an I/O error occurredorg.apache.hadoop.hdfs.server.namenode.SafeModeExceptionpublic String getLinkTarget(String path) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolgetLinkTarget in interface org.apache.hadoop.hdfs.protocol.ClientProtocolpath - The path with a link that needs resolution.org.apache.hadoop.security.AccessControlException - permission deniedFileNotFoundException - If path does not existIOException - If the given path does not refer to a symlink
or an I/O error occurredpublic org.apache.hadoop.hdfs.protocol.LocatedBlock updateBlockForPipeline(org.apache.hadoop.hdfs.protocol.ExtendedBlock block, String clientName) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolupdateBlockForPipeline in interface org.apache.hadoop.hdfs.protocol.ClientProtocolblock - a blockclientName - the name of the clientIOException - if any error occurspublic void updatePipeline(String clientName, org.apache.hadoop.hdfs.protocol.ExtendedBlock oldBlock, org.apache.hadoop.hdfs.protocol.ExtendedBlock newBlock, org.apache.hadoop.hdfs.protocol.DatanodeID[] newNodes, String[] newStorageIDs) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolupdatePipeline in interface org.apache.hadoop.hdfs.protocol.ClientProtocolclientName - the name of the clientoldBlock - the old blocknewBlock - the new block containing new generation stamp and lengthnewNodes - datanodes in the pipelineIOException - if any error occurspublic org.apache.hadoop.security.token.Token<org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier> getDelegationToken(org.apache.hadoop.io.Text renewer) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolgetDelegationToken in interface org.apache.hadoop.hdfs.protocol.ClientProtocolrenewer - the designated renewer for the tokenIOExceptionpublic long renewDelegationToken(org.apache.hadoop.security.token.Token<org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier> token) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolrenewDelegationToken in interface org.apache.hadoop.hdfs.protocol.ClientProtocoltoken - delegation token obtained earlierIOExceptionpublic void cancelDelegationToken(org.apache.hadoop.security.token.Token<org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier> token) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolcancelDelegationToken in interface org.apache.hadoop.hdfs.protocol.ClientProtocoltoken - delegation tokenIOExceptionpublic org.apache.hadoop.hdfs.security.token.block.DataEncryptionKey getDataEncryptionKey() throws IOException
getDataEncryptionKey in interface org.apache.hadoop.hdfs.protocol.ClientProtocolIOExceptionpublic String createSnapshot(String snapshotRoot, String snapshotName) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolcreateSnapshot in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsnapshotRoot - the path that is being snapshottedsnapshotName - name of the snapshot createdIOExceptionpublic void deleteSnapshot(String snapshotRoot, String snapshotName) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocoldeleteSnapshot in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsnapshotRoot - The snapshottable directorysnapshotName - Name of the snapshot for the snapshottable directoryIOExceptionpublic void renameSnapshot(String snapshotRoot, String snapshotOldName, String snapshotNewName) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolrenameSnapshot in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsnapshotRoot - the directory path where the snapshot was takensnapshotOldName - old name of the snapshotsnapshotNewName - new name of the snapshotIOExceptionpublic void allowSnapshot(String snapshotRoot) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolallowSnapshot in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsnapshotRoot - the directory to be snappedIOException - on errorpublic void disallowSnapshot(String snapshotRoot) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocoldisallowSnapshot in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsnapshotRoot - the directory to disallow snapshotIOException - on errorpublic SnapshotDiffReport getSnapshotDiffReport(String snapshotRoot, String fromSnapshot, String toSnapshot) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolgetSnapshotDiffReport in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsnapshotRoot - 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 errorpublic long addCacheDirective(CacheDirectiveInfo directive, EnumSet<CacheFlag> flags) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocoladdCacheDirective in interface org.apache.hadoop.hdfs.protocol.ClientProtocoldirective - A CacheDirectiveInfo to be addedflags - CacheFlags to use for this operation.IOException - if the directive could not be addedpublic void modifyCacheDirective(CacheDirectiveInfo directive, EnumSet<CacheFlag> flags) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolmodifyCacheDirective in interface org.apache.hadoop.hdfs.protocol.ClientProtocolflags - CacheFlags to use for this operation.IOException - if the directive could not be modifiedpublic void removeCacheDirective(long id) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolremoveCacheDirective in interface org.apache.hadoop.hdfs.protocol.ClientProtocolid - of a CacheDirectiveInfoIOException - if the cache directive could not be removedpublic org.apache.hadoop.fs.BatchedRemoteIterator.BatchedEntries<CacheDirectiveEntry> listCacheDirectives(long prevId, CacheDirectiveInfo filter) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocollistCacheDirectives in interface org.apache.hadoop.hdfs.protocol.ClientProtocolprevId - The last listed entry ID, or -1 if this is the first call to
listCacheDirectives.filter - Parameters to use to filter the list results,
or null to display all directives visible to us.IOExceptionpublic void addCachePool(CachePoolInfo info) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocoladdCachePool in interface org.apache.hadoop.hdfs.protocol.ClientProtocolinfo - Description of the new cache poolIOException - If the request could not be completed.public void modifyCachePool(CachePoolInfo req) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolmodifyCachePool in interface org.apache.hadoop.hdfs.protocol.ClientProtocolreq - The request to modify a cache pool.IOException - If the request could not be completed.public void removeCachePool(String pool) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolremoveCachePool in interface org.apache.hadoop.hdfs.protocol.ClientProtocolpool - name of the cache pool to remove.IOException - if the cache pool did not exist, or could not be
removed.public org.apache.hadoop.fs.BatchedRemoteIterator.BatchedEntries<CachePoolEntry> listCachePools(String prevPool) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocollistCachePools in interface org.apache.hadoop.hdfs.protocol.ClientProtocolprevPool - name of the last pool listed, or the empty string if this is
the first invocation of listCachePoolsIOExceptionpublic void modifyAclEntries(String src, List<org.apache.hadoop.fs.permission.AclEntry> aclSpec) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolmodifyAclEntries in interface org.apache.hadoop.hdfs.protocol.ClientProtocolIOExceptionpublic void removeAclEntries(String src, List<org.apache.hadoop.fs.permission.AclEntry> aclSpec) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolremoveAclEntries in interface org.apache.hadoop.hdfs.protocol.ClientProtocolIOExceptionpublic void removeDefaultAcl(String src) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolremoveDefaultAcl in interface org.apache.hadoop.hdfs.protocol.ClientProtocolIOExceptionpublic void removeAcl(String src) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolremoveAcl in interface org.apache.hadoop.hdfs.protocol.ClientProtocolIOExceptionpublic void setAcl(String src, List<org.apache.hadoop.fs.permission.AclEntry> aclSpec) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolsetAcl in interface org.apache.hadoop.hdfs.protocol.ClientProtocolIOExceptionpublic org.apache.hadoop.fs.permission.AclStatus getAclStatus(String src) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolgetAclStatus in interface org.apache.hadoop.hdfs.protocol.ClientProtocolIOExceptionpublic void createEncryptionZone(String src, String keyName) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolcreateEncryptionZone in interface org.apache.hadoop.hdfs.protocol.ClientProtocolIOExceptionpublic EncryptionZone getEZForPath(String src) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolgetEZForPath in interface org.apache.hadoop.hdfs.protocol.ClientProtocolIOExceptionpublic org.apache.hadoop.fs.BatchedRemoteIterator.BatchedEntries<EncryptionZone> listEncryptionZones(long prevId) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocollistEncryptionZones in interface org.apache.hadoop.hdfs.protocol.ClientProtocolprevId - ID of the last item in the previous batch. If there is no
previous batch, a negative value can be used.IOExceptionpublic void setXAttr(String src, org.apache.hadoop.fs.XAttr xAttr, EnumSet<org.apache.hadoop.fs.XAttrSetFlag> flag) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolsetXAttr in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - file or directoryxAttr - XAttr to setflag - set flagIOExceptionpublic List<org.apache.hadoop.fs.XAttr> getXAttrs(String src, List<org.apache.hadoop.fs.XAttr> xAttrs) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolgetXAttrs in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - file or directoryxAttrs - xAttrs to getXAttr listIOExceptionpublic List<org.apache.hadoop.fs.XAttr> listXAttrs(String src) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocollistXAttrs in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - file or directoryXAttr listIOExceptionpublic void removeXAttr(String src, org.apache.hadoop.fs.XAttr xAttr) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolremoveXAttr in interface org.apache.hadoop.hdfs.protocol.ClientProtocolsrc - file or directoryxAttr - XAttr to removeIOExceptionpublic void checkAccess(String path, org.apache.hadoop.fs.permission.FsAction mode) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolAccessControlException.
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.checkAccess in interface org.apache.hadoop.hdfs.protocol.ClientProtocolpath - 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 long getCurrentEditLogTxid() throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolgetCurrentEditLogTxid in interface org.apache.hadoop.hdfs.protocol.ClientProtocolIOExceptionpublic org.apache.hadoop.hdfs.inotify.EventBatchList getEditsFromTxid(long txid) throws IOException
org.apache.hadoop.hdfs.protocol.ClientProtocolgetEditsFromTxid in interface org.apache.hadoop.hdfs.protocol.ClientProtocolIOExceptionCopyright © 2015 Apache Software Foundation. All Rights Reserved.