@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 |
Modifier and Type | Field and Description |
---|---|
private boolean |
checkFamily |
private boolean |
checkRow |
private int |
count |
private PrintStream |
err |
private List<org.apache.hadoop.fs.Path> |
files |
private static String |
FOUR_SPACES |
private boolean |
isSeekToRow |
private static org.apache.commons.logging.Log |
LOG |
private 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 |
init() |
static void |
main(String[] args) |
boolean |
parseOptions(String[] args) |
private void |
printMeta(HFile.Reader reader,
Map<byte[],byte[]> fileInfo) |
int |
processFile(org.apache.hadoop.fs.Path file) |
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.apache.commons.logging.Log LOG
private 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 PrintStream out
private PrintStream err
private byte[] row
private List<org.apache.hadoop.fs.Path> files
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.commons.cli.ParseException, IOException
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) throws IOException
IOException
private void scanKeysValues(org.apache.hadoop.fs.Path file, HFilePrettyPrinter.KeyValueStatsCollector fileStats, HFileScanner scanner, byte[] row) throws IOException
IOException
private static String asSeparateLines(String keyValueStr)
private void printMeta(HFile.Reader reader, Map<byte[],byte[]> fileInfo) throws IOException
IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.