소스 검색

HDFS-6335. TestOfflineEditsViewer for XAttr. Contributed by Yi Liu

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-2006@1592550 13f79535-47bb-0310-9956-ffa450edef68
Uma Maheswara Rao G 11 년 전
부모
커밋
e60e19dcb7

+ 2 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-2006.txt

@@ -29,3 +29,5 @@ HDFS-2006 (Unreleased)
 
     HDFS-6331. ClientProtocol#setXattr should not be annotated idempotent.
     (umamahesh via wang)
+
+    HDFS-6335. TestOfflineEditsViewer for XAttr. (Yi Liu via umamahesh)

+ 5 - 0
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java

@@ -1134,6 +1134,11 @@ public class DFSTestUtil {
             .setType(AclEntryType.OTHER)
             .build());
     filesystem.setAcl(pathConcatTarget, aclEntryList);
+    // OP_SET_XATTRS
+    filesystem.setXAttr(pathConcatTarget, "user.a1", 
+        new byte[]{0x31, 0x32, 0x33});
+    filesystem.setXAttr(pathConcatTarget, "user.a2", 
+        new byte[]{0x37, 0x38, 0x39});
   }
 
   public static void abortStream(DFSOutputStream out) throws IOException {

BIN
hadoop-hdfs-project/hadoop-hdfs/src/test/resources/editsStored


+ 9 - 2
hadoop-hdfs-project/hadoop-hdfs/src/test/resources/editsStored.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <EDITS>
-  <EDITS_VERSION>-56</EDITS_VERSION>
+  <EDITS_VERSION>-57</EDITS_VERSION>
   <RECORD>
     <OPCODE>OP_START_LOG_SEGMENT</OPCODE>
     <DATA>
@@ -938,9 +938,16 @@
     </DATA>
   </RECORD>
   <RECORD>
-    <OPCODE>OP_END_LOG_SEGMENT</OPCODE>
+    <OPCODE>OP_SET_XATTRS</OPCODE>
     <DATA>
       <TXID>75</TXID>
+      <SRC>/file_concat_target</SRC>
+    </DATA>
+  </RECORD>
+  <RECORD>
+    <OPCODE>OP_END_LOG_SEGMENT</OPCODE>
+    <DATA>
+      <TXID>76</TXID>
     </DATA>
   </RECORD>
 </EDITS>