Class ReportMakingVisitor
java.lang.Object
org.apache.hadoop.hbase.master.janitor.ReportMakingVisitor
- All Implemented Interfaces:
Closeable,AutoCloseable,MetaTableAccessor.CloseableVisitor,MetaTableAccessor.Visitor
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
FieldsModifier and TypeFieldDescriptionprivate booleanprivate RegionInfoKeep account of the highest end key seen as we move through hbase:meta.private static final org.slf4j.Loggerprivate RegionInfoRegionInfo from previous row.private CatalogJanitorReportReport is not done until after the close has been called.private final MasterServices -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddHole(RegionInfo a, RegionInfo b) private voidaddOverlap(RegionInfo a, RegionInfo b) private voidcheckServer(RegionLocations locations) Run through referenced servers and save off unknown and the dead.voidclose()(package private) CatalogJanitorReportDo not call until afterclose().(package private) booleanReturns True if table is disabled or disabling; defaults false!private booleanReturns True iff first row in hbase:meta or if we've broached a new table in hbase:metaprivate RegionInfometaTableConsistencyCheck(Result metaTableRow) Check row.booleanVisit 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 aRuntimeExceptionif you do. -
visit
Description copied from interface:MetaTableAccessor.VisitorVisit the catalog table row.- Specified by:
visitin interfaceMetaTableAccessor.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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-