HADOOP-6654. Fix code example in WritableComparable javadoc. Contributed by Tom White
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@927979 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f4d31cd029
commit
6f35c10aab
@ -303,6 +303,9 @@ Trunk (unreleased changes)
|
|||||||
HADOOP-6645. Re: Bugs on listStatus for HarFileSystem (rodrigo via
|
HADOOP-6645. Re: Bugs on listStatus for HarFileSystem (rodrigo via
|
||||||
mahadev)
|
mahadev)
|
||||||
|
|
||||||
|
HADOOP-6654. Fix code example in WritableComparable javadoc. (Tom White
|
||||||
|
via szetszwo)
|
||||||
|
|
||||||
Release 0.21.0 - Unreleased
|
Release 0.21.0 - Unreleased
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
@ -28,7 +28,9 @@
|
|||||||
*
|
*
|
||||||
* <p>Example:</p>
|
* <p>Example:</p>
|
||||||
* <p><blockquote><pre>
|
* <p><blockquote><pre>
|
||||||
* public class MyWritableComparable implements WritableComparable {
|
* public class MyWritableComparable implements
|
||||||
|
* WritableComparable<MyWritableComparable> {
|
||||||
|
*
|
||||||
* // Some data
|
* // Some data
|
||||||
* private int counter;
|
* private int counter;
|
||||||
* private long timestamp;
|
* private long timestamp;
|
||||||
@ -43,10 +45,10 @@
|
|||||||
* timestamp = in.readLong();
|
* timestamp = in.readLong();
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* public int compareTo(MyWritableComparable w) {
|
* public int compareTo(MyWritableComparable other) {
|
||||||
* int thisValue = this.value;
|
* int thisValue = this.counter;
|
||||||
* int thatValue = ((IntWritable)o).value;
|
* int thatValue = other.counter;
|
||||||
* return (thisValue < thatValue ? -1 : (thisValue==thatValue ? 0 : 1));
|
* return (thisValue < thatValue ? -1 : (thisValue == thatValue ? 0 : 1));
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* </pre></blockquote></p>
|
* </pre></blockquote></p>
|
||||||
|
Loading…
Reference in New Issue
Block a user