You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by horschi <ho...@gmail.com> on 2013/12/04 12:38:09 UTC
Murmur Long.MIN_VALUE token allowed?
Hi,
I just realized that I can move a node to Long.MIN_VALUE:
127.0.0.1 rack1 Up Normal 1011.58 KB 100.00%
-9223372036854775808
Is that really a valid token for Murmur3Partitioner ?
I thought that Long.MIN_VALUE (like -1 for Random) is not a regular token.
Shouldn't be only used for token-range-scans?
kind regards,
Christian
Re: Murmur Long.MIN_VALUE token allowed?
Posted by Robert Coli <rc...@eventbrite.com>.
On Tue, Dec 10, 2013 at 12:15 AM, horschi <ho...@gmail.com> wrote:
> And my feeling gets worse when I look at Murmur3Partitioner.normalize().
> This one explicitly excludes Long.MIN_VALUE by changing it to
> Long.MAX_VALUE.
>
> I think I'll just avoid it in the future. Better safe than sorry...
>
I see, your question is about the behavior of the partitioner at the "ends"
of the range.
I agree that there is a possible issue here, but the code should make it
pretty clear if there is or is not?
Even if you avoid putting a node "at" this token, a node will necessarily
"own" this token, so if your goal is to be "safe" you should read the code
and determine if there's an issue. :)
=Rob
Re: Murmur Long.MIN_VALUE token allowed?
Posted by horschi <ho...@gmail.com>.
Hi Aaron,
thanks for your response. But that is exactly what scares me:
RandomPartitioner.MIN is -1, which is not a valid token :-)
And my feeling gets worse when I look at Murmur3Partitioner.normalize().
This one explicitly excludes Long.MIN_VALUE by changing it to
Long.MAX_VALUE.
I think I'll just avoid it in the future. Better safe than sorry...
cheers,
Christian
On Tue, Dec 10, 2013 at 8:24 AM, Aaron Morton <aa...@thelastpickle.com>wrote:
> AFAIK any value that is a valid output from murmor3 is a valid token.
>
> The Murmur3Partitioner set’s min and max to long min and max…
>
> public static final LongToken MINIMUM = new LongToken(Long.MIN_VALUE);
> public static final long MAXIMUM = Long.MAX_VALUE;
>
> Cheers
>
> -----------------
> Aaron Morton
> New Zealand
> @aaronmorton
>
> Co-Founder & Principal Consultant
> Apache Cassandra Consulting
> http://www.thelastpickle.com
>
> On 5/12/2013, at 12:38 am, horschi <ho...@gmail.com> wrote:
>
> Hi,
>
> I just realized that I can move a node to Long.MIN_VALUE:
>
> 127.0.0.1 rack1 Up Normal 1011.58 KB 100.00%
> -9223372036854775808
>
> Is that really a valid token for Murmur3Partitioner ?
>
> I thought that Long.MIN_VALUE (like -1 for Random) is not a regular token.
> Shouldn't be only used for token-range-scans?
>
> kind regards,
> Christian
>
>
>
Re: Murmur Long.MIN_VALUE token allowed?
Posted by Aaron Morton <aa...@thelastpickle.com>.
AFAIK any value that is a valid output from murmor3 is a valid token.
The Murmur3Partitioner set’s min and max to long min and max…
public static final LongToken MINIMUM = new LongToken(Long.MIN_VALUE);
public static final long MAXIMUM = Long.MAX_VALUE;
Cheers
-----------------
Aaron Morton
New Zealand
@aaronmorton
Co-Founder & Principal Consultant
Apache Cassandra Consulting
http://www.thelastpickle.com
On 5/12/2013, at 12:38 am, horschi <ho...@gmail.com> wrote:
> Hi,
>
> I just realized that I can move a node to Long.MIN_VALUE:
>
> 127.0.0.1 rack1 Up Normal 1011.58 KB 100.00% -9223372036854775808
>
> Is that really a valid token for Murmur3Partitioner ?
>
> I thought that Long.MIN_VALUE (like -1 for Random) is not a regular token. Shouldn't be only used for token-range-scans?
>
> kind regards,
> Christian
>