connect();
// if corrupt file mode is on, first fix them since they may be opened later
if (checkCorruptHFiles || sidelineCorruptHFiles) {
LOG.info("Checking all hfiles for corruption");
HFileCorruptionChecker hfcc = createHFileCorruptionChecker(sidelineCorruptHFiles);
setHFileCorruptionChecker(hfcc); // so we can get result
Collection<String> tables = getIncludedTables();
Collection<Path> tableDirs = new ArrayList<Path>();
Path rootdir = FSUtils.getRootDir(conf);
if (tables.size() > 0) {
for (String t : tables) {
tableDirs.add(FSUtils.getTablePath(rootdir, t));
}
} else {
tableDirs = FSUtils.getTableDirs(FSUtils.getCurrentFileSystem(conf), rootdir);
}
hfcc.checkTables(tableDirs);
PrintWriter out = new PrintWriter(System.out);
hfcc.report(out);
out.flush();
}
// check and fix table integrity, region consistency.
int code = onlineHbck();