浏览代码

HADOOP-2994. Code cleanup for DFSClient: remove redundant
conversions from string to string. (Dave Brosius via dhruba)



git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@636846 13f79535-47bb-0310-9956-ffa450edef68

Dhruba Borthakur 17 年之前
父节点
当前提交
944816ea2e
共有 2 个文件被更改,包括 6 次插入3 次删除
  1. 3 0
      CHANGES.txt
  2. 3 3
      src/java/org/apache/hadoop/dfs/DFSClient.java

+ 3 - 0
CHANGES.txt

@@ -196,6 +196,9 @@ Trunk (unreleased changes)
     HADOOP-2972. Fix for a NPE in FSDataset.invalidate.
     (Mahadev Konar via dhruba)
 
+    HADOOP-2994. Code cleanup for DFSClient: remove redundant 
+    conversions from string to string.  (Dave Brosius via dhruba)
+
 Release 0.16.1 - 2008-03-13
 
   INCOMPATIBLE CHANGES

+ 3 - 3
src/java/org/apache/hadoop/dfs/DFSClient.java

@@ -407,7 +407,7 @@ class DFSClient implements FSConstants {
     OutputStream result = new DFSOutputStream(src, masked,
         overwrite, replication, blockSize, progress, buffersize);
     synchronized (pendingCreates) {
-      pendingCreates.put(src.toString(), result);
+      pendingCreates.put(src, result);
     }
     return result;
   }
@@ -2192,7 +2192,7 @@ class DFSClient implements FSConstants {
         long localstart = System.currentTimeMillis();
         while (true) {
           try {
-            return namenode.addBlock(src.toString(), clientName);
+            return namenode.addBlock(src, clientName);
           } catch (RemoteException e) {
             if (--retries == 0 && 
                 !NotReplicatedYetException.class.getName().
@@ -2514,7 +2514,7 @@ class DFSClient implements FSConstants {
         long localstart = System.currentTimeMillis();
         boolean fileComplete = false;
         while (!fileComplete) {
-          fileComplete = namenode.complete(src.toString(), clientName);
+          fileComplete = namenode.complete(src, clientName);
           if (!fileComplete) {
             try {
               Thread.sleep(400);