kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 4f318d34b511289f199665cb89b295dacd6e7ede663ff49dbe4d94d8a5ef37b1 |
|---|---|
| Author | olim7t <omichallat+github@gmail.com> · 2015-03-05 13:44 -08:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2015-03-05 15:49 -08:00 |
| Parents | 2545f7762c19 |
1 file changed
modified driver-core/src/main/java/com/datastax/driver/core/Token.java +9 −9
| @@ -100,8 +100,8 @@ | ||
| 100 | 100 | |
| 101 | 101 | private static final BigInteger RING_END = BigInteger.valueOf(Long.MAX_VALUE); |
| 102 | 102 | private static final BigInteger RING_LENGTH = RING_END.subtract(BigInteger.valueOf(Long.MIN_VALUE)); |
| 103 | - public static final M3PToken MIN_TOKEN = new M3PToken(Long.MIN_VALUE); | |
| 104 | - public static final M3PToken MAX_TOKEN = new M3PToken(Long.MAX_VALUE); | |
| 103 | + static final M3PToken MIN_TOKEN = new M3PToken(Long.MIN_VALUE); | |
| 104 | + static final M3PToken MAX_TOKEN = new M3PToken(Long.MAX_VALUE); | |
| 105 | 105 | |
| 106 | 106 | private long getblock(ByteBuffer key, int offset, int index) { |
| 107 | 107 | int i_8 = index << 3; |
| @@ -202,7 +202,7 @@ | ||
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | @Override |
| 205 | - public M3PToken fromString(String tokenStr) { | |
| 205 | + M3PToken fromString(String tokenStr) { | |
| 206 | 206 | return new M3PToken(Long.parseLong(tokenStr)); |
| 207 | 207 | } |
| 208 | 208 | |
| @@ -222,7 +222,7 @@ | ||
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | @Override |
| 225 | - public M3PToken hash(ByteBuffer partitionKey) { | |
| 225 | + M3PToken hash(ByteBuffer partitionKey) { | |
| 226 | 226 | long v = murmur(partitionKey); |
| 227 | 227 | return new M3PToken(v == Long.MIN_VALUE ? Long.MAX_VALUE : v); |
| 228 | 228 | } |
| @@ -326,12 +326,12 @@ | ||
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | @Override |
| 329 | - public OPPToken hash(ByteBuffer partitionKey) { | |
| 329 | + OPPToken hash(ByteBuffer partitionKey) { | |
| 330 | 330 | return new OPPToken(partitionKey); |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | @Override |
| 334 | - public List<Token> split(Token startToken, Token endToken, int numberOfSplits) { | |
| 334 | + List<Token> split(Token startToken, Token endToken, int numberOfSplits) { | |
| 335 | 335 | int tokenOrder = startToken.compareTo(endToken); |
| 336 | 336 | |
| 337 | 337 | // ]min,min] means the whole ring. However, since there is no "max token" with this partitioner, we can't come up |
| @@ -514,7 +514,7 @@ | ||
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | @Override |
| 517 | - public RPToken fromString(String tokenStr) { | |
| 517 | + RPToken fromString(String tokenStr) { | |
| 518 | 518 | return new RPToken(new BigInteger(tokenStr)); |
| 519 | 519 | } |
| 520 | 520 | |
| @@ -534,7 +534,7 @@ | ||
| 534 | 534 | } |
| 535 | 535 | |
| 536 | 536 | @Override |
| 537 | - public RPToken hash(ByteBuffer partitionKey) { | |
| 537 | + RPToken hash(ByteBuffer partitionKey) { | |
| 538 | 538 | return new RPToken(md5(partitionKey)); |
| 539 | 539 | } |
| 540 | 540 | |
| @@ -559,7 +559,7 @@ | ||
| 559 | 559 | tokens.add(new RPToken(value)); |
| 560 | 560 | return tokens; |
| 561 | 561 | } |
| 562 | - }; | |
| 562 | + } | |
| 563 | 563 | |
| 564 | 564 | private RPToken(BigInteger value) { |
| 565 | 565 | this.value = value; |