@InterfaceAudience.Private public class HFileCorruptionChecker extends Object
Modifier and Type | Class and Description |
---|---|
private class |
HFileCorruptionChecker.MobRegionDirChecker
An individual work item for parallelized mob dir processing.
|
private class |
HFileCorruptionChecker.RegionDirChecker
An individual work item for parallelized regiondir processing.
|
Modifier and Type | Field and Description |
---|---|
(package private) CacheConfig |
cacheConf |
(package private) org.apache.hadoop.conf.Configuration |
conf |
(package private) Set<org.apache.hadoop.fs.Path> |
corrupted |
(package private) Set<org.apache.hadoop.fs.Path> |
corruptedMobFiles |
(package private) ExecutorService |
executor |
(package private) Set<org.apache.hadoop.fs.Path> |
failureMobFiles |
(package private) Set<org.apache.hadoop.fs.Path> |
failures |
(package private) org.apache.hadoop.fs.FileSystem |
fs |
(package private) AtomicInteger |
hfilesChecked |
(package private) boolean |
inQuarantineMode |
private static org.slf4j.Logger |
LOG |
(package private) Set<org.apache.hadoop.fs.Path> |
missedMobFiles |
(package private) Set<org.apache.hadoop.fs.Path> |
missing |
(package private) AtomicInteger |
mobFilesChecked |
(package private) Set<org.apache.hadoop.fs.Path> |
quarantined |
(package private) Set<org.apache.hadoop.fs.Path> |
quarantinedMobFiles |
Constructor and Description |
---|
HFileCorruptionChecker(org.apache.hadoop.conf.Configuration conf,
ExecutorService executor,
boolean quarantine) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkColFamDir(org.apache.hadoop.fs.Path cfDir)
Check all files in a column family dir.
|
protected void |
checkHFile(org.apache.hadoop.fs.Path p)
Checks a path to see if it is a valid hfile.
|
protected void |
checkMobColFamDir(org.apache.hadoop.fs.Path cfDir)
Check all files in a mob column family dir.
|
protected void |
checkMobFile(org.apache.hadoop.fs.Path p)
Checks a path to see if it is a valid mob file.
|
private void |
checkMobRegionDir(org.apache.hadoop.fs.Path regionDir)
Checks all the mob files of a table.
|
protected void |
checkRegionDir(org.apache.hadoop.fs.Path regionDir)
Check all column families in a region dir.
|
(package private) void |
checkTableDir(org.apache.hadoop.fs.Path tableDir)
Check all the regiondirs in the specified tableDir n * path to a table n
|
void |
checkTables(Collection<org.apache.hadoop.fs.Path> tables)
Check the specified table dirs for bad hfiles.
|
private HFileCorruptionChecker.MobRegionDirChecker |
createMobRegionDirChecker(org.apache.hadoop.fs.Path tableDir)
Creates an instance of MobRegionDirChecker.
|
(package private) org.apache.hadoop.fs.Path |
createQuarantinePath(org.apache.hadoop.fs.Path hFile)
Given a path, generates a new path to where we move a corrupted hfile (bad trailer, no
trailer).
|
Collection<org.apache.hadoop.fs.Path> |
getCorrupted()
Returns the set of corrupted file paths after checkTables is called.
|
Collection<org.apache.hadoop.fs.Path> |
getCorruptedMobFiles()
Returns the set of corrupted mob file paths after checkTables is called.
|
Collection<org.apache.hadoop.fs.Path> |
getFailureMobFiles()
Returns the set of check failure mob file paths after checkTables is called.
|
Collection<org.apache.hadoop.fs.Path> |
getFailures()
Returns the set of check failure file paths after checkTables is called.
|
int |
getHFilesChecked()
Returns number of hfiles checked in the last HfileCorruptionChecker run
|
Collection<org.apache.hadoop.fs.Path> |
getMissedMobFiles() |
Collection<org.apache.hadoop.fs.Path> |
getMissing() |
int |
getMobFilesChecked()
Returns number of mob files checked in the last HfileCorruptionChecker run
|
Collection<org.apache.hadoop.fs.Path> |
getQuarantined()
Returns the set of successfully quarantined paths after checkTables is called.
|
Collection<org.apache.hadoop.fs.Path> |
getQuarantinedMobFiles()
Returns the set of successfully quarantined paths after checkTables is called.
|
void |
report(HbckErrorReporter out)
Print a human readable summary of hfile quarantining operations.
|
private static final org.slf4j.Logger LOG
final org.apache.hadoop.conf.Configuration conf
final org.apache.hadoop.fs.FileSystem fs
final CacheConfig cacheConf
final ExecutorService executor
final Set<org.apache.hadoop.fs.Path> quarantined
final Set<org.apache.hadoop.fs.Path> corruptedMobFiles
final Set<org.apache.hadoop.fs.Path> failureMobFiles
final Set<org.apache.hadoop.fs.Path> missedMobFiles
final Set<org.apache.hadoop.fs.Path> quarantinedMobFiles
final boolean inQuarantineMode
final AtomicInteger hfilesChecked
final AtomicInteger mobFilesChecked
public HFileCorruptionChecker(org.apache.hadoop.conf.Configuration conf, ExecutorService executor, boolean quarantine) throws IOException
IOException
protected void checkHFile(org.apache.hadoop.fs.Path p) throws IOException
IOException
org.apache.hadoop.fs.Path createQuarantinePath(org.apache.hadoop.fs.Path hFile) throws IOException
IOException
protected void checkColFamDir(org.apache.hadoop.fs.Path cfDir) throws IOException
IOException
protected void checkMobColFamDir(org.apache.hadoop.fs.Path cfDir) throws IOException
IOException
protected void checkMobFile(org.apache.hadoop.fs.Path p) throws IOException
IOException
private void checkMobRegionDir(org.apache.hadoop.fs.Path regionDir) throws IOException
regionDir
- The mob region directory nIOException
protected void checkRegionDir(org.apache.hadoop.fs.Path regionDir) throws IOException
IOException
void checkTableDir(org.apache.hadoop.fs.Path tableDir) throws IOException
IOException
private HFileCorruptionChecker.MobRegionDirChecker createMobRegionDirChecker(org.apache.hadoop.fs.Path tableDir)
tableDir
- The current table directory.public void checkTables(Collection<org.apache.hadoop.fs.Path> tables) throws IOException
IOException
public Collection<org.apache.hadoop.fs.Path> getFailures()
public Collection<org.apache.hadoop.fs.Path> getCorrupted()
public int getHFilesChecked()
public Collection<org.apache.hadoop.fs.Path> getQuarantined()
public Collection<org.apache.hadoop.fs.Path> getMissing()
public Collection<org.apache.hadoop.fs.Path> getFailureMobFiles()
public Collection<org.apache.hadoop.fs.Path> getCorruptedMobFiles()
public int getMobFilesChecked()
public Collection<org.apache.hadoop.fs.Path> getQuarantinedMobFiles()
public Collection<org.apache.hadoop.fs.Path> getMissedMobFiles()
public void report(HbckErrorReporter out)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.