Kaynağa Gözat

HADOOP-2831. Remove deprecated o.a.h.dfs.INode::getAbsoluteName().
(lohit vijayarenu via cdouglas)




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

Christopher Douglas 17 yıl önce
ebeveyn
işleme
630d6302da

+ 3 - 0
CHANGES.txt

@@ -68,6 +68,9 @@ Trunk (unreleased changes)
     HADOOP-2818.  Remove deprecated methods in Counters.
     (Amareshwari Sriramadasu via tomwhite)
 
+    HADOOP-2831. Remove deprecated o.a.h.dfs.INode::getAbsoluteName()
+    (lohit vijayarenu via cdouglas)
+
   NEW FEATURES
 
     HADOOP-1398.  Add HBase in-memory block cache.  (tomwhite)

+ 3 - 2
src/java/org/apache/hadoop/dfs/FSImage.java

@@ -981,9 +981,10 @@ class FSImage extends Storage {
   // into the input stream
   //
   static void writeINodeUnderConstruction(DataOutputStream out,
-                                           INodeFileUnderConstruction cons) 
+                                           INodeFileUnderConstruction cons,
+                                           String path) 
                                            throws IOException {
-    new UTF8(cons.getAbsoluteName()).write(out);
+    new UTF8(path).write(out);
     out.writeShort(cons.getReplication());
     out.writeLong(cons.getModificationTime());
     out.writeLong(cons.getPreferredBlockSize());

+ 1 - 1
src/java/org/apache/hadoop/dfs/FSNamesystem.java

@@ -4379,7 +4379,7 @@ class FSNamesystem implements FSConstants, FSNamesystemMBean {
                                   " but is not under construction.");
           }
           INodeFileUnderConstruction cons = (INodeFileUnderConstruction) node;
-          FSImage.writeINodeUnderConstruction(out, cons);
+          FSImage.writeINodeUnderConstruction(out, cons, path);
         }
       }
     }

+ 0 - 18
src/java/org/apache/hadoop/dfs/INode.java

@@ -174,24 +174,6 @@ abstract class INode implements Comparable<byte[]> {
     return "\"" + getLocalName() + "\":" + getPermissionStatus();
   }
 
-  /**
-   * Get the full absolute path name of this file (recursively computed).
-   * 
-   * @return the string representation of the absolute path of this file
-   * 
-   * @deprecated this is used only in crc upgrade now, and should be removed 
-   * in order to be able to eliminate the parent field. 
-   */
-  String getAbsoluteName() {
-    if (this.parent == null) {
-      return Path.SEPARATOR;       // root directory is "/"
-    }
-    if (this.parent.parent == null) {
-      return Path.SEPARATOR + getLocalName();
-    }
-    return parent.getAbsoluteName() + Path.SEPARATOR + getLocalName();
-  }
-
   /**
    * Get parent directory 
    * @return parent INode