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 SummaryFieldsModifier 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 SummaryConstructors
- 
Method SummaryModifier 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
- 
reportReport is not done until after the close has been called.
- 
previousRegionInfo from previous row.
- 
highestEndKeyRegionInfoKeep 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- 
ReportMakingVisitorReportMakingVisitor(MasterServices services) 
 
- 
- 
Method Details- 
getReportDo not call until afterclose(). Will throw aRuntimeExceptionif you do.
- 
visitDescription copied from interface:ClientMetaTableAccessor.VisitorVisit the catalog table row.- Specified by:
- visitin interface- ClientMetaTableAccessor.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.
 
- 
metaTableConsistencyCheckCheck 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
- 
isTableDisabledReturns True if table is disabled or disabling; defaults false!
- 
checkServerRun through referenced servers and save off unknown and the dead.
- 
isTableTransitionReturns True iff first row in hbase:meta or if we've broached a new table in hbase:meta
- 
close- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException
 
 
-