public class HFileV1Detector
extends org.apache.hadoop.conf.Configured
implements org.apache.hadoop.util.Tool
To print the help section of the tool:
It also supports -h, --help, -help options.
Modifier and Type | Field and Description |
---|---|
private Set<org.apache.hadoop.fs.Path> |
corruptedHFiles
set of corrupted HFiles (with undetermined major version)
|
private static int |
DEFAULT_NUM_OF_THREADS |
private org.apache.hadoop.fs.Path |
defaultNamespace
used for computing pre-namespace paths for hfilelinks
|
private ExecutorService |
exec
executor for processing regions.
|
private org.apache.hadoop.fs.FileSystem |
fs |
private Set<org.apache.hadoop.fs.Path> |
hFileV1Set
set of HfileV1;
|
private static org.apache.commons.logging.Log |
LOG |
private int |
numOfThreads |
private org.apache.commons.cli.Options |
options |
private static String |
PRE_NS_DOT_ARCHIVE
Pre-namespace archive directory
|
private static String |
PRE_NS_DOT_TMP
Pre-namespace tmp directory
|
private Set<org.apache.hadoop.fs.Path> |
processedTables
Keeps record of processed tables.
|
private org.apache.hadoop.fs.Path |
targetDirPath
directory to start the processing.
|
Constructor and Description |
---|
HFileV1Detector() |
Modifier and Type | Method and Description |
---|---|
private Set<org.apache.hadoop.fs.Path> |
checkForV1Files(org.apache.hadoop.fs.Path targetDir)
Takes a directory path, and lists out any HFileV1, if present.
|
FileLink |
getFileLinkWithPreNSPath(org.apache.hadoop.fs.Path storeFilePath)
Creates a FileLink which adds pre-namespace paths in its list of available paths.
|
private org.apache.hadoop.fs.Path |
getPreNSPath(String prefix,
String relativeTablePath) |
private List<org.apache.hadoop.fs.Path> |
getPreNSPathsForHFileLink(HFileLink fileLink) |
private static boolean |
isRegionDir(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path) |
private boolean |
isRootTable(org.apache.hadoop.fs.Path path)
Ignore ROOT table as it doesn't exist in 0.96.
|
private static boolean |
isTableDir(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path) |
static void |
main(String[] args) |
private boolean |
parseOption(String[] args) |
private void |
printSet(Set<org.apache.hadoop.fs.Path> result,
String msg) |
private Future<org.apache.hadoop.fs.Path> |
processRegion(org.apache.hadoop.fs.Path regionDir)
Each region is processed by a separate handler.
|
private int |
processResult(Set<org.apache.hadoop.fs.Path> regionsWithHFileV1) |
private Set<org.apache.hadoop.fs.Path> |
processTable(org.apache.hadoop.fs.Path tableDir)
Find out regions in the table which have HFileV1.
|
private String |
removeDefaultNSPath(org.apache.hadoop.fs.Path originalPath)
Removes the prefix of defaultNamespace from the path.
|
int |
run(String[] args)
Checks for HFileV1.
|
private void |
setDefaultNamespaceDir() |
private org.apache.hadoop.fs.FileSystem fs
private static final org.apache.commons.logging.Log LOG
private static final int DEFAULT_NUM_OF_THREADS
private static final String PRE_NS_DOT_ARCHIVE
private static final String PRE_NS_DOT_TMP
private int numOfThreads
private org.apache.hadoop.fs.Path targetDirPath
private ExecutorService exec
private final Set<org.apache.hadoop.fs.Path> processedTables
private final Set<org.apache.hadoop.fs.Path> corruptedHFiles
private final Set<org.apache.hadoop.fs.Path> hFileV1Set
private org.apache.commons.cli.Options options
private org.apache.hadoop.fs.Path defaultNamespace
private boolean parseOption(String[] args) throws org.apache.commons.cli.ParseException, IOException
org.apache.commons.cli.ParseException
IOException
public int run(String[] args) throws IOException, org.apache.commons.cli.ParseException
run
in interface org.apache.hadoop.util.Tool
IOException
org.apache.commons.cli.ParseException
private void setDefaultNamespaceDir() throws IOException
IOException
private int processResult(Set<org.apache.hadoop.fs.Path> regionsWithHFileV1)
private Set<org.apache.hadoop.fs.Path> checkForV1Files(org.apache.hadoop.fs.Path targetDir) throws IOException
targetDir
- directory to start looking for HFilev1.IOException
private boolean isRootTable(org.apache.hadoop.fs.Path path)
path
- private Set<org.apache.hadoop.fs.Path> processTable(org.apache.hadoop.fs.Path tableDir) throws IOException
tableDir
- IOException
private Future<org.apache.hadoop.fs.Path> processRegion(org.apache.hadoop.fs.Path regionDir)
regionDir
- Region to process.public FileLink getFileLinkWithPreNSPath(org.apache.hadoop.fs.Path storeFilePath) throws IOException
storeFilePath
- IOException
private List<org.apache.hadoop.fs.Path> getPreNSPathsForHFileLink(HFileLink fileLink) throws IOException
IOException
private String removeDefaultNSPath(org.apache.hadoop.fs.Path originalPath)
originalPath
- private org.apache.hadoop.fs.Path getPreNSPath(String prefix, String relativeTablePath) throws IOException
IOException
private static boolean isTableDir(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) throws IOException
IOException
private static boolean isRegionDir(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) throws IOException
IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.