Search in sources :

Example 1 with TerminalPrinter

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();
}
Also used : TerminalPrinter(org.apache.hadoop.hbase.hbtop.terminal.TerminalPrinter)

Example 2 with TerminalPrinter

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();
}
Also used : TerminalPrinter(org.apache.hadoop.hbase.hbtop.terminal.TerminalPrinter)

Example 3 with TerminalPrinter

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();
}
Also used : TerminalPrinter(org.apache.hadoop.hbase.hbtop.terminal.TerminalPrinter)

Example 4 with TerminalPrinter

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();
        }
    }
}
Also used : TerminalPrinter(org.apache.hadoop.hbase.hbtop.terminal.TerminalPrinter)

Example 5 with TerminalPrinter

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();
}
Also used : TerminalPrinter(org.apache.hadoop.hbase.hbtop.terminal.TerminalPrinter)

Aggregations

TerminalPrinter (org.apache.hadoop.hbase.hbtop.terminal.TerminalPrinter)9 ArrayList (java.util.ArrayList)1 Record (org.apache.hadoop.hbase.hbtop.Record)1 KeyPress (org.apache.hadoop.hbase.hbtop.terminal.KeyPress)1 Terminal (org.apache.hadoop.hbase.hbtop.terminal.Terminal)1