use of org.apache.hadoop.hbase.hbtop.terminal.TerminalPrinter in project hbase by apache.
the class ModeScreenView method showScreenDescription.
private void showScreenDescription(Mode currentMode) {
TerminalPrinter printer = getTerminalPrinter(SCREEN_DESCRIPTION_START_ROW);
printer.startBold().print("Mode Management").stopBold().endOfLine();
printer.print("Current mode: ").startBold().print(currentMode.getHeader()).stopBold().endOfLine();
printer.print("Select mode followed by <Enter>").endOfLine();
}
use of org.apache.hadoop.hbase.hbtop.terminal.TerminalPrinter in project hbase by apache.
the class TopScreenView method showSummary.
private void showSummary(Summary summary) {
TerminalPrinter printer = getTerminalPrinter(SUMMARY_START_ROW);
printer.print(String.format("HBase hbtop - %s", summary.getCurrentTime())).endOfLine();
printer.print(String.format("Version: %s", summary.getVersion())).endOfLine();
printer.print(String.format("Cluster ID: %s", summary.getClusterId())).endOfLine();
printer.print("RegionServer(s): ").startBold().print(Integer.toString(summary.getServers())).stopBold().print(" total, ").startBold().print(Integer.toString(summary.getLiveServers())).stopBold().print(" live, ").startBold().print(Integer.toString(summary.getDeadServers())).stopBold().print(" dead").endOfLine();
printer.print("RegionCount: ").startBold().print(Integer.toString(summary.getRegionCount())).stopBold().print(" total, ").startBold().print(Integer.toString(summary.getRitCount())).stopBold().print(" rit").endOfLine();
printer.print("Average Cluster Load: ").startBold().print(String.format("%.2f", summary.getAverageLoad())).stopBold().endOfLine();
printer.print("Aggregate Request/s: ").startBold().print(Long.toString(summary.getAggregateRequestPerSecond())).stopBold().endOfLine();
}
use of org.apache.hadoop.hbase.hbtop.terminal.TerminalPrinter in project hbase by apache.
the class FieldScreenView method showScreenDescription.
public void showScreenDescription(String sortFieldHeader) {
TerminalPrinter printer = getTerminalPrinter(SCREEN_DESCRIPTION_START_ROW);
printer.startBold().print("Fields Management").stopBold().endOfLine();
printer.print("Current Sort Field: ").startBold().print(sortFieldHeader).stopBold().endOfLine();
printer.print("Navigate with up/down, Right selects for move then <Enter> or Left commits,").endOfLine();
printer.print("'d' or <Space> toggles display, 's' sets sort. Use 'q' or <Esc> to end!").endOfLine();
}
use of org.apache.hadoop.hbase.hbtop.terminal.TerminalPrinter in project hbase by apache.
the class FieldScreenView method showField.
public void showField(int pos, Field field, boolean display, boolean selected, int fieldHeaderMaxLength, int fieldDescriptionMaxLength, boolean moveMode) {
String fieldHeader = String.format("%-" + fieldHeaderMaxLength + "s", field.getHeader());
String fieldDescription = String.format("%-" + fieldDescriptionMaxLength + "s", field.getDescription());
int row = FIELD_START_ROW + pos;
TerminalPrinter printer = getTerminalPrinter(row);
if (selected) {
String prefix = display ? "* " : " ";
if (moveMode) {
printer.print(prefix);
if (display) {
printer.startBold();
}
printer.startHighlight().printFormat("%s = %s", fieldHeader, fieldDescription).stopHighlight();
if (display) {
printer.stopBold();
}
printer.endOfLine();
} else {
printer.print(prefix);
if (display) {
printer.startBold();
}
printer.startHighlight().print(fieldHeader).stopHighlight().printFormat(" = %s", fieldDescription);
if (display) {
printer.stopBold();
}
printer.endOfLine();
}
} else {
if (display) {
printer.print("* ").startBold().printFormat("%s = %s", fieldHeader, fieldDescription).stopBold().endOfLine();
} else {
printer.printFormat(" %s = %s", fieldHeader, fieldDescription).endOfLine();
}
}
}
use of org.apache.hadoop.hbase.hbtop.terminal.TerminalPrinter in project hbase by apache.
the class HelpScreenView method showScreenDescription.
private void showScreenDescription(long refreshDelay) {
TerminalPrinter printer = getTerminalPrinter(SCREEN_DESCRIPTION_START_ROW);
printer.startBold().print("Help for Interactive Commands").stopBold().endOfLine();
printer.print("Refresh delay: ").startBold().print((double) refreshDelay / 1000).stopBold().endOfLine();
}
Aggregations