hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tgra...@apache.org
Subject svn commit: r1434851 - in /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common: CHANGES.txt src/main/java/org/apache/hadoop/fs/FileStatus.java
Date Thu, 17 Jan 2013 18:29:48 GMT
Author: tgraves
Date: Thu Jan 17 18:29:48 2013
New Revision: 1434851

URL: http://svn.apache.org/viewvc?rev=1434851&view=rev
Log:
HADOOP-7886 Add toString to FileStatus (SreeHari via tgraves)

Modified:
    hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
    hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java

Modified: hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1434851&r1=1434850&r2=1434851&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt Thu
Jan 17 18:29:48 2013
@@ -12,8 +12,10 @@ Release 0.23.7 - UNRELEASED
 
   BUG FIXES
 
-  HADOOP-8157. Fix race condition in Configuration that could cause spurious
-  ClassNotFoundExceptions after a GC. (todd)
+    HADOOP-8157. Fix race condition in Configuration that could cause spurious
+    ClassNotFoundExceptions after a GC. (todd)
+
+    HADOOP-7886 Add toString to FileStatus (SreeHari via tgraves)
 
 Release 0.23.6 - UNRELEASED
 

Modified: hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java?rev=1434851&r1=1434850&r2=1434851&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java
(original)
+++ hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java
Thu Jan 17 18:29:48 2013
@@ -331,4 +331,23 @@ public class FileStatus implements Writa
   public int hashCode() {
     return getPath().hashCode();
   }
+  
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder();
+    sb.append(getClass().getSimpleName()); 
+    sb.append("{");
+    sb.append("path=" + path);
+    sb.append("; isDirectory=" + isdir);
+    if(!isDirectory()){
+      sb.append("; length=" + length);
+      sb.append("; replication=" + block_replication);
+      sb.append("; blocksize=" + blocksize);
+    }
+    sb.append("; owner=" + owner);
+    sb.append("; group=" + group);
+    sb.append("; permission=" + permission);
+    sb.append("}");
+    return sb.toString();
+  }
 }



Mime
View raw message