@InterfaceAudience.LimitedPrivate(value="Tools") @InterfaceStability.Evolving public class WALPrettyPrinter extends Object
| Constructor and Description |
|---|
WALPrettyPrinter()
Basic constructor that simply initializes values to reasonable defaults.
|
WALPrettyPrinter(boolean outputValues,
boolean outputJSON,
long sequence,
Set<String> tableSet,
String region,
String row,
String rowPrefix,
boolean outputOnlyRowKey,
boolean persistentOutput,
PrintStream out)
Fully specified constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
beginPersistentOutput()
enables output as a single, persistent list.
|
void |
disableJSON()
turns JSON output off, and turns on "pretty strings" for human consumption
|
void |
disableValues()
turns value output off
|
void |
enableJSON()
turns JSON output on
|
void |
enableValues()
turns value output on
|
void |
endPersistentOutput()
ends output of a single, persistent list.
|
static void |
main(String[] args) |
static void |
printCell(PrintStream out,
Map<String,Object> op,
boolean outputValues,
boolean outputOnlyRowKey) |
void |
processFile(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path p)
reads a log file and outputs its contents, one transaction at a time, as specified by the
currently configured options the HBase configuration relevant to this log file the path of the
log file to be read may be unable to access the configured filesystem or requested file.
|
static void |
run(String[] args)
Pass one or more log file names and formatting options and it will dump out a text version of
the contents on
stdout. |
void |
setOutputOnlyRowKey()
Option to print the row key only in case you just need the row keys from the WAL
|
void |
setPosition(long position)
sets the position to start seeking the WAL file initial position to start seeking the given WAL
file
|
void |
setRegionFilter(String region)
sets the region by which output will be filtered when not null, serves as a filter; only log
entries from this region will be printed
|
void |
setRowFilter(String row)
sets the row key by which output will be filtered when not null, serves as a filter; only log
entries from this row will be printed
|
void |
setRowPrefixFilter(String rowPrefix)
sets the rowPrefix key prefix by which output will be filtered when not null, serves as a
filter; only log entries with rows having this prefix will be printed
|
void |
setSequenceFilter(long sequence)
sets the region by which output will be filtered when nonnegative, serves as a filter; only log
entries with this sequence id will be printed
|
void |
setTableFilter(String tablesWithDelimiter)
Sets the tables filter.
|
static Map<String,Object> |
toStringMap(Cell cell) |
static Map<String,Object> |
toStringMap(Cell cell,
boolean printRowKeyOnly,
String rowPrefix,
String row,
boolean outputValues) |
public WALPrettyPrinter()
public WALPrettyPrinter(boolean outputValues,
boolean outputJSON,
long sequence,
Set<String> tableSet,
String region,
String row,
String rowPrefix,
boolean outputOnlyRowKey,
boolean persistentOutput,
PrintStream out)
outputValues - when true, enables output of values along with other log informationoutputJSON - when true, enables output in JSON format rather than a "pretty string"sequence - when nonnegative, serves as a filter; only log entries with this
sequence id will be printedtableSet - when non null, serves as a filter. only entries corresponding to tables
in the tableSet are printedregion - when not null, serves as a filter; only log entries from this region
will be printedrow - when not null, serves as a filter; only log entries from this row will
be printedrowPrefix - when not null, serves as a filter; only log entries with row key having
this prefix will be printedpersistentOutput - keeps a single list running for multiple files. if enabled, the
endPersistentOutput() method must be used!out - Specifies an alternative to stdout for the destination of this
PrettyPrinter's output.public void enableValues()
public void disableValues()
public void enableJSON()
public void disableJSON()
public void setSequenceFilter(long sequence)
public void setTableFilter(String tablesWithDelimiter)
tablesWithDelimiter - table names separated with comma.public void setRegionFilter(String region)
public void setRowFilter(String row)
public void setRowPrefixFilter(String rowPrefix)
public void setOutputOnlyRowKey()
public void setPosition(long position)
public void beginPersistentOutput()
public void endPersistentOutput()
public void processFile(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path p)
throws IOException
IOExceptionpublic static void printCell(PrintStream out, Map<String,Object> op, boolean outputValues, boolean outputOnlyRowKey)
public static Map<String,Object> toStringMap(Cell cell, boolean printRowKeyOnly, String rowPrefix, String row, boolean outputValues)
public static void main(String[] args) throws IOException
IOExceptionpublic static void run(String[] args) throws IOException
stdout. Command line arguments Thrown upon file system errors etc.IOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.