hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szets...@apache.org
Subject svn commit: r927979 - in /hadoop/common/trunk: CHANGES.txt src/java/org/apache/hadoop/io/WritableComparable.java
Date Fri, 26 Mar 2010 17:38:47 GMT
Author: szetszwo
Date: Fri Mar 26 17:38:47 2010
New Revision: 927979

URL: http://svn.apache.org/viewvc?rev=927979&view=rev
Log:
HADOOP-6654. Fix code example in WritableComparable javadoc.  Contributed by Tom White

Modified:
    hadoop/common/trunk/CHANGES.txt
    hadoop/common/trunk/src/java/org/apache/hadoop/io/WritableComparable.java

Modified: hadoop/common/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/CHANGES.txt?rev=927979&r1=927978&r2=927979&view=diff
==============================================================================
--- hadoop/common/trunk/CHANGES.txt (original)
+++ hadoop/common/trunk/CHANGES.txt Fri Mar 26 17:38:47 2010
@@ -303,6 +303,9 @@ Trunk (unreleased changes)
     HADOOP-6645. Re: Bugs on listStatus for HarFileSystem (rodrigo via
     mahadev)
 
+    HADOOP-6654. Fix code example in WritableComparable javadoc.  (Tom White
+    via szetszwo)
+
 Release 0.21.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/io/WritableComparable.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/io/WritableComparable.java?rev=927979&r1=927978&r2=927979&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/io/WritableComparable.java (original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/io/WritableComparable.java Fri Mar 26 17:38:47
2010
@@ -28,7 +28,9 @@ package org.apache.hadoop.io;
  *  
  * <p>Example:</p>
  * <p><blockquote><pre>
- *     public class MyWritableComparable implements WritableComparable {
+ *     public class MyWritableComparable implements
+ *         WritableComparable&lt;MyWritableComparable&gt; {
+ *
  *       // Some data
  *       private int counter;
  *       private long timestamp;
@@ -43,10 +45,10 @@ package org.apache.hadoop.io;
  *         timestamp = in.readLong();
  *       }
  *       
- *       public int compareTo(MyWritableComparable w) {
- *         int thisValue = this.value;
- *         int thatValue = ((IntWritable)o).value;
- *         return (thisValue &lt; thatValue ? -1 : (thisValue==thatValue ? 0 : 1));
+ *       public int compareTo(MyWritableComparable other) {
+ *         int thisValue = this.counter;
+ *         int thatValue = other.counter;
+ *         return (thisValue &lt; thatValue ? -1 : (thisValue == thatValue ? 0 : 1));
  *       }
  *     }
  * </pre></blockquote></p>



Mime
View raw message