Revision 48701
Added by Sandro La Bruzzo over 6 years ago
DNGFKey.java | ||
---|---|---|
7 | 7 |
import com.google.common.collect.ComparisonChain; |
8 | 8 |
import org.apache.hadoop.io.IntWritable; |
9 | 9 |
import org.apache.hadoop.io.Text; |
10 |
import org.apache.hadoop.io.Writable; |
|
10 | 11 |
import org.apache.hadoop.io.WritableComparable; |
11 | 12 |
|
12 | 13 |
/** |
13 | 14 |
* Created by claudio on 13/03/2017. |
14 | 15 |
*/ |
15 |
public class DNGFKey implements WritableComparable<DNGFKey> { |
|
16 |
public class DNGFKey implements Writable, WritableComparable<DNGFKey> {
|
|
16 | 17 |
|
17 | 18 |
public final static int MERGES_REL = 0; |
18 | 19 |
public final static int OTHER_REL = 1; |
... | ... | |
58 | 59 |
|
59 | 60 |
@Override |
60 | 61 |
public int compareTo(final DNGFKey o) { |
61 |
return ComparisonChain.start() |
|
62 |
.compare(getKeyType(), o.getKeyType()) |
|
63 |
.compare(getId(), o.getId()) |
|
64 |
.result(); |
|
62 |
int compareValue = this.id.toString().compareTo(o.getId().toString()); |
|
63 |
if (compareValue == 0) { |
|
64 |
compareValue = this.keyType.compareTo(o.getKeyType()); |
|
65 |
} |
|
66 |
return compareValue; // sort ascending |
|
65 | 67 |
} |
66 | 68 |
|
67 | 69 |
@Override |
Also available in: Unified diff
Upgraded incremental harvesting and other stuff