svn merge -c 1177757 from trunk for HDFS-2298.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1189983 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Tsz-wo Sze 2011-10-27 20:11:50 +00:00
parent 2f6f7e36eb
commit 115dcf19d7
5 changed files with 10 additions and 28 deletions

View File

@ -1134,6 +1134,9 @@ Release 0.23.0 - Unreleased
HDFS-2494. Close the streams and DFSClient in DatanodeWebHdfsMethods. HDFS-2494. Close the streams and DFSClient in DatanodeWebHdfsMethods.
(Uma Maheswara Rao G via szetszwo) (Uma Maheswara Rao G via szetszwo)
HDFS-2298. Fix TestDfsOverAvroRpc by changing ClientProtocol to
not include multiple methods of the same name. (cutting)
BREAKDOWN OF HDFS-1073 SUBTASKS BREAKDOWN OF HDFS-1073 SUBTASKS
HDFS-1521. Persist transaction ID on disk between NN restarts. HDFS-1521. Persist transaction ID on disk between NN restarts.

View File

@ -946,13 +946,13 @@ public void concat(String trg, String [] srcs) throws IOException {
} }
/** /**
* Rename file or directory. * Rename file or directory.
* @see ClientProtocol#rename(String, String, Options.Rename...) * @see ClientProtocol#rename2(String, String, Options.Rename...)
*/ */
public void rename(String src, String dst, Options.Rename... options) public void rename(String src, String dst, Options.Rename... options)
throws IOException { throws IOException {
checkOpen(); checkOpen();
try { try {
namenode.rename(src, dst, options); namenode.rename2(src, dst, options);
} catch(RemoteException re) { } catch(RemoteException re) {
throw re.unwrapRemoteException(AccessControlException.class, throw re.unwrapRemoteException(AccessControlException.class,
DSQuotaExceededException.class, DSQuotaExceededException.class,

View File

@ -67,9 +67,9 @@ public interface ClientProtocol extends VersionedProtocol {
* Compared to the previous version the following changes have been introduced: * Compared to the previous version the following changes have been introduced:
* (Only the latest change is reflected. * (Only the latest change is reflected.
* The log of historical changes can be retrieved from the svn). * The log of historical changes can be retrieved from the svn).
* 68: Add Balancer Bandwidth Command protocol * 69: Eliminate overloaded method names.
*/ */
public static final long versionID = 68L; public static final long versionID = 69L;
/////////////////////////////////////// ///////////////////////////////////////
// File contents // File contents
@ -419,27 +419,12 @@ public void concat(String trg, String[] srcs)
* <code>dst</code> contains a symlink * <code>dst</code> contains a symlink
* @throws IOException If an I/O error occurred * @throws IOException If an I/O error occurred
*/ */
public void rename(String src, String dst, Options.Rename... options) public void rename2(String src, String dst, Options.Rename... options)
throws AccessControlException, DSQuotaExceededException, throws AccessControlException, DSQuotaExceededException,
FileAlreadyExistsException, FileNotFoundException, FileAlreadyExistsException, FileNotFoundException,
NSQuotaExceededException, ParentNotDirectoryException, SafeModeException, NSQuotaExceededException, ParentNotDirectoryException, SafeModeException,
UnresolvedLinkException, IOException; UnresolvedLinkException, IOException;
/**
* Delete the given file or directory from the file system.
* <p>
* Any blocks belonging to the deleted files will be garbage-collected.
*
* @param src existing name.
* @return true only if the existing file or directory was actually removed
* from the file system.
* @throws UnresolvedLinkException if <code>src</code> contains a symlink.
* @deprecated use {@link #delete(String, boolean)} istead.
*/
@Deprecated
public boolean delete(String src)
throws IOException, UnresolvedLinkException;
/** /**
* Delete the given file or directory from the file system. * Delete the given file or directory from the file system.
* <p> * <p>

View File

@ -516,7 +516,7 @@ public void concat(String trg, String[] src) throws IOException {
} }
@Override // ClientProtocol @Override // ClientProtocol
public void rename(String src, String dst, Options.Rename... options) public void rename2(String src, String dst, Options.Rename... options)
throws IOException { throws IOException {
if(stateChangeLog.isDebugEnabled()) { if(stateChangeLog.isDebugEnabled()) {
stateChangeLog.debug("*DIR* NameNode.rename: " + src + " to " + dst); stateChangeLog.debug("*DIR* NameNode.rename: " + src + " to " + dst);
@ -529,12 +529,6 @@ public void rename(String src, String dst, Options.Rename... options)
metrics.incrFilesRenamed(); metrics.incrFilesRenamed();
} }
@Deprecated
@Override // ClientProtocol
public boolean delete(String src) throws IOException {
return delete(src, true);
}
@Override // ClientProtocol @Override // ClientProtocol
public boolean delete(String src, boolean recursive) throws IOException { public boolean delete(String src, boolean recursive) throws IOException {
if (stateChangeLog.isDebugEnabled()) { if (stateChangeLog.isDebugEnabled()) {

View File

@ -309,7 +309,7 @@ public Response run() throws IOException, URISyntaxException {
final String js = JsonUtil.toJsonString("boolean", b); final String js = JsonUtil.toJsonString("boolean", b);
return Response.ok(js).type(MediaType.APPLICATION_JSON).build(); return Response.ok(js).type(MediaType.APPLICATION_JSON).build();
} else { } else {
np.rename(fullpath, destination.getValue(), np.rename2(fullpath, destination.getValue(),
s.toArray(new Options.Rename[s.size()])); s.toArray(new Options.Rename[s.size()]));
return Response.ok().type(MediaType.APPLICATION_JSON).build(); return Response.ok().type(MediaType.APPLICATION_JSON).build();
} }