R
- @InterfaceAudience.Private public class RegionSplitCalculator<R extends KeyRange> extends Object
Modifier and Type | Field and Description |
---|---|
static Comparator<byte[]> |
BYTES_COMPARATOR |
private static byte[] |
ENDKEY
SPECIAL CASE
|
private static org.apache.commons.logging.Log |
LOG |
private Comparator<R> |
rangeCmp |
private TreeSet<byte[]> |
splits
This contains a sorted set of all the possible split points
Invariant: once populated this has 0 entries if empty or at most n+1 values
where n == number of added ranges.
|
private com.google.common.collect.Multimap<byte[],R> |
starts
This is a map from start key to regions with the same start key.
|
Constructor and Description |
---|
RegionSplitCalculator(Comparator<R> cmp) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(R range)
Adds an edge to the split calculator
|
com.google.common.collect.Multimap<byte[],R> |
calcCoverage()
Generates a coverage multimap from split key to Regions that start with the
split key.
|
static <R extends KeyRange> |
findBigRanges(Collection<R> bigOverlap,
int count)
Find specified number of top ranges in a big overlap group.
|
TreeSet<byte[]> |
getSplits() |
com.google.common.collect.Multimap<byte[],R> |
getStarts() |
private static <R extends KeyRange> |
specialEndKey(R range)
SPECIAL CASE wrapper for empty end key
|
private static final org.apache.commons.logging.Log LOG
private final Comparator<R extends KeyRange> rangeCmp
private final TreeSet<byte[]> splits
private final com.google.common.collect.Multimap<byte[],R extends KeyRange> starts
private static final byte[] ENDKEY
public static final Comparator<byte[]> BYTES_COMPARATOR
public RegionSplitCalculator(Comparator<R> cmp)
private static <R extends KeyRange> byte[] specialEndKey(R range)
public boolean add(R range)
public com.google.common.collect.Multimap<byte[],R> calcCoverage()
public TreeSet<byte[]> getSplits()
public com.google.common.collect.Multimap<byte[],R> getStarts()
public static <R extends KeyRange> List<R> findBigRanges(Collection<R> bigOverlap, int count)
bigOverlap
- a list of ranges that overlap with each othercount
- the max number of ranges to findCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.