@InterfaceAudience.Private class MetaFixer extends Object
MetaTableAccessor
is about low-level
manipulations driven by the Master. This class MetaFixer is
employed by the Master and it 'knows' about holes and orphans
and encapsulates their fixing on behalf of the Master.Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
private MasterServices |
masterServices |
private static int |
MAX_MERGE_COUNT_DEFAULT |
private static String |
MAX_MERGE_COUNT_KEY |
private int |
maxMergeCount
Maximum for many regions to merge at a time.
|
Constructor and Description |
---|
MetaFixer(MasterServices masterServices) |
Modifier and Type | Method and Description |
---|---|
private RegionInfo |
buildRegionInfo(TableName tn,
byte[] start,
byte[] end) |
(package private) static List<SortedSet<RegionInfo>> |
calculateMerges(int maxMergeCount,
List<Pair<RegionInfo,RegionInfo>> overlaps)
Run through
overlaps and return a list of merges to run. |
(package private) void |
fix() |
(package private) void |
fixHoles(CatalogJanitor.Report report)
If hole, it papers it over by adding a region in the filesystem and to hbase:meta.
|
(package private) void |
fixOverlaps(CatalogJanitor.Report report)
Fix overlaps noted in CJ consistency report.
|
private RegionInfo |
getHoleCover(Pair<RegionInfo,RegionInfo> hole) |
(package private) static RegionInfo |
getRegionInfoWithLargestEndKey(RegionInfo a,
RegionInfo b) |
(package private) static boolean |
isOverlap(RegionInfo ri,
Pair<RegionInfo,RegionInfo> pair) |
private static final org.slf4j.Logger LOG
private static final String MAX_MERGE_COUNT_KEY
private static final int MAX_MERGE_COUNT_DEFAULT
private final MasterServices masterServices
private final int maxMergeCount
MetaFixer(MasterServices masterServices)
void fix() throws IOException
IOException
void fixHoles(CatalogJanitor.Report report) throws IOException
IOException
private RegionInfo getHoleCover(Pair<RegionInfo,RegionInfo> hole)
hole
private RegionInfo buildRegionInfo(TableName tn, byte[] start, byte[] end)
void fixOverlaps(CatalogJanitor.Report report) throws IOException
IOException
static List<SortedSet<RegionInfo>> calculateMerges(int maxMergeCount, List<Pair<RegionInfo,RegionInfo>> overlaps)
overlaps
and return a list of merges to run.
Presumes overlaps are ordered (which they are coming out of the CatalogJanitor
consistency report).maxMergeCount
- Maximum regions to merge at a time (avoid merging
100k regions in one go!)static RegionInfo getRegionInfoWithLargestEndKey(RegionInfo a, RegionInfo b)
a
or b
, whichever has the
endkey that is furthest along in the Table.static boolean isOverlap(RegionInfo ri, Pair<RegionInfo,RegionInfo> pair)
ri
and
the pair
. Does NOT check the pairs themselves overlap.Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.