Class ReportMakingVisitor
java.lang.Object
org.apache.hadoop.hbase.master.janitor.ReportMakingVisitor
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ClientMetaTableAccessor.CloseableVisitor
,ClientMetaTableAccessor.Visitor
@Private
class ReportMakingVisitor
extends Object
implements ClientMetaTableAccessor.CloseableVisitor
Visitor we use in here in CatalogJanitor to go against hbase:meta table. Generates a Report made
of a collection of split parents and counts of rows in the hbase:meta table. Also runs hbase:meta
consistency checks to generate more report. Report is NOT ready until after this visitor has been
close()
'd.-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private RegionInfo
Keep account of the highest end key seen as we move through hbase:meta.private static final org.slf4j.Logger
private RegionInfo
RegionInfo from previous row.private CatalogJanitorReport
Report is not done until after the close has been called.private final MasterServices
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
addHole
(RegionInfo a, RegionInfo b) private void
addOverlap
(RegionInfo a, RegionInfo b) private void
checkServer
(RegionLocations locations) Run through referenced servers and save off unknown and the dead.void
close()
(package private) CatalogJanitorReport
Do not call until afterclose()
.(package private) boolean
Returns True if table is disabled or disabling; defaults false!private boolean
Returns True iff first row in hbase:meta or if we've broached a new table in hbase:metaprivate RegionInfo
metaTableConsistencyCheck
(Result metaTableRow) Check row.boolean
Visit the catalog table row.
-
Field Details
-
LOG
-
services
-
closed
-
report
Report is not done until after the close has been called. -
previous
RegionInfo from previous row. -
highestEndKeyRegionInfo
Keep account of the highest end key seen as we move through hbase:meta. Usually, the current RegionInfo has the highest end key but if an overlap, this may no longer hold. An overlap may be a region with startkey 'd' and endkey 'g'. The next region in meta may be 'e' to 'f' and then 'f' to 'g'. Looking at previous and current meta row, we won't know about the 'd' to 'g' overlap unless we keep a running 'highest-endpoint-seen'.
-
-
Constructor Details
-
ReportMakingVisitor
ReportMakingVisitor(MasterServices services)
-
-
Method Details
-
getReport
Do not call until afterclose()
. Will throw aRuntimeException
if you do. -
visit
Description copied from interface:ClientMetaTableAccessor.Visitor
Visit the catalog table row.- Specified by:
visit
in interfaceClientMetaTableAccessor.Visitor
- Parameters:
r
- A row from catalog table- Returns:
- True if we are to proceed scanning the table, else false if we are to stop now.
-
metaTableConsistencyCheck
Check row.- Parameters:
metaTableRow
- Row from hbase:meta table.- Returns:
- Returns default regioninfo found in row parse as a convenience to save on having to do a double-parse of Result.
-
addOverlap
-
addHole
-
isTableDisabled
Returns True if table is disabled or disabling; defaults false! -
checkServer
Run through referenced servers and save off unknown and the dead. -
isTableTransition
Returns True iff first row in hbase:meta or if we've broached a new table in hbase:meta -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-