Package org.apache.hadoop.hbase.util
Class HbckTableInfo.HDFSIntegrityFixer
java.lang.Object
org.apache.hadoop.hbase.util.hbck.TableIntegrityErrorHandlerImpl
org.apache.hadoop.hbase.util.HbckTableInfo.IntegrityFixSuggester
org.apache.hadoop.hbase.util.HbckTableInfo.HDFSIntegrityFixer
- All Implemented Interfaces:
TableIntegrityErrorHandler
- Enclosing class:
- HbckTableInfo
This handler fixes integrity errors from hdfs information. There are basically three classes of
integrity problems 1) holes, 2) overlaps, and 3) invalid regions. This class overrides methods
that fix holes and the overlap group case. Individual cases of particular overlaps are handled
by the general overlap group merge repair case. If hbase is online, this forces regions offline
before doing merge operations.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) org.apache.hadoop.conf.Configuration(package private) booleanFields inherited from class org.apache.hadoop.hbase.util.HbckTableInfo.IntegrityFixSuggester
errors -
Constructor Summary
ConstructorsConstructorDescriptionHDFSIntegrityFixer(HbckTableInfo ti, HbckErrorReporter errors, org.apache.hadoop.conf.Configuration conf, boolean fixHoles, boolean fixOverlaps) -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleHoleInRegionChain(byte[] holeStartKey, byte[] holeStopKey) There is a hole in the hdfs regions that violates the table integrity rules.voidhandleOverlapGroup(Collection<HbckRegionInfo> overlap) This takes set of overlapping regions and merges them into a single region.voidhandleRegionEndKeyNotEmpty(byte[] curEndKey) Callback for handling case where a Table has a last region that does not have an empty end key.voidThis is a special case hole -- when the first region of a table is missing from META, HBase doesn't acknowledge the existance of the table.(package private) voidmergeOverlaps(Collection<HbckRegionInfo> overlap) (package private) void(package private) voidsidelineBigOverlaps(Collection<HbckRegionInfo> bigOverlap) Sideline some regions in a big overlap group so that it will have fewer regions, and it is easier to merge them later on.Methods inherited from class org.apache.hadoop.hbase.util.HbckTableInfo.IntegrityFixSuggester
handleDegenerateRegion, handleDuplicateStartKeys, handleOverlapInRegionChain, handleSplitMethods inherited from class org.apache.hadoop.hbase.util.hbck.TableIntegrityErrorHandlerImpl
getTableInfo, setTableInfo
-
Field Details
-
conf
org.apache.hadoop.conf.Configuration conf -
fixOverlaps
boolean fixOverlaps
-
-
Constructor Details
-
HDFSIntegrityFixer
HDFSIntegrityFixer(HbckTableInfo ti, HbckErrorReporter errors, org.apache.hadoop.conf.Configuration conf, boolean fixHoles, boolean fixOverlaps)
-
-
Method Details
-
handleRegionStartKeyNotEmpty
This is a special case hole -- when the first region of a table is missing from META, HBase doesn't acknowledge the existance of the table.- Specified by:
handleRegionStartKeyNotEmptyin interfaceTableIntegrityErrorHandler- Overrides:
handleRegionStartKeyNotEmptyin classHbckTableInfo.IntegrityFixSuggester- Parameters:
next- An HbckRegionInfo of the second region in a table. This should have a non-empty startkey, and can be used to fabricate a first region that has an empty start key.- Throws:
IOException
-
handleRegionEndKeyNotEmpty
Description copied from class:TableIntegrityErrorHandlerImplCallback for handling case where a Table has a last region that does not have an empty end key.- Specified by:
handleRegionEndKeyNotEmptyin interfaceTableIntegrityErrorHandler- Overrides:
handleRegionEndKeyNotEmptyin classHbckTableInfo.IntegrityFixSuggester- Parameters:
curEndKey- The end key of the current last region. There should be a new region with start key as this and an empty end key.- Throws:
IOException
-
handleHoleInRegionChain
There is a hole in the hdfs regions that violates the table integrity rules. Create a new empty region that patches the hole.- Specified by:
handleHoleInRegionChainin interfaceTableIntegrityErrorHandler- Overrides:
handleHoleInRegionChainin classHbckTableInfo.IntegrityFixSuggester- Parameters:
holeStartKey- key at the beginning of the region holeholeStopKey- key at the end of the region hole- Throws:
IOException
-
handleOverlapGroup
This takes set of overlapping regions and merges them into a single region. This covers cases like degenerate regions, shared start key, general overlaps, duplicate ranges, and partial overlapping regions. Cases: - Clean regions that overlap - Only .oldlogs regions (can't find start/stop range, or figure out) This is basically threadsafe, except for the fixer increment in mergeOverlaps.- Specified by:
handleOverlapGroupin interfaceTableIntegrityErrorHandler- Overrides:
handleOverlapGroupin classTableIntegrityErrorHandlerImpl- Parameters:
overlap- Collection of overlapping regions.- Throws:
IOException
-
removeParentsAndFixSplits
- Throws:
IOException
-
mergeOverlaps
- Throws:
IOException
-
sidelineBigOverlaps
Sideline some regions in a big overlap group so that it will have fewer regions, and it is easier to merge them later on.- Parameters:
bigOverlap- the overlapped group with regions more than maxMerge- Throws:
IOException
-