@InterfaceAudience.Private public final class PrettyPrinter extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PrettyPrinter.Unit |
Modifier and Type | Field and Description |
---|---|
private static Pattern |
INTERVAL_PATTERN |
private static String |
INTERVAL_REGEX |
private static org.slf4j.Logger |
LOG |
private static Pattern |
SIZE_PATTERN |
private static String |
SIZE_REGEX |
Constructor and Description |
---|
PrettyPrinter() |
Modifier and Type | Method and Description |
---|---|
static String |
format(String value,
PrettyPrinter.Unit unit) |
private static String |
humanReadableByte(long size)
Convert a long size to a human readable string.
|
private static long |
humanReadableIntervalToSec(String humanReadableInterval)
Convert a human readable time interval to seconds.
|
private static long |
humanReadableSizeToBytes(String humanReadableSize)
Convert a human readable size to bytes.
|
private static String |
humanReadableTTL(long interval) |
static String |
toString(Collection<?> collection)
Pretty prints a collection of any type to a string.
|
static String |
valueOf(String pretty,
PrettyPrinter.Unit unit)
Convert a human readable string to its value.
|
private static final org.slf4j.Logger LOG
private static final String INTERVAL_REGEX
private static final Pattern INTERVAL_PATTERN
private static final String SIZE_REGEX
private static final Pattern SIZE_PATTERN
public PrettyPrinter()
public static String format(String value, PrettyPrinter.Unit unit)
public static String valueOf(String pretty, PrettyPrinter.Unit unit) throws HBaseException
private static String humanReadableTTL(long interval)
private static long humanReadableIntervalToSec(String humanReadableInterval) throws HBaseException
HBaseException
private static String humanReadableByte(long size)
size
- the size in bytesprivate static long humanReadableSizeToBytes(String humanReadableSize) throws HBaseException
humanReadableSize
- human readable sizeHBaseException
public static String toString(Collection<?> collection)
collection
- collection to pretty print.Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.