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 b68701b7b2
commit c0b8e4e5b5
3 changed files with 287 additions and 323 deletions

View File

@ -39,7 +39,8 @@ public interface HdfsClientConfigKeys {
String DFS_NAMENODE_HTTPS_ADDRESS_KEY = "dfs.namenode.https-address";
String DFS_HA_NAMENODES_KEY_PREFIX = "dfs.ha.namenodes";
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 LocatedBlocks getBlockLocations(String src,
* @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 LocatedBlocks getBlockLocations(String src,
* 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 LocatedBlocks getBlockLocations(String src,
* <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 HdfsFileStatus create(String src, FsPermission masked,
* @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 LastBlockWithStatus append(String src, String clientName,
* @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 boolean setReplication(String src, short replication)
* @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 void setStoragePolicy(String src, String policyName)
* @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 void setPermission(String src, FsPermission permission)
* @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 void setOwner(String src, String username, String groupname)
* @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 void abandonBlock(ExtendedBlock b, long fileId,
* @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 LocatedBlock addBlock(String src, String clientName,
* @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 LocatedBlock getAdditionalDatanode(final String src,
* @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 boolean complete(String src, String clientName,
* @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 boolean complete(String src, String clientName,
* @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 boolean rename(String src, String dst)
* @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 void concat(String trg, String[] srcs)
* @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 void concat(String trg, String[] srcs)
* @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 void rename2(String src, String dst, Options.Rename... options)
* @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 boolean truncate(String src, long newLength, String clientName)
* @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 boolean delete(String src, boolean recursive)
* @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 boolean delete(String src, boolean recursive)
* @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 boolean mkdirs(String src, FsPermission masked, boolean createParent)
* @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 SnapshottableDirectoryStatus[] getSnapshottableDirListing()
* @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 void renewLease(String clientName) throws AccessControlException,
* @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 void renewLease(String clientName) throws AccessControlException,
* 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 void renewLease(String clientName) throws AccessControlException,
* 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 DatanodeStorageReport[] getDatanodeStorageReport(
* @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 long getPreferredBlockSize(String filename)
* <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 long getPreferredBlockSize(String filename)
* 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 long getPreferredBlockSize(String filename)
* @throws IOException
*/
@Idempotent
public boolean setSafeMode(HdfsConstants.SafeModeAction action, boolean isChecked)
boolean setSafeMode(HdfsConstants.SafeModeAction action, boolean isChecked)
throws IOException;
/**
@ -808,8 +783,7 @@ public boolean setSafeMode(HdfsConstants.SafeModeAction action, boolean isChecke
* @throws IOException if image creation failed.
*/
@AtMostOnce
public boolean saveNamespace(long timeWindow, long txGap) throws IOException;
boolean saveNamespace(long timeWindow, long txGap) throws IOException;
/**
* Roll the edit log.
@ -820,7 +794,7 @@ public boolean setSafeMode(HdfsConstants.SafeModeAction action, boolean isChecke
* @return the txid of the new segment
*/
@Idempotent
public long rollEdits() throws AccessControlException, IOException;
long rollEdits() throws IOException;
/**
* Enable/Disable restore failed storage.
@ -830,15 +804,14 @@ public boolean setSafeMode(HdfsConstants.SafeModeAction action, boolean isChecke
* @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.
@ -848,7 +821,7 @@ public boolean restoreFailedStorage(String arg)
* @throws IOException
*/
@Idempotent
public void finalizeUpgrade() throws IOException;
void finalizeUpgrade() throws IOException;
/**
* Rolling upgrade operations.
@ -857,7 +830,7 @@ public boolean restoreFailedStorage(String arg)
* progress, returns null.
*/
@Idempotent
public RollingUpgradeInfo rollingUpgrade(RollingUpgradeAction action)
RollingUpgradeInfo rollingUpgrade(RollingUpgradeAction action)
throws IOException;
/**
@ -871,7 +844,7 @@ public RollingUpgradeInfo rollingUpgrade(RollingUpgradeAction action)
* cookie returned from the previous call.
*/
@Idempotent
public CorruptFileBlocks listCorruptFileBlocks(String path, String cookie)
CorruptFileBlocks listCorruptFileBlocks(String path, String cookie)
throws IOException;
/**
@ -881,7 +854,7 @@ public CorruptFileBlocks listCorruptFileBlocks(String path, String cookie)
* @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
@ -891,7 +864,7 @@ public CorruptFileBlocks listCorruptFileBlocks(String path, String cookie)
* @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.
@ -905,11 +878,10 @@ public CorruptFileBlocks listCorruptFileBlocks(String path, String cookie)
* @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
@ -919,8 +891,7 @@ public HdfsFileStatus getFileInfo(String src) throws AccessControlException,
* @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
@ -935,8 +906,7 @@ public boolean isFileClosed(String src) throws AccessControlException,
* @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.
@ -948,21 +918,19 @@ public HdfsFileStatus getFileLinkInfo(String src)
* @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>
@ -976,14 +944,14 @@ public ContentSummary getContentSummary(String path)
* @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.
@ -1000,17 +968,15 @@ public void setQuota(String path, long namespaceQuota, long storagespaceQuota,
* @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.
@ -1022,9 +988,7 @@ public void fsync(String src, long inodeId, String client,
* @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.
@ -1041,16 +1005,13 @@ public void setTimes(String src, long mtime, long atime)
* 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
@ -1065,8 +1026,7 @@ public void createSymlink(String target, String link, FsPermission dirPerm,
* 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
@ -1081,11 +1041,11 @@ public String getLinkTarget(String path) throws AccessControlException,
* @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
@ -1094,7 +1054,7 @@ public LocatedBlock updateBlockForPipeline(ExtendedBlock block,
* @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;
@ -1106,7 +1066,7 @@ public void updatePipeline(String clientName, ExtendedBlock oldBlock,
* @throws IOException
*/
@Idempotent
public Token<DelegationTokenIdentifier> getDelegationToken(Text renewer)
Token<DelegationTokenIdentifier> getDelegationToken(Text renewer)
throws IOException;
/**
@ -1117,7 +1077,7 @@ public Token<DelegationTokenIdentifier> getDelegationToken(Text renewer)
* @throws IOException
*/
@Idempotent
public long renewDelegationToken(Token<DelegationTokenIdentifier> token)
long renewDelegationToken(Token<DelegationTokenIdentifier> token)
throws IOException;
/**
@ -1127,7 +1087,7 @@ public long renewDelegationToken(Token<DelegationTokenIdentifier> token)
* @throws IOException
*/
@Idempotent
public void cancelDelegationToken(Token<DelegationTokenIdentifier> token)
void cancelDelegationToken(Token<DelegationTokenIdentifier> token)
throws IOException;
/**
@ -1136,38 +1096,38 @@ public void cancelDelegationToken(Token<DelegationTokenIdentifier> token)
* @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;
/**
@ -1176,7 +1136,7 @@ public void renameSnapshot(String snapshotRoot, String snapshotOldName,
* @throws IOException on error
*/
@Idempotent
public void allowSnapshot(String snapshotRoot)
void allowSnapshot(String snapshotRoot)
throws IOException;
/**
@ -1185,7 +1145,7 @@ public void allowSnapshot(String snapshotRoot)
* @throws IOException on error
*/
@Idempotent
public void disallowSnapshot(String snapshotRoot)
void disallowSnapshot(String snapshotRoot)
throws IOException;
/**
@ -1204,7 +1164,7 @@ public void disallowSnapshot(String snapshotRoot)
* @throws IOException on error
*/
@Idempotent
public SnapshotDiffReport getSnapshotDiffReport(String snapshotRoot,
SnapshotDiffReport getSnapshotDiffReport(String snapshotRoot,
String fromSnapshot, String toSnapshot) throws IOException;
/**
@ -1216,7 +1176,7 @@ public SnapshotDiffReport getSnapshotDiffReport(String snapshotRoot,
* @throws IOException if the directive could not be added
*/
@AtMostOnce
public long addCacheDirective(CacheDirectiveInfo directive,
long addCacheDirective(CacheDirectiveInfo directive,
EnumSet<CacheFlag> flags) throws IOException;
/**
@ -1226,7 +1186,7 @@ public long addCacheDirective(CacheDirectiveInfo directive,
* @throws IOException if the directive could not be modified
*/
@AtMostOnce
public void modifyCacheDirective(CacheDirectiveInfo directive,
void modifyCacheDirective(CacheDirectiveInfo directive,
EnumSet<CacheFlag> flags) throws IOException;
/**
@ -1236,7 +1196,7 @@ public void modifyCacheDirective(CacheDirectiveInfo directive,
* @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
@ -1249,7 +1209,7 @@ public void modifyCacheDirective(CacheDirectiveInfo directive,
* @return A batch of CacheDirectiveEntry objects.
*/
@Idempotent
public BatchedEntries<CacheDirectiveEntry> listCacheDirectives(
BatchedEntries<CacheDirectiveEntry> listCacheDirectives(
long prevId, CacheDirectiveInfo filter) throws IOException;
/**
@ -1259,7 +1219,7 @@ public BatchedEntries<CacheDirectiveEntry> listCacheDirectives(
* @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.
@ -1270,7 +1230,7 @@ public BatchedEntries<CacheDirectiveEntry> listCacheDirectives(
* 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.
@ -1280,17 +1240,17 @@ public BatchedEntries<CacheDirectiveEntry> listCacheDirectives(
* 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;
/**
@ -1300,7 +1260,7 @@ public BatchedEntries<CachePoolEntry> listCachePools(String prevPool)
* 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;
/**
@ -1308,14 +1268,14 @@ public void modifyAclEntries(String src, List<AclEntry> aclSpec)
* 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
@ -1323,33 +1283,33 @@ public void removeAclEntries(String src, List<AclEntry> aclSpec)
* 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;
/**
@ -1360,7 +1320,7 @@ public EncryptionZone getEZForPath(String src)
* @return Batch of encryption zones.
*/
@Idempotent
public BatchedEntries<EncryptionZone> listEncryptionZones(
BatchedEntries<EncryptionZone> listEncryptionZones(
long prevId) throws IOException;
/**
@ -1376,7 +1336,7 @@ public BatchedEntries<EncryptionZone> listEncryptionZones(
* @throws IOException
*/
@AtMostOnce
public void setXAttr(String src, XAttr xAttr, EnumSet<XAttrSetFlag> flag)
void setXAttr(String src, XAttr xAttr, EnumSet<XAttrSetFlag> flag)
throws IOException;
/**
@ -1393,7 +1353,7 @@ public void setXAttr(String src, XAttr xAttr, EnumSet<XAttrSetFlag> flag)
* @throws IOException
*/
@Idempotent
public List<XAttr> getXAttrs(String src, List<XAttr> xAttrs)
List<XAttr> getXAttrs(String src, List<XAttr> xAttrs)
throws IOException;
/**
@ -1408,7 +1368,7 @@ public List<XAttr> getXAttrs(String src, List<XAttr> xAttrs)
* @throws IOException
*/
@Idempotent
public List<XAttr> listXAttrs(String src)
List<XAttr> listXAttrs(String src)
throws IOException;
/**
@ -1423,7 +1383,7 @@ public List<XAttr> listXAttrs(String src)
* @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
@ -1441,7 +1401,7 @@ public List<XAttr> listXAttrs(String src)
* @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
@ -1449,12 +1409,12 @@ public List<XAttr> listXAttrs(String src)
* 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

@ -704,6 +704,9 @@ Release 2.8.0 - UNRELEASED
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)
OPTIMIZATIONS
HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than