hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Owen O'Malley" <omal...@apache.org>
Subject Re: It is possible a bug,about BooleanWritable
Date Mon, 26 Jul 2010 04:36:50 GMT
It is a bug. It was fixed as part of MAPREDUCE-365. The relevant fix is:

Index: src/java/org/apache/hadoop/io/BooleanWritable.java
===================================================================
--- src/java/org/apache/hadoop/io/BooleanWritable.java  (revision 769338)
+++ src/java/org/apache/hadoop/io/BooleanWritable.java  (revision 769339)
@@ -100,9 +100,7 @@

     public int compare(byte[] b1, int s1, int l1,
                        byte[] b2, int s2, int l2) {
-      boolean a = (readInt(b1, s1) == 1) ? true : false;
-      boolean b = (readInt(b2, s2) == 1) ? true : false;
-      return ((a == b) ? 0 : (a == false) ? -1 : 1);
+      return compareBytes(b1, s1, l1, b2, s2, l2);
     }
   }


-- Owen

Mime
View raw message