@InterfaceAudience.LimitedPrivate(value="Tools") @InterfaceStability.Evolving public class HFilePrettyPrinter extends org.apache.hadoop.conf.Configured implements org.apache.hadoop.util.Tool
HFile
s.Modifier and Type | Class and Description |
---|---|
private static class |
HFilePrettyPrinter.KeyValueStatsCollector |
private static class |
HFilePrettyPrinter.SimpleReporter
Almost identical to ConsoleReporter, but extending ScheduledReporter, as extending
ConsoleReporter in this version of dropwizard is now too much trouble.
|
Modifier and Type | Field and Description |
---|---|
private boolean |
checkFamily |
private boolean |
checkMobIntegrity |
private boolean |
checkRow |
private int |
count |
private PrintStream |
err |
private List<org.apache.hadoop.fs.Path> |
files |
private static int |
FOUND_MOB_FILES_CACHE_CAPACITY |
private static String |
FOUR_SPACES |
private boolean |
isSeekToRow |
private static org.slf4j.Logger |
LOG |
private static int |
MISSING_MOB_FILES_CACHE_CAPACITY |
private Map<String,List<org.apache.hadoop.fs.Path>> |
mobFileLocations |
private org.apache.hbase.thirdparty.org.apache.commons.cli.Options |
options |
private PrintStream |
out |
private boolean |
printBlockHeaders |
private boolean |
printBlockIndex |
private boolean |
printKey |
private boolean |
printStats |
private boolean |
printValue |
private byte[] |
row
The row which the user wants to specify and print all the KeyValues for.
|
private boolean |
shouldPrintMeta |
private boolean |
verbose |
Constructor and Description |
---|
HFilePrettyPrinter() |
HFilePrettyPrinter(org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
private static String |
asSeparateLines(String keyValueStr)
Format a string of the form "k1=v1, k2=v2, ..." into separate lines with a four-space
indentation.
|
private void |
evictMobFilesIfNecessary(Set<String> mobFileNames,
int limit)
Evicts the cached mob files if the set is larger than the limit.
|
private void |
init() |
static void |
main(String[] args) |
private boolean |
mobFileExists(org.apache.hadoop.fs.FileSystem fs,
TableName tn,
String mobFileName,
String family,
Set<String> foundMobFiles,
Set<String> missingMobFiles)
Checks whether the referenced mob file exists.
|
boolean |
parseOptions(String[] args) |
private void |
printMeta(HFile.Reader reader,
Map<byte[],byte[]> fileInfo) |
int |
processFile(org.apache.hadoop.fs.Path file,
boolean checkRootDir) |
int |
run(String[] args)
Runs the command-line pretty-printer, and returns the desired command exit code (zero for
success, non-zero for failure).
|
private void |
scanKeysValues(org.apache.hadoop.fs.Path file,
HFilePrettyPrinter.KeyValueStatsCollector fileStats,
HFileScanner scanner,
byte[] row) |
void |
setPrintStreams(PrintStream out,
PrintStream err) |
private static final org.slf4j.Logger LOG
private org.apache.hbase.thirdparty.org.apache.commons.cli.Options options
private boolean verbose
private boolean printValue
private boolean printKey
private boolean shouldPrintMeta
private boolean printBlockIndex
private boolean printBlockHeaders
private boolean printStats
private boolean checkRow
private boolean checkFamily
private boolean isSeekToRow
private boolean checkMobIntegrity
private Map<String,List<org.apache.hadoop.fs.Path>> mobFileLocations
private static final int FOUND_MOB_FILES_CACHE_CAPACITY
private static final int MISSING_MOB_FILES_CACHE_CAPACITY
private PrintStream out
private PrintStream err
private byte[] row
private int count
private static final String FOUR_SPACES
public HFilePrettyPrinter()
public HFilePrettyPrinter(org.apache.hadoop.conf.Configuration conf)
private void init()
public void setPrintStreams(PrintStream out, PrintStream err)
public boolean parseOptions(String[] args) throws org.apache.hbase.thirdparty.org.apache.commons.cli.ParseException, IOException
org.apache.hbase.thirdparty.org.apache.commons.cli.ParseException
IOException
public int run(String[] args)
run
in interface org.apache.hadoop.util.Tool
public int processFile(org.apache.hadoop.fs.Path file, boolean checkRootDir) throws IOException
IOException
private void scanKeysValues(org.apache.hadoop.fs.Path file, HFilePrettyPrinter.KeyValueStatsCollector fileStats, HFileScanner scanner, byte[] row) throws IOException
IOException
private boolean mobFileExists(org.apache.hadoop.fs.FileSystem fs, TableName tn, String mobFileName, String family, Set<String> foundMobFiles, Set<String> missingMobFiles) throws IOException
IOException
private void evictMobFilesIfNecessary(Set<String> mobFileNames, int limit)
private static String asSeparateLines(String keyValueStr)
private void printMeta(HFile.Reader reader, Map<byte[],byte[]> fileInfo) throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.