Search in sources :

Example 6 with TerminalSize

use of org.apache.hadoop.hbase.hbtop.terminal.TerminalSize in project hbase by apache.

the class TerminalImpl method queryTerminalSize.

private TerminalSize queryTerminalSize() {
    String sizeString = doStty("size");
    int rows = 0;
    int columns = 0;
    StringTokenizer tokenizer = new StringTokenizer(sizeString);
    int rc = Integer.parseInt(tokenizer.nextToken());
    if (rc > 0) {
        rows = rc;
    }
    rc = Integer.parseInt(tokenizer.nextToken());
    if (rc > 0) {
        columns = rc;
    }
    return new TerminalSize(columns, rows);
}
Also used : StringTokenizer(java.util.StringTokenizer) TerminalSize(org.apache.hadoop.hbase.hbtop.terminal.TerminalSize)

Aggregations

TerminalSize (org.apache.hadoop.hbase.hbtop.terminal.TerminalSize)6 Nullable (edu.umd.cs.findbugs.annotations.Nullable)3 StringTokenizer (java.util.StringTokenizer)1 FieldInfo (org.apache.hadoop.hbase.hbtop.field.FieldInfo)1 Before (org.junit.Before)1