@Test public void testCompareTo() { long ts = 1392217200L; HdfsStatsKey key1 = new HdfsStatsKey(cluster1, path1, (Long.MAX_VALUE - ts)); HdfsStatsKey key2 = new HdfsStatsKey(cluster1, path1, (Long.MAX_VALUE - ts - 10000)); assertTrue(key1.compareTo(key2) > 0); key2 = new HdfsStatsKey(cluster1, path1, (Long.MAX_VALUE - ts + 10000)); assertTrue(key1.compareTo(key2) < 0); key2 = new HdfsStatsKey(cluster1, path1, (Long.MAX_VALUE - ts)); assertTrue(key1.compareTo(key2) == 0); key1 = new HdfsStatsKey(cluster1, path1, namespace1, (Long.MAX_VALUE - ts)); key2 = new HdfsStatsKey(cluster1, path1, namespace1, (Long.MAX_VALUE - ts - 10000)); assertTrue(key1.compareTo(key2) > 0); }
@Override public int compareTo(Object other) { if (other == null) { return -1; } HdfsStatsKey otherKey = (HdfsStatsKey) other; return new CompareToBuilder() .append(this.pathKey, otherKey.getQualifiedPathKey()) .append(this.encodedRunId, otherKey.getEncodedRunId()) .toComparison(); }
HdfsStatsKey implements Comparable<Object> { @Override public int compareTo(Object other) { if (other == null) { return -1; } HdfsStatsKey otherKey = (HdfsStatsKey) other; return new CompareToBuilder() .append(this.pathKey, otherKey.getQualifiedPathKey()) .append(this.encodedRunId, otherKey.getEncodedRunId()) .toComparison(); } }
HdfsStatsKey implements Comparable<Object> { @Override public int compareTo(Object other) { if (other == null) { return -1; } HdfsStatsKey otherKey = (HdfsStatsKey) other; return new CompareToBuilder() .append(this.pathKey, otherKey.getQualifiedPathKey()) .append(this.encodedRunId, otherKey.getEncodedRunId()) .toComparison(); } @JsonCreator  HdfsStatsKey(@JsonProperty("cluster") String cluster,
                @JsonProperty("path") String path,
                @JsonProperty("encodedRunId") long encodedRunId); @JsonCreator  HdfsStatsKey(@JsonProperty("cluster") String cluster,
                @JsonProperty("path") String path,
                @JsonProperty("namespace") String namespace,
                @JsonProperty("encodedRunId") long encodedRunId); @JsonCreator  HdfsStatsKey(@JsonProperty("pathKey") QualifiedPathKey pathKey,
                @JsonProperty("encodedRunId") long encodedRunId);  HdfsStatsKey(HdfsStatsKey key); }
HdfsStatsKey implements Comparable<Object> { @Override public int compareTo(Object other) { if (other == null) { return -1; } HdfsStatsKey otherKey = (HdfsStatsKey) other; return new CompareToBuilder() .append(this.pathKey, otherKey.getQualifiedPathKey()) .append(this.encodedRunId, otherKey.getEncodedRunId()) .toComparison(); } @JsonCreator  HdfsStatsKey(@JsonProperty("cluster") String cluster,
                @JsonProperty("path") String path,
                @JsonProperty("encodedRunId") long encodedRunId); @JsonCreator  HdfsStatsKey(@JsonProperty("cluster") String cluster,
                @JsonProperty("path") String path,
                @JsonProperty("namespace") String namespace,
                @JsonProperty("encodedRunId") long encodedRunId); @JsonCreator  HdfsStatsKey(@JsonProperty("pathKey") QualifiedPathKey pathKey,
                @JsonProperty("encodedRunId") long encodedRunId);  HdfsStatsKey(HdfsStatsKey key); static long getRunId(long encodedRunId); long getRunId(); QualifiedPathKey getQualifiedPathKey(); long getEncodedRunId(); boolean hasFederatedNS(); @Override String toString(); @Override int compareTo(Object other); @Override int hashCode(); @Override boolean equals(Object other); }
HdfsStatsKey implements Comparable<Object> { @Override public int compareTo(Object other) { if (other == null) { return -1; } HdfsStatsKey otherKey = (HdfsStatsKey) other; return new CompareToBuilder() .append(this.pathKey, otherKey.getQualifiedPathKey()) .append(this.encodedRunId, otherKey.getEncodedRunId()) .toComparison(); } @JsonCreator  HdfsStatsKey(@JsonProperty("cluster") String cluster,
                @JsonProperty("path") String path,
                @JsonProperty("encodedRunId") long encodedRunId); @JsonCreator  HdfsStatsKey(@JsonProperty("cluster") String cluster,
                @JsonProperty("path") String path,
                @JsonProperty("namespace") String namespace,
                @JsonProperty("encodedRunId") long encodedRunId); @JsonCreator  HdfsStatsKey(@JsonProperty("pathKey") QualifiedPathKey pathKey,
                @JsonProperty("encodedRunId") long encodedRunId);  HdfsStatsKey(HdfsStatsKey key); static long getRunId(long encodedRunId); long getRunId(); QualifiedPathKey getQualifiedPathKey(); long getEncodedRunId(); boolean hasFederatedNS(); @Override String toString(); @Override int compareTo(Object other); @Override int hashCode(); @Override boolean equals(Object other);  }