hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From umamah...@apache.org
Subject svn commit: r1592561 - in /hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common: CHANGES-HDFS-2006.txt src/main/java/org/apache/hadoop/fs/shell/XAttrCommands.java src/test/java/org/apache/hadoop/fs/shell/TestXAttrCommands.java
Date Mon, 05 May 2014 15:59:00 GMT
Author: umamahesh
Date: Mon May  5 15:59:00 2014
New Revision: 1592561

URL: http://svn.apache.org/r1592561
Log:
HADOOP-10575. Small fixes for XAttrCommands and test. Contributed by Yi Liu.

Modified:
    hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/CHANGES-HDFS-2006.txt
    hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/XAttrCommands.java
    hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/shell/TestXAttrCommands.java

Modified: hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/CHANGES-HDFS-2006.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/CHANGES-HDFS-2006.txt?rev=1592561&r1=1592560&r2=1592561&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/CHANGES-HDFS-2006.txt
(original)
+++ hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/CHANGES-HDFS-2006.txt
Mon May  5 15:59:00 2014
@@ -8,18 +8,20 @@ HDFS-2006 (Unreleased)
 
   IMPROVEMENTS
 
-  HADOOP-10520. Extended attributes definition and FileSystem APIs for
-  extended attributes. (Yi Liu via wang)
+    HADOOP-10520. Extended attributes definition and FileSystem APIs for
+    extended attributes. (Yi Liu via wang)
 
-  HADOOP-10546. Javadoc and other small fixes for extended attributes in
-  hadoop-common. (Charles Lamb via wang)
+    HADOOP-10546. Javadoc and other small fixes for extended attributes in
+    hadoop-common. (Charles Lamb via wang)
 
-  HADOOP-10521. FsShell commands for extended attributes. (Yi Liu via wang)
+    HADOOP-10521. FsShell commands for extended attributes. (Yi Liu via wang)
 
-  HADOOP-10548. Improve FsShell xattr error handling and other fixes. (Charles Lamb via umamahesh)
+    HADOOP-10548. Improve FsShell xattr error handling and other fixes. (Charles Lamb via
umamahesh)
 
-  HADOOP-10567. Shift XAttr value encoding code out for reuse. (Yi Liu via umamahesh)
+    HADOOP-10567. Shift XAttr value encoding code out for reuse. (Yi Liu via umamahesh)
 
   OPTIMIZATIONS
 
   BUG FIXES
+    
+    HADOOP-10575. Small fixes for XAttrCommands and test. (Yi Liu via umamahesh)

Modified: hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/XAttrCommands.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/XAttrCommands.java?rev=1592561&r1=1592560&r2=1592561&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/XAttrCommands.java
(original)
+++ hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/XAttrCommands.java
Mon May  5 15:59:00 2014
@@ -118,10 +118,12 @@ class XAttrCommands extends FsCommand {
     }
     
     private void printXAttr(String name, byte[] value) throws IOException{
-      if (value != null && value.length != 0) {
-        out.println(name + "=" + XAttrCodec.encodeValue(value, encoding));
-      } else {
-        out.println(name);
+      if (value != null) {
+        if (value.length != 0) {
+          out.println(name + "=" + XAttrCodec.encodeValue(value, encoding));
+        } else {
+          out.println(name);
+        }
       }
     }
   }

Modified: hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/shell/TestXAttrCommands.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/shell/TestXAttrCommands.java?rev=1592561&r1=1592560&r2=1592561&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/shell/TestXAttrCommands.java
(original)
+++ hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/shell/TestXAttrCommands.java
Mon May  5 15:59:00 2014
@@ -27,6 +27,7 @@ import java.io.PrintStream;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FsShell;
 import org.apache.hadoop.util.ToolRunner;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -34,12 +35,21 @@ public class TestXAttrCommands {
   private final ByteArrayOutputStream errContent = 
       new ByteArrayOutputStream();
   private Configuration conf = null;
+  private PrintStream initialStdErr;
 
   @Before
   public void setup() throws IOException {
+    errContent.reset();
+    initialStdErr = System.err;
     System.setErr(new PrintStream(errContent));
     conf = new Configuration();
   }
+  
+  @After
+  public void cleanUp() throws Exception {
+    errContent.reset();
+    System.setErr(initialStdErr);
+  }
 
   @Test
   public void testGetfattrValidations() throws Exception {



Mime
View raw message