public void updateRecordsSize(int recordsSize) {
    if (this.recordsSize == 0) {
      currentPosition = 0;
      pageStartPosition = 0;
      pageEndPosition = Math.min(pageSize, recordsSize);
      this.recordsSize = recordsSize;
    } else if (recordsSize == 0) {
      currentPosition = 0;
      pageStartPosition = 0;
      pageEndPosition = 0;
      this.recordsSize = recordsSize;
    } else {
      this.recordsSize = recordsSize;
      if (pageSize > 0) {
        pageEndPosition = pageStartPosition + pageSize;
        keepConsistent();
      }
    }
  }
Utility class for paging for the metrics.
hbase-hbtop/src/main/java/org/apache/hadoop/hbase/hbtop/screen/top/Paging.java