Author: jbellis
Date: Thu Oct 1 02:49:54 2009
New Revision: 820511
URL: http://svn.apache.org/viewvc?rev=820511&view=rev
Log:
make token, key in DecoratedKey public final in accordance with style guide.
patch by jbellis for CASSANDRA-467; tested by dispalt
Modified:
incubator/cassandra/trunk/src/java/org/apache/cassandra/db/DecoratedKey.java
incubator/cassandra/trunk/src/java/org/apache/cassandra/dht/CollatingOrderPreservingPartitioner.java
incubator/cassandra/trunk/src/java/org/apache/cassandra/dht/OrderPreservingPartitioner.java
incubator/cassandra/trunk/src/java/org/apache/cassandra/dht/RandomPartitioner.java
Modified:
incubator/cassandra/trunk/src/java/org/apache/cassandra/db/DecoratedKey.java
URL:
http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/DecoratedKey.java?rev=820511&r1=820510&r2=820511&view=diff
==============================================================================
---
incubator/cassandra/trunk/src/java/org/apache/cassandra/db/DecoratedKey.java
(original)
+++
incubator/cassandra/trunk/src/java/org/apache/cassandra/db/DecoratedKey.java
Thu Oct 1 02:49:54 2009
@@ -28,8 +28,8 @@
{
public static final String DELIMITER = ":";
- private T token;
- private String key;
+ public final T token;
+ public final String key;
public DecoratedKey(T token, String key)
{
@@ -38,16 +38,6 @@
this.key = key;
}
- public T getToken()
- {
- return token;
- }
-
- public String getKey()
- {
- return key;
- }
-
@Override
public int hashCode()
{
Modified:
incubator/cassandra/trunk/src/java/org/apache/cassandra/dht/CollatingOrderPreservingPartitioner.java
URL:
http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/dht/CollatingOrderPreservingPartitioner.java?rev=820511&r1=820510&r2=820511&view=diff
==============================================================================
---
incubator/cassandra/trunk/src/java/org/apache/cassandra/dht/CollatingOrderPreservingPartitioner.java
(original)
+++
incubator/cassandra/trunk/src/java/org/apache/cassandra/dht/CollatingOrderPreservingPartitioner.java
Thu Oct 1 02:49:54 2009
@@ -46,7 +46,7 @@
private static final Comparator<DecoratedKey<BytesToken>> objComparator =
new Comparator<DecoratedKey<BytesToken>>() {
public int compare(DecoratedKey<BytesToken> o1,
DecoratedKey<BytesToken> o2)
{
- return FBUtilities.compareByteArrays(o1.getToken().token,
o2.getToken().token);
+ return FBUtilities.compareByteArrays(o1.token.token,
o2.token.token);
}
};
private static final Comparator<String> reverseComparator = new
Comparator<String>() {
Modified:
incubator/cassandra/trunk/src/java/org/apache/cassandra/dht/OrderPreservingPartitioner.java
URL:
http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/dht/OrderPreservingPartitioner.java?rev=820511&r1=820510&r2=820511&view=diff
==============================================================================
---
incubator/cassandra/trunk/src/java/org/apache/cassandra/dht/OrderPreservingPartitioner.java
(original)
+++
incubator/cassandra/trunk/src/java/org/apache/cassandra/dht/OrderPreservingPartitioner.java
Thu Oct 1 02:49:54 2009
@@ -43,7 +43,7 @@
new Comparator<DecoratedKey<StringToken>>() {
public int compare(DecoratedKey<StringToken> o1,
DecoratedKey<StringToken> o2)
{
- return o1.getKey().compareTo(o2.getKey());
+ return o1.key.compareTo(o2.key);
}
};
private static final Comparator<String> reverseComparator = new
Comparator<String>() {
Modified:
incubator/cassandra/trunk/src/java/org/apache/cassandra/dht/RandomPartitioner.java
URL:
http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/dht/RandomPartitioner.java?rev=820511&r1=820510&r2=820511&view=diff
==============================================================================
---
incubator/cassandra/trunk/src/java/org/apache/cassandra/dht/RandomPartitioner.java
(original)
+++
incubator/cassandra/trunk/src/java/org/apache/cassandra/dht/RandomPartitioner.java
Thu Oct 1 02:49:54 2009
@@ -42,13 +42,13 @@
public int compare(DecoratedKey<BigIntegerToken> o1,
DecoratedKey<BigIntegerToken> o2)
{
// first, compare on the bigint hash "decoration". usually this
will be enough.
- int v = o1.getToken().compareTo(o2.getToken());
+ int v = o1.token.compareTo(o2.token);
if (v != 0) {
return v;
}
// if the hashes are equal, compare the strings
- return o1.getKey().compareTo(o2.getKey());
+ return o1.key.compareTo(o2.key);
}
};