Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
Correctness - Consistency
-
Normal
-
Normal
-
Adhoc Test
-
All
-
None
-
Description
Splitter in some cases may produce one split more than requested. When it happens, it fails with assertion error when assertions are enabled.
Test to reproduce the issue:
Splitter splitter = getSplitter(Murmur3Partitioner.instance); long lt = 0; long rt = 31; Range<Token> range = new Range<>(getWrappedToken(Murmur3Partitioner.instance, BigInteger.valueOf(lt)), getWrappedToken(Murmur3Partitioner.instance, BigInteger.valueOf(rt))); for (int i = 1; i <= (rt - lt); i++) { List<Token> splits = splitter.splitOwnedRanges(i, Arrays.asList(new Splitter.WeightedRange(1.0d, range)), false); logger.info("{} splits of {} are: {}", i, range, splits); Assertions.assertThat(splits).hasSize(i); }