public class KeyRangeUtils extends Object
Constructor and Description |
---|
KeyRangeUtils() |
Modifier and Type | Method and Description |
---|---|
static Coprocessor.KeyRange |
makeCoprocRange(com.google.protobuf.ByteString startKey,
com.google.protobuf.ByteString endKey)
Build a Coprocessor Range with CLOSED_OPEN endpoints
|
static Coprocessor.KeyRange |
makeCoprocRange(com.google.common.collect.Range<Key> range)
Build a Coprocessor Range
|
static com.google.common.collect.Range<Key> |
makeRange(com.google.protobuf.ByteString startKey,
com.google.protobuf.ByteString endKey) |
static List<Coprocessor.KeyRange> |
mergeRanges(List<Coprocessor.KeyRange> ranges)
Merge potential discrete ranges into one large range.
|
static List<Coprocessor.KeyRange> |
mergeSortedRanges(List<Coprocessor.KeyRange> ranges)
Merge SORTED potential discrete ranges into one large range.
|
static List<Coprocessor.KeyRange> |
mergeSortedRanges(List<Coprocessor.KeyRange> ranges,
int splitNum)
Merge SORTED potential discrete ranges into no more than
splitNum large range. |
public static com.google.common.collect.Range<Key> makeRange(com.google.protobuf.ByteString startKey, com.google.protobuf.ByteString endKey)
public static Coprocessor.KeyRange makeCoprocRange(com.google.protobuf.ByteString startKey, com.google.protobuf.ByteString endKey)
startKey
- startKeyendKey
- endKeypublic static Coprocessor.KeyRange makeCoprocRange(com.google.common.collect.Range<Key> range)
range
- Range with Comparable endpointspublic static List<Coprocessor.KeyRange> mergeRanges(List<Coprocessor.KeyRange> ranges)
ranges
- the range list to mergepublic static List<Coprocessor.KeyRange> mergeSortedRanges(List<Coprocessor.KeyRange> ranges)
ranges
- the sorted range list to mergepublic static List<Coprocessor.KeyRange> mergeSortedRanges(List<Coprocessor.KeyRange> ranges, int splitNum)
splitNum
large range.ranges
- the sorted range list to mergesplitNum
- upper bound of number of ranges to merge intoCopyright © 2024 PingCAP. All rights reserved.