public class TokenRangeClusterer extends Object
Useful mostly with virtual nodes, which may create lots of small token range splits.
| Constructor and Description |
|---|
TokenRangeClusterer(BulkTokenFactory tokenFactory) |
| Modifier and Type | Method and Description |
|---|---|
List<BulkTokenRange> |
group(List<BulkTokenRange> ranges,
int groupCount,
int maxGroupSize)
Groups contiguous ranges together as long as they are contiguous and share the same replicas.
|
public TokenRangeClusterer(@NonNull
BulkTokenFactory tokenFactory)
@NonNull public List<BulkTokenRange> group(List<BulkTokenRange> ranges, int groupCount, int maxGroupSize)
Note: the grouping algorithm used in DSBulk is different from the one used by the Spark connector: the former favors groups of contiguous ranges sharing the same replicas (in order to make it possible to route a range read to a coordinator that is also a replica), whereas the latter favors data locality (i.e. groups even non-continguous ranges as long as they share at least one common replica).
Copyright © 2017–2020 DataStax. All rights reserved.