HDFS-8620. Clean up the checkstyle warinings about ClientProtocol. Contributed by Takanobu Asanuma.

This commit is contained in:
Haohui Mai 2015-07-07 14:01:19 -07:00
parent 9bbc3e4ad4
commit b181c13cbf
3 changed files with 293 additions and 323 deletions

View File

@ -43,7 +43,8 @@ public interface HdfsClientConfigKeys {
String DFS_NAMENODE_HTTP_PORT_KEY = "dfs.http.port";
String DFS_NAMENODE_HTTPS_PORT_KEY = "dfs.https.port";
int DFS_NAMENODE_RPC_PORT_DEFAULT = 8020;
String DFS_NAMENODE_KERBEROS_PRINCIPAL_KEY = "dfs.namenode.kerberos.principal";
String DFS_NAMENODE_KERBEROS_PRINCIPAL_KEY =
"dfs.namenode.kerberos.principal";
/** dfs.client.retry configuration properties */
interface Retry {

View File

@ -96,13 +96,14 @@ public interface ClientProtocol {
* 69L is the last version id when this class was used for protocols
* serialization. DO not update this version any further.
*/
public static final long versionID = 69L;
long versionID = 69L;
///////////////////////////////////////
// File contents
///////////////////////////////////////
/**
* Get locations of the blocks of the specified file within the specified range.
* Get locations of the blocks of the specified file
* within the specified range.
* DataNode locations for each block are sorted by
* the proximity to the client.
* <p>
@ -126,11 +127,8 @@ public interface ClientProtocol {
* @throws IOException If an I/O error occurred
*/
@Idempotent
public LocatedBlocks getBlockLocations(String src,
long offset,
long length)
throws AccessControlException, FileNotFoundException,
UnresolvedLinkException, IOException;
LocatedBlocks getBlockLocations(String src, long offset, long length)
throws IOException;
/**
* Get server default values for a number of configuration params.
@ -138,7 +136,7 @@ public interface ClientProtocol {
* @throws IOException
*/
@Idempotent
public FsServerDefaults getServerDefaults() throws IOException;
FsServerDefaults getServerDefaults() throws IOException;
/**
* Create a new file entry in the namespace.
@ -148,8 +146,8 @@ public interface ClientProtocol {
* The name-node does not have a notion of "current" directory for a client.
* <p>
* Once created, the file is visible and available for read to other clients.
* Although, other clients cannot {@link #delete(String, boolean)}, re-create or
* {@link #rename(String, String)} it until the file is completed
* Although, other clients cannot {@link #delete(String, boolean)}, re-create
* or {@link #rename(String, String)} it until the file is completed
* or explicitly as a result of lease expiration.
* <p>
* Blocks have a maximum size. Clients that intend to create
@ -190,15 +188,11 @@ public interface ClientProtocol {
* <em>Note that create with {@link CreateFlag#OVERWRITE} is idempotent.</em>
*/
@AtMostOnce
public HdfsFileStatus create(String src, FsPermission masked,
HdfsFileStatus create(String src, FsPermission masked,
String clientName, EnumSetWritable<CreateFlag> flag,
boolean createParent, short replication, long blockSize,
CryptoProtocolVersion[] supportedVersions)
throws AccessControlException, AlreadyBeingCreatedException,
DSQuotaExceededException, FileAlreadyExistsException,
FileNotFoundException, NSQuotaExceededException,
ParentNotDirectoryException, SafeModeException, UnresolvedLinkException,
SnapshotAccessControlException, IOException;
throws IOException;
/**
* Append to the end of the file.
@ -227,10 +221,8 @@ public interface ClientProtocol {
* @throws UnsupportedOperationException if append is not supported
*/
@AtMostOnce
public LastBlockWithStatus append(String src, String clientName,
EnumSetWritable<CreateFlag> flag) throws AccessControlException,
DSQuotaExceededException, FileNotFoundException, SafeModeException,
UnresolvedLinkException, SnapshotAccessControlException, IOException;
LastBlockWithStatus append(String src, String clientName,
EnumSetWritable<CreateFlag> flag) throws IOException;
/**
* Set replication for an existing file.
@ -256,20 +248,18 @@ public interface ClientProtocol {
* @throws IOException If an I/O error occurred
*/
@Idempotent
public boolean setReplication(String src, short replication)
throws AccessControlException, DSQuotaExceededException,
FileNotFoundException, SafeModeException, UnresolvedLinkException,
SnapshotAccessControlException, IOException;
boolean setReplication(String src, short replication)
throws IOException;
/**
* Get all the available block storage policies.
* @return All the in-use block storage policies currently.
*/
@Idempotent
public BlockStoragePolicy[] getStoragePolicies() throws IOException;
BlockStoragePolicy[] getStoragePolicies() throws IOException;
/**
* Set the storage policy for a file/directory
* Set the storage policy for a file/directory.
* @param src Path of an existing file/directory.
* @param policyName The name of the storage policy
* @throws SnapshotAccessControlException If access is denied
@ -278,9 +268,8 @@ public interface ClientProtocol {
* @throws QuotaExceededException If changes violate the quota restriction
*/
@Idempotent
public void setStoragePolicy(String src, String policyName)
throws SnapshotAccessControlException, UnresolvedLinkException,
FileNotFoundException, QuotaExceededException, IOException;
void setStoragePolicy(String src, String policyName)
throws IOException;
/**
* Set permissions for an existing file/directory.
@ -293,9 +282,8 @@ public interface ClientProtocol {
* @throws IOException If an I/O error occurred
*/
@Idempotent
public void setPermission(String src, FsPermission permission)
throws AccessControlException, FileNotFoundException, SafeModeException,
UnresolvedLinkException, SnapshotAccessControlException, IOException;
void setPermission(String src, FsPermission permission)
throws IOException;
/**
* Set Owner of a path (i.e. a file or a directory).
@ -312,9 +300,8 @@ public interface ClientProtocol {
* @throws IOException If an I/O error occurred
*/
@Idempotent
public void setOwner(String src, String username, String groupname)
throws AccessControlException, FileNotFoundException, SafeModeException,
UnresolvedLinkException, SnapshotAccessControlException, IOException;
void setOwner(String src, String username, String groupname)
throws IOException;
/**
* The client can give up on a block by calling abandonBlock().
@ -334,10 +321,9 @@ public interface ClientProtocol {
* @throws IOException If an I/O error occurred
*/
@Idempotent
public void abandonBlock(ExtendedBlock b, long fileId,
void abandonBlock(ExtendedBlock b, long fileId,
String src, String holder)
throws AccessControlException, FileNotFoundException,
UnresolvedLinkException, IOException;
throws IOException;
/**
* A client that wants to write an additional block to the
@ -372,12 +358,10 @@ public interface ClientProtocol {
* @throws IOException If an I/O error occurred
*/
@Idempotent
public LocatedBlock addBlock(String src, String clientName,
LocatedBlock addBlock(String src, String clientName,
ExtendedBlock previous, DatanodeInfo[] excludeNodes, long fileId,
String[] favoredNodes)
throws AccessControlException, FileNotFoundException,
NotReplicatedYetException, SafeModeException, UnresolvedLinkException,
IOException;
throws IOException;
/**
* Get a datanode for an existing pipeline.
@ -399,14 +383,13 @@ public interface ClientProtocol {
* @throws IOException If an I/O error occurred
*/
@Idempotent
public LocatedBlock getAdditionalDatanode(final String src,
LocatedBlock getAdditionalDatanode(final String src,
final long fileId, final ExtendedBlock blk,
final DatanodeInfo[] existings,
final String[] existingStorageIDs,
final DatanodeInfo[] excludes,
final int numAdditionalNodes, final String clientName
) throws AccessControlException, FileNotFoundException,
SafeModeException, UnresolvedLinkException, IOException;
) throws IOException;
/**
* The client is done writing data to the given filename, and would
@ -438,10 +421,9 @@ public interface ClientProtocol {
* @throws IOException If an I/O error occurred
*/
@Idempotent
public boolean complete(String src, String clientName,
boolean complete(String src, String clientName,
ExtendedBlock last, long fileId)
throws AccessControlException, FileNotFoundException, SafeModeException,
UnresolvedLinkException, IOException;
throws IOException;
/**
* The client wants to report corrupted blocks (blocks with specified
@ -449,7 +431,7 @@ public interface ClientProtocol {
* @param blocks Array of located blocks to report
*/
@Idempotent
public void reportBadBlocks(LocatedBlock[] blocks) throws IOException;
void reportBadBlocks(LocatedBlock[] blocks) throws IOException;
///////////////////////////////////////
// Namespace management
@ -465,11 +447,11 @@ public interface ClientProtocol {
* @throws IOException an I/O error occurred
*/
@AtMostOnce
public boolean rename(String src, String dst)
throws UnresolvedLinkException, SnapshotAccessControlException, IOException;
boolean rename(String src, String dst)
throws IOException;
/**
* Moves blocks from srcs to trg and delete srcs
* Moves blocks from srcs to trg and delete srcs.
*
* @param trg existing file
* @param srcs - list of existing files (same block size, same replication)
@ -479,8 +461,8 @@ public interface ClientProtocol {
* @throws SnapshotAccessControlException if path is in RO snapshot
*/
@AtMostOnce
public void concat(String trg, String[] srcs)
throws IOException, UnresolvedLinkException, SnapshotAccessControlException;
void concat(String trg, String[] srcs)
throws IOException;
/**
* Rename src to dst.
@ -504,7 +486,7 @@ public interface ClientProtocol {
* @throws DSQuotaExceededException If rename violates disk space
* quota restriction
* @throws FileAlreadyExistsException If <code>dst</code> already exists and
* <code>options</options> has {@link Rename#OVERWRITE} option
* <code>options</code> has {@link Rename#OVERWRITE} option
* false.
* @throws FileNotFoundException If <code>src</code> does not exist
* @throws NSQuotaExceededException If rename violates namespace
@ -518,11 +500,8 @@ public interface ClientProtocol {
* @throws IOException If an I/O error occurred
*/
@AtMostOnce
public void rename2(String src, String dst, Options.Rename... options)
throws AccessControlException, DSQuotaExceededException,
FileAlreadyExistsException, FileNotFoundException,
NSQuotaExceededException, ParentNotDirectoryException, SafeModeException,
UnresolvedLinkException, SnapshotAccessControlException, IOException;
void rename2(String src, String dst, Options.Rename... options)
throws IOException;
/**
* Truncate file src to new size.
@ -550,9 +529,8 @@ public interface ClientProtocol {
* @throws IOException If an I/O error occurred
*/
@Idempotent
public boolean truncate(String src, long newLength, String clientName)
throws AccessControlException, FileNotFoundException, SafeModeException,
UnresolvedLinkException, SnapshotAccessControlException, IOException;
boolean truncate(String src, long newLength, String clientName)
throws IOException;
/**
* Delete the given file or directory from the file system.
@ -573,9 +551,8 @@ public interface ClientProtocol {
* @throws IOException If an I/O error occurred
*/
@AtMostOnce
public boolean delete(String src, boolean recursive)
throws AccessControlException, FileNotFoundException, SafeModeException,
UnresolvedLinkException, SnapshotAccessControlException, IOException;
boolean delete(String src, boolean recursive)
throws IOException;
/**
* Create a directory (or hierarchy of directories) with the given
@ -591,7 +568,8 @@ public interface ClientProtocol {
* @throws FileAlreadyExistsException If <code>src</code> already exists
* @throws FileNotFoundException If parent of <code>src</code> does not exist
* and <code>createParent</code> is false
* @throws NSQuotaExceededException If file creation violates quota restriction
* @throws NSQuotaExceededException If file creation violates quota
* restriction
* @throws ParentNotDirectoryException If parent of <code>src</code>
* is not a directory
* @throws SafeModeException create not allowed in safemode
@ -603,14 +581,11 @@ public interface ClientProtocol {
* @throws InvalidPathException If <code>src</code> is invalid
*/
@Idempotent
public boolean mkdirs(String src, FsPermission masked, boolean createParent)
throws AccessControlException, FileAlreadyExistsException,
FileNotFoundException, NSQuotaExceededException,
ParentNotDirectoryException, SafeModeException, UnresolvedLinkException,
SnapshotAccessControlException, IOException;
boolean mkdirs(String src, FsPermission masked, boolean createParent)
throws IOException;
/**
* Get a partial listing of the indicated directory
* Get a partial listing of the indicated directory.
*
* @param src the directory name
* @param startAfter the name to start listing after encoded in java UTF8
@ -624,20 +599,17 @@ public interface ClientProtocol {
* @throws IOException If an I/O error occurred
*/
@Idempotent
public DirectoryListing getListing(String src,
byte[] startAfter,
boolean needLocation)
throws AccessControlException, FileNotFoundException,
UnresolvedLinkException, IOException;
DirectoryListing getListing(String src, byte[] startAfter,
boolean needLocation) throws IOException;
/**
* Get listing of all the snapshottable directories
* Get listing of all the snapshottable directories.
*
* @return Information about all the current snapshottable directory
* @throws IOException If an I/O error occurred
*/
@Idempotent
public SnapshottableDirectoryStatus[] getSnapshottableDirListing()
SnapshottableDirectoryStatus[] getSnapshottableDirListing()
throws IOException;
///////////////////////////////////////
@ -664,8 +636,7 @@ public interface ClientProtocol {
* @throws IOException If an I/O error occurred
*/
@Idempotent
public void renewLease(String clientName) throws AccessControlException,
IOException;
void renewLease(String clientName) throws IOException;
/**
* Start lease recovery.
@ -677,15 +648,15 @@ public interface ClientProtocol {
* @throws IOException
*/
@Idempotent
public boolean recoverLease(String src, String clientName) throws IOException;
boolean recoverLease(String src, String clientName) throws IOException;
public int GET_STATS_CAPACITY_IDX = 0;
public int GET_STATS_USED_IDX = 1;
public int GET_STATS_REMAINING_IDX = 2;
public int GET_STATS_UNDER_REPLICATED_IDX = 3;
public int GET_STATS_CORRUPT_BLOCKS_IDX = 4;
public int GET_STATS_MISSING_BLOCKS_IDX = 5;
public int GET_STATS_MISSING_REPL_ONE_BLOCKS_IDX = 6;
int GET_STATS_CAPACITY_IDX = 0;
int GET_STATS_USED_IDX = 1;
int GET_STATS_REMAINING_IDX = 2;
int GET_STATS_UNDER_REPLICATED_IDX = 3;
int GET_STATS_CORRUPT_BLOCKS_IDX = 4;
int GET_STATS_MISSING_BLOCKS_IDX = 5;
int GET_STATS_MISSING_REPL_ONE_BLOCKS_IDX = 6;
/**
* Get a set of statistics about the filesystem.
@ -704,7 +675,7 @@ public interface ClientProtocol {
* actual numbers to index into the array.
*/
@Idempotent
public long[] getStats() throws IOException;
long[] getStats() throws IOException;
/**
* Get a report on the system's current datanodes.
@ -713,14 +684,14 @@ public interface ClientProtocol {
* otherwise all datanodes if type is ALL.
*/
@Idempotent
public DatanodeInfo[] getDatanodeReport(HdfsConstants.DatanodeReportType type)
DatanodeInfo[] getDatanodeReport(HdfsConstants.DatanodeReportType type)
throws IOException;
/**
* Get a report on the current datanode storages.
*/
@Idempotent
public DatanodeStorageReport[] getDatanodeStorageReport(
DatanodeStorageReport[] getDatanodeStorageReport(
HdfsConstants.DatanodeReportType type) throws IOException;
/**
@ -731,8 +702,8 @@ public interface ClientProtocol {
* @throws UnresolvedLinkException if the path contains a symlink.
*/
@Idempotent
public long getPreferredBlockSize(String filename)
throws IOException, UnresolvedLinkException;
long getPreferredBlockSize(String filename)
throws IOException;
/**
* Enter, leave or get safe mode.
@ -744,7 +715,8 @@ public interface ClientProtocol {
* <p>
* Safe mode is entered automatically at name node startup.
* Safe mode can also be entered manually using
* {@link #setSafeMode(HdfsConstants.SafeModeAction,boolean) setSafeMode(SafeModeAction.SAFEMODE_ENTER,false)}.
* {@link #setSafeMode(HdfsConstants.SafeModeAction,boolean)
* setSafeMode(SafeModeAction.SAFEMODE_ENTER,false)}.
* <p>
* At startup the name node accepts data node reports collecting
* information about block locations.
@ -760,11 +732,14 @@ public interface ClientProtocol {
* Then the name node leaves safe mode.
* <p>
* If safe mode is turned on manually using
* {@link #setSafeMode(HdfsConstants.SafeModeAction,boolean) setSafeMode(SafeModeAction.SAFEMODE_ENTER,false)}
* {@link #setSafeMode(HdfsConstants.SafeModeAction,boolean)
* setSafeMode(SafeModeAction.SAFEMODE_ENTER,false)}
* then the name node stays in safe mode until it is manually turned off
* using {@link #setSafeMode(HdfsConstants.SafeModeAction,boolean) setSafeMode(SafeModeAction.SAFEMODE_LEAVE,false)}.
* using {@link #setSafeMode(HdfsConstants.SafeModeAction,boolean)
* setSafeMode(SafeModeAction.SAFEMODE_LEAVE,false)}.
* Current state of the name node can be verified using
* {@link #setSafeMode(HdfsConstants.SafeModeAction,boolean) setSafeMode(SafeModeAction.SAFEMODE_GET,false)}
* {@link #setSafeMode(HdfsConstants.SafeModeAction,boolean)
* setSafeMode(SafeModeAction.SAFEMODE_GET,false)}
* <h4>Configuration parameters:</h4>
* <tt>dfs.safemode.threshold.pct</tt> is the threshold parameter.<br>
* <tt>dfs.safemode.extension</tt> is the safe mode extension parameter.<br>
@ -790,7 +765,7 @@ public interface ClientProtocol {
* @throws IOException
*/
@Idempotent
public boolean setSafeMode(HdfsConstants.SafeModeAction action, boolean isChecked)
boolean setSafeMode(HdfsConstants.SafeModeAction action, boolean isChecked)
throws IOException;
/**
@ -803,8 +778,7 @@ public interface ClientProtocol {
* @throws IOException if image creation failed.
*/
@AtMostOnce
public void saveNamespace() throws AccessControlException, IOException;
void saveNamespace() throws IOException;
/**
* Roll the edit log.
@ -815,7 +789,7 @@ public interface ClientProtocol {
* @return the txid of the new segment
*/
@Idempotent
public long rollEdits() throws AccessControlException, IOException;
long rollEdits() throws IOException;
/**
* Enable/Disable restore failed storage.
@ -825,15 +799,14 @@ public interface ClientProtocol {
* @throws AccessControlException if the superuser privilege is violated.
*/
@Idempotent
public boolean restoreFailedStorage(String arg)
throws AccessControlException, IOException;
boolean restoreFailedStorage(String arg) throws IOException;
/**
* Tells the namenode to reread the hosts and exclude files.
* @throws IOException
*/
@Idempotent
public void refreshNodes() throws IOException;
void refreshNodes() throws IOException;
/**
* Finalize previous upgrade.
@ -843,7 +816,7 @@ public interface ClientProtocol {
* @throws IOException
*/
@Idempotent
public void finalizeUpgrade() throws IOException;
void finalizeUpgrade() throws IOException;
/**
* Rolling upgrade operations.
@ -852,7 +825,7 @@ public interface ClientProtocol {
* progress, returns null.
*/
@Idempotent
public RollingUpgradeInfo rollingUpgrade(RollingUpgradeAction action)
RollingUpgradeInfo rollingUpgrade(RollingUpgradeAction action)
throws IOException;
/**
@ -866,7 +839,7 @@ public interface ClientProtocol {
* cookie returned from the previous call.
*/
@Idempotent
public CorruptFileBlocks listCorruptFileBlocks(String path, String cookie)
CorruptFileBlocks listCorruptFileBlocks(String path, String cookie)
throws IOException;
/**
@ -876,7 +849,7 @@ public interface ClientProtocol {
* @throws IOException
*/
@Idempotent
public void metaSave(String filename) throws IOException;
void metaSave(String filename) throws IOException;
/**
* Tell all datanodes to use a new, non-persistent bandwidth value for
@ -886,7 +859,7 @@ public interface ClientProtocol {
* @throws IOException
*/
@Idempotent
public void setBalancerBandwidth(long bandwidth) throws IOException;
void setBalancerBandwidth(long bandwidth) throws IOException;
/**
* Get the file info for a specific file or directory.
@ -900,11 +873,10 @@ public interface ClientProtocol {
* @throws IOException If an I/O error occurred
*/
@Idempotent
public HdfsFileStatus getFileInfo(String src) throws AccessControlException,
FileNotFoundException, UnresolvedLinkException, IOException;
HdfsFileStatus getFileInfo(String src) throws IOException;
/**
* Get the close status of a file
* Get the close status of a file.
* @param src The string representation of the path to the file
*
* @return return true if file is closed
@ -914,8 +886,7 @@ public interface ClientProtocol {
* @throws IOException If an I/O error occurred
*/
@Idempotent
public boolean isFileClosed(String src) throws AccessControlException,
FileNotFoundException, UnresolvedLinkException, IOException;
boolean isFileClosed(String src) throws IOException;
/**
* Get the file info for a specific file or directory. If the path
@ -930,8 +901,7 @@ public interface ClientProtocol {
* @throws IOException If an I/O error occurred
*/
@Idempotent
public HdfsFileStatus getFileLinkInfo(String src)
throws AccessControlException, UnresolvedLinkException, IOException;
HdfsFileStatus getFileLinkInfo(String src) throws IOException;
/**
* Get {@link ContentSummary} rooted at the specified directory.
@ -943,21 +913,19 @@ public interface ClientProtocol {
* @throws IOException If an I/O error occurred
*/
@Idempotent
public ContentSummary getContentSummary(String path)
throws AccessControlException, FileNotFoundException,
UnresolvedLinkException, IOException;
ContentSummary getContentSummary(String path) throws IOException;
/**
* Set the quota for a directory.
* @param path The string representation of the path to the directory
* @param namespaceQuota Limit on the number of names in the tree rooted
* at the directory
* @param storagespaceQuota Limit on storage space occupied all the files under
* this directory.
* @param storagespaceQuota Limit on storage space occupied all the files
* under this directory.
* @param type StorageType that the space quota is intended to be set on.
* It may be null when called by traditional space/namespace quota.
* When type is is not null, the storagespaceQuota parameter is for
* type specified and namespaceQuota must be
* It may be null when called by traditional space/namespace
* quota. When type is is not null, the storagespaceQuota
* parameter is for type specified and namespaceQuota must be
* {@link HdfsConstants#QUOTA_DONT_SET}.
*
* <br><br>
@ -971,14 +939,14 @@ public interface ClientProtocol {
* @throws FileNotFoundException file <code>path</code> is not found
* @throws QuotaExceededException if the directory size
* is greater than the given quota
* @throws UnresolvedLinkException if the <code>path</code> contains a symlink.
* @throws UnresolvedLinkException if the <code>path</code> contains
* a symlink.
* @throws SnapshotAccessControlException if path is in RO snapshot
* @throws IOException If an I/O error occurred
*/
@Idempotent
public void setQuota(String path, long namespaceQuota, long storagespaceQuota,
StorageType type) throws AccessControlException, FileNotFoundException,
UnresolvedLinkException, SnapshotAccessControlException, IOException;
void setQuota(String path, long namespaceQuota, long storagespaceQuota,
StorageType type) throws IOException;
/**
* Write all metadata for this file into persistent storage.
@ -995,17 +963,15 @@ public interface ClientProtocol {
* @throws IOException If an I/O error occurred
*/
@Idempotent
public void fsync(String src, long inodeId, String client,
long lastBlockLength)
throws AccessControlException, FileNotFoundException,
UnresolvedLinkException, IOException;
void fsync(String src, long inodeId, String client, long lastBlockLength)
throws IOException;
/**
* Sets the modification and access time of the file to the specified time.
* @param src The string representation of the path
* @param mtime The number of milliseconds since Jan 1, 1970.
* Setting mtime to -1 means that modification time should not be set
* by this call.
* Setting mtime to -1 means that modification time should not
* be set by this call.
* @param atime The number of milliseconds since Jan 1, 1970.
* Setting atime to -1 means that access time should not be set
* by this call.
@ -1017,9 +983,7 @@ public interface ClientProtocol {
* @throws IOException If an I/O error occurred
*/
@Idempotent
public void setTimes(String src, long mtime, long atime)
throws AccessControlException, FileNotFoundException,
UnresolvedLinkException, SnapshotAccessControlException, IOException;
void setTimes(String src, long mtime, long atime) throws IOException;
/**
* Create symlink to a file or directory.
@ -1036,16 +1000,13 @@ public interface ClientProtocol {
* and <code>createParent</code> is false
* @throws ParentNotDirectoryException If parent of <code>link</code> is not a
* directory.
* @throws UnresolvedLinkException if <code>link</target> contains a symlink.
* @throws UnresolvedLinkException if <code>link</code> contains a symlink.
* @throws SnapshotAccessControlException if path is in RO snapshot
* @throws IOException If an I/O error occurred
*/
@AtMostOnce
public void createSymlink(String target, String link, FsPermission dirPerm,
boolean createParent) throws AccessControlException,
FileAlreadyExistsException, FileNotFoundException,
ParentNotDirectoryException, SafeModeException, UnresolvedLinkException,
SnapshotAccessControlException, IOException;
void createSymlink(String target, String link, FsPermission dirPerm,
boolean createParent) throws IOException;
/**
* Return the target of the given symlink. If there is an intermediate
@ -1060,8 +1021,7 @@ public interface ClientProtocol {
* or an I/O error occurred
*/
@Idempotent
public String getLinkTarget(String path) throws AccessControlException,
FileNotFoundException, IOException;
String getLinkTarget(String path) throws IOException;
/**
* Get a new generation stamp together with an access token for
@ -1076,11 +1036,11 @@ public interface ClientProtocol {
* @throws IOException if any error occurs
*/
@Idempotent
public LocatedBlock updateBlockForPipeline(ExtendedBlock block,
LocatedBlock updateBlockForPipeline(ExtendedBlock block,
String clientName) throws IOException;
/**
* Update a pipeline for a block under construction
* Update a pipeline for a block under construction.
*
* @param clientName the name of the client
* @param oldBlock the old block
@ -1089,7 +1049,7 @@ public interface ClientProtocol {
* @throws IOException if any error occurs
*/
@AtMostOnce
public void updatePipeline(String clientName, ExtendedBlock oldBlock,
void updatePipeline(String clientName, ExtendedBlock oldBlock,
ExtendedBlock newBlock, DatanodeID[] newNodes, String[] newStorageIDs)
throws IOException;
@ -1101,7 +1061,7 @@ public interface ClientProtocol {
* @throws IOException
*/
@Idempotent
public Token<DelegationTokenIdentifier> getDelegationToken(Text renewer)
Token<DelegationTokenIdentifier> getDelegationToken(Text renewer)
throws IOException;
/**
@ -1112,7 +1072,7 @@ public interface ClientProtocol {
* @throws IOException
*/
@Idempotent
public long renewDelegationToken(Token<DelegationTokenIdentifier> token)
long renewDelegationToken(Token<DelegationTokenIdentifier> token)
throws IOException;
/**
@ -1122,7 +1082,7 @@ public interface ClientProtocol {
* @throws IOException
*/
@Idempotent
public void cancelDelegationToken(Token<DelegationTokenIdentifier> token)
void cancelDelegationToken(Token<DelegationTokenIdentifier> token)
throws IOException;
/**
@ -1131,38 +1091,38 @@ public interface ClientProtocol {
* @throws IOException
*/
@Idempotent
public DataEncryptionKey getDataEncryptionKey() throws IOException;
DataEncryptionKey getDataEncryptionKey() throws IOException;
/**
* Create a snapshot
* Create a snapshot.
* @param snapshotRoot the path that is being snapshotted
* @param snapshotName name of the snapshot created
* @return the snapshot path.
* @throws IOException
*/
@AtMostOnce
public String createSnapshot(String snapshotRoot, String snapshotName)
String createSnapshot(String snapshotRoot, String snapshotName)
throws IOException;
/**
* Delete a specific snapshot of a snapshottable directory
* Delete a specific snapshot of a snapshottable directory.
* @param snapshotRoot The snapshottable directory
* @param snapshotName Name of the snapshot for the snapshottable directory
* @throws IOException
*/
@AtMostOnce
public void deleteSnapshot(String snapshotRoot, String snapshotName)
void deleteSnapshot(String snapshotRoot, String snapshotName)
throws IOException;
/**
* Rename a snapshot
* Rename a snapshot.
* @param snapshotRoot the directory path where the snapshot was taken
* @param snapshotOldName old name of the snapshot
* @param snapshotNewName new name of the snapshot
* @throws IOException
*/
@AtMostOnce
public void renameSnapshot(String snapshotRoot, String snapshotOldName,
void renameSnapshot(String snapshotRoot, String snapshotOldName,
String snapshotNewName) throws IOException;
/**
@ -1171,7 +1131,7 @@ public interface ClientProtocol {
* @throws IOException on error
*/
@Idempotent
public void allowSnapshot(String snapshotRoot)
void allowSnapshot(String snapshotRoot)
throws IOException;
/**
@ -1180,7 +1140,7 @@ public interface ClientProtocol {
* @throws IOException on error
*/
@Idempotent
public void disallowSnapshot(String snapshotRoot)
void disallowSnapshot(String snapshotRoot)
throws IOException;
/**
@ -1199,7 +1159,7 @@ public interface ClientProtocol {
* @throws IOException on error
*/
@Idempotent
public SnapshotDiffReport getSnapshotDiffReport(String snapshotRoot,
SnapshotDiffReport getSnapshotDiffReport(String snapshotRoot,
String fromSnapshot, String toSnapshot) throws IOException;
/**
@ -1211,7 +1171,7 @@ public interface ClientProtocol {
* @throws IOException if the directive could not be added
*/
@AtMostOnce
public long addCacheDirective(CacheDirectiveInfo directive,
long addCacheDirective(CacheDirectiveInfo directive,
EnumSet<CacheFlag> flags) throws IOException;
/**
@ -1221,7 +1181,7 @@ public interface ClientProtocol {
* @throws IOException if the directive could not be modified
*/
@AtMostOnce
public void modifyCacheDirective(CacheDirectiveInfo directive,
void modifyCacheDirective(CacheDirectiveInfo directive,
EnumSet<CacheFlag> flags) throws IOException;
/**
@ -1231,7 +1191,7 @@ public interface ClientProtocol {
* @throws IOException if the cache directive could not be removed
*/
@AtMostOnce
public void removeCacheDirective(long id) throws IOException;
void removeCacheDirective(long id) throws IOException;
/**
* List the set of cached paths of a cache pool. Incrementally fetches results
@ -1244,7 +1204,7 @@ public interface ClientProtocol {
* @return A batch of CacheDirectiveEntry objects.
*/
@Idempotent
public BatchedEntries<CacheDirectiveEntry> listCacheDirectives(
BatchedEntries<CacheDirectiveEntry> listCacheDirectives(
long prevId, CacheDirectiveInfo filter) throws IOException;
/**
@ -1254,7 +1214,7 @@ public interface ClientProtocol {
* @throws IOException If the request could not be completed.
*/
@AtMostOnce
public void addCachePool(CachePoolInfo info) throws IOException;
void addCachePool(CachePoolInfo info) throws IOException;
/**
* Modify an existing cache pool.
@ -1265,7 +1225,7 @@ public interface ClientProtocol {
* If the request could not be completed.
*/
@AtMostOnce
public void modifyCachePool(CachePoolInfo req) throws IOException;
void modifyCachePool(CachePoolInfo req) throws IOException;
/**
* Remove a cache pool.
@ -1275,17 +1235,17 @@ public interface ClientProtocol {
* removed.
*/
@AtMostOnce
public void removeCachePool(String pool) throws IOException;
void removeCachePool(String pool) throws IOException;
/**
* List the set of cache pools. Incrementally fetches results from the server.
*
* @param prevPool name of the last pool listed, or the empty string if this is
* the first invocation of listCachePools
* @param prevPool name of the last pool listed, or the empty string if this
* is the first invocation of listCachePools
* @return A batch of CachePoolEntry objects.
*/
@Idempotent
public BatchedEntries<CachePoolEntry> listCachePools(String prevPool)
BatchedEntries<CachePoolEntry> listCachePools(String prevPool)
throws IOException;
/**
@ -1295,7 +1255,7 @@ public interface ClientProtocol {
* changes. (Modifications are merged into the current ACL.)
*/
@Idempotent
public void modifyAclEntries(String src, List<AclEntry> aclSpec)
void modifyAclEntries(String src, List<AclEntry> aclSpec)
throws IOException;
/**
@ -1303,14 +1263,14 @@ public interface ClientProtocol {
* retained.
*/
@Idempotent
public void removeAclEntries(String src, List<AclEntry> aclSpec)
void removeAclEntries(String src, List<AclEntry> aclSpec)
throws IOException;
/**
* Removes all default ACL entries from files and directories.
*/
@Idempotent
public void removeDefaultAcl(String src) throws IOException;
void removeDefaultAcl(String src) throws IOException;
/**
* Removes all but the base ACL entries of files and directories. The entries
@ -1318,33 +1278,33 @@ public interface ClientProtocol {
* bits.
*/
@Idempotent
public void removeAcl(String src) throws IOException;
void removeAcl(String src) throws IOException;
/**
* Fully replaces ACL of files and directories, discarding all existing
* entries.
*/
@Idempotent
public void setAcl(String src, List<AclEntry> aclSpec) throws IOException;
void setAcl(String src, List<AclEntry> aclSpec) throws IOException;
/**
* Gets the ACLs of files and directories.
*/
@Idempotent
public AclStatus getAclStatus(String src) throws IOException;
AclStatus getAclStatus(String src) throws IOException;
/**
* Create an encryption zone
* Create an encryption zone.
*/
@AtMostOnce
public void createEncryptionZone(String src, String keyName)
void createEncryptionZone(String src, String keyName)
throws IOException;
/**
* Get the encryption zone for a path.
*/
@Idempotent
public EncryptionZone getEZForPath(String src)
EncryptionZone getEZForPath(String src)
throws IOException;
/**
@ -1355,7 +1315,7 @@ public interface ClientProtocol {
* @return Batch of encryption zones.
*/
@Idempotent
public BatchedEntries<EncryptionZone> listEncryptionZones(
BatchedEntries<EncryptionZone> listEncryptionZones(
long prevId) throws IOException;
/**
@ -1371,7 +1331,7 @@ public interface ClientProtocol {
* @throws IOException
*/
@AtMostOnce
public void setXAttr(String src, XAttr xAttr, EnumSet<XAttrSetFlag> flag)
void setXAttr(String src, XAttr xAttr, EnumSet<XAttrSetFlag> flag)
throws IOException;
/**
@ -1388,7 +1348,7 @@ public interface ClientProtocol {
* @throws IOException
*/
@Idempotent
public List<XAttr> getXAttrs(String src, List<XAttr> xAttrs)
List<XAttr> getXAttrs(String src, List<XAttr> xAttrs)
throws IOException;
/**
@ -1403,7 +1363,7 @@ public interface ClientProtocol {
* @throws IOException
*/
@Idempotent
public List<XAttr> listXAttrs(String src)
List<XAttr> listXAttrs(String src)
throws IOException;
/**
@ -1418,7 +1378,7 @@ public interface ClientProtocol {
* @throws IOException
*/
@AtMostOnce
public void removeXAttr(String src, XAttr xAttr) throws IOException;
void removeXAttr(String src, XAttr xAttr) throws IOException;
/**
* Checks if the user can access a path. The mode specifies which access
@ -1436,7 +1396,7 @@ public interface ClientProtocol {
* @throws IOException see specific implementation
*/
@Idempotent
public void checkAccess(String path, FsAction mode) throws IOException;
void checkAccess(String path, FsAction mode) throws IOException;
/**
* Get the highest txid the NameNode knows has been written to the edit
@ -1444,12 +1404,12 @@ public interface ClientProtocol {
* the starting point for the inotify event stream.
*/
@Idempotent
public long getCurrentEditLogTxid() throws IOException;
long getCurrentEditLogTxid() throws IOException;
/**
* Get an ordered list of batches of events corresponding to the edit log
* transactions for txids equal to or greater than txid.
*/
@Idempotent
public EventBatchList getEditsFromTxid(long txid) throws IOException;
EventBatchList getEditsFromTxid(long txid) throws IOException;
}

View File

@ -362,6 +362,15 @@ Release 2.8.0 - UNRELEASED
HDFS-8709. Clarify automatic sync in FSEditLog#logEdit. (wang)
<<<<<<< HEAD
=======
HDFS-8711. setSpaceQuota command should print the available storage type
when input storage type is wrong. (Brahma Reddy Battula via xyao)
HDFS-8620. Clean up the checkstyle warinings about ClientProtocol.
(Takanobu Asanuma via wheat9)
>>>>>>> c0b8e4e... HDFS-8620. Clean up the checkstyle warinings about ClientProtocol. Contributed by Takanobu Asanuma.
OPTIMIZATIONS
HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than