hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r523072 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/record/Buffer.java src/test/org/apache/hadoop/record/TestRecordIO.java
Date Tue, 27 Mar 2007 20:47:49 GMT
Author: cutting
Date: Tue Mar 27 13:47:48 2007
New Revision: 523072

URL: http://svn.apache.org/viewvc?view=rev&rev=523072
Log:
HADOOP-1162.  Fix a bug in record CSV and XML serialization of binary values.  Contributed
by Milind.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/record/Buffer.java
    lucene/hadoop/trunk/src/test/org/apache/hadoop/record/TestRecordIO.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=523072&r1=523071&r2=523072
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Tue Mar 27 13:47:48 2007
@@ -49,6 +49,12 @@
     (Konstantin Shvachko via cutting)
 
 
+Release 0.12.3 (not yet released)
+
+15. HADOOP-1162.  Fix bug in record CSV and XML serialization of
+    binary values.  (Milind Bhandarkar via cutting)
+
+
 Release 0.12.2 - 2007-23-17
 
  1. HADOOP-1135.  Fix bug in block report processing which may cause

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/record/Buffer.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/record/Buffer.java?view=diff&rev=523072&r1=523071&r2=523072
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/record/Buffer.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/record/Buffer.java Tue Mar 27 13:47:48
2007
@@ -222,7 +222,8 @@
   public String toString() {
     StringBuffer sb = new StringBuffer(2*count);
     for(int idx = 0; idx < count; idx++) {
-      sb.append(Integer.toHexString((int)bytes[idx]));
+      sb.append(Character.forDigit((bytes[idx] & 0xF0) >> 4, 16));
+      sb.append(Character.forDigit(bytes[idx] & 0x0F, 16));
     }
     return sb.toString();
   }

Modified: lucene/hadoop/trunk/src/test/org/apache/hadoop/record/TestRecordIO.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/test/org/apache/hadoop/record/TestRecordIO.java?view=diff&rev=523072&r1=523071&r2=523072
==============================================================================
--- lucene/hadoop/trunk/src/test/org/apache/hadoop/record/TestRecordIO.java (original)
+++ lucene/hadoop/trunk/src/test/org/apache/hadoop/record/TestRecordIO.java Tue Mar 27 13:47:48
2007
@@ -121,7 +121,11 @@
             r1.setIntVal(4567);
             r1.setLongVal(0x5a5a5a5a5a5aL);
             r1.setStringVal("random text");
-            r1.setBufferVal(new Buffer());
+            byte[] barr = new byte[256];
+            for (int idx = 0; idx < 256; idx++) {
+              barr[idx] = (byte) idx;
+            }
+            r1.setBufferVal(new Buffer(barr));
             r1.setVectorVal(new ArrayList<String>());
             r1.setMapVal(new TreeMap<String,String>());
             RecRecord0 r0 = new RecRecord0();



Mime
View raw message