@InterfaceAudience.Private public class MetaBrowser extends Object
Support class for the "Meta Entries" section in resources/hbase-webapps/master/table.jsp.
Interface. This class's intended consumer is table.jsp. As such, it's primary
interface is the active HttpServletRequest, from which it uses the scan_* request
parameters. This class supports paging through an optionally filtered view of the contents of
hbase:meta. Those filters and the pagination offset are specified via these request
parameters. It provides helper methods for constructing pagination links.
hbase:meta; any other value is effectively ignored by the giant conditional in the
jsp.RegionReplicaInfo objects produced by MetaBrowser.Results.iterator(). When a value for
scan_limit is invalid or not specified, the default value of 10
is used. In order to avoid excessive resource consumption, a maximum value of
10000 is enforced.RegionState.Scan, so in effect it can be used for simple namespace and multi-table matches.
Pagination. A single page of results are made available via getResults() / an
instance of MetaBrowser.Results. Callers use its Iterator consume the page of
RegionReplicaInfo instances, each of which represents a region or region replica. Helper
methods are provided for building page navigation controls preserving the user's selected filter
set: buildFirstPageUrl(), buildNextPageUrl(byte[]). Pagination is implemented
using a simple offset + limit system. Offset is provided by the "scan_start", limit
via "scan_limit". Under the hood, the Scan is constructed with
Scan.setMaxResultSize(long) set to ("scan_limit" +1), while the
MetaBrowser.Results Iterator honors "scan_limit". The +1 allows the caller to
know if a "next page" is available via MetaBrowser.Results.hasMoreResults(). Note that this
pagination strategy is incomplete when it comes to region replicas and can potentially omit
rendering replicas that fall between the last rowkey offset and replicaCount % page size.
Error Messages. Any time there's an error parsing user input, a message will be populated
in getErrorMessages(). Any fields which produce an error will have their filter values
set to the default, except for a value of "scan_limit" that exceeds
10000, in which case 10000 is used.
| Modifier and Type | Class and Description |
|---|---|
class |
MetaBrowser.Results
Encapsulates the results produced by this
MetaBrowser instance. |
| Modifier and Type | Field and Description |
|---|---|
static String |
NAME_PARAM |
static int |
SCAN_LIMIT_DEFAULT |
static int |
SCAN_LIMIT_MAX |
static String |
SCAN_LIMIT_PARAM |
static String |
SCAN_REGION_STATE_PARAM |
static String |
SCAN_START_PARAM |
static String |
SCAN_TABLE_PARAM |
| Constructor and Description |
|---|
MetaBrowser(AsyncConnection connection,
javax.servlet.http.HttpServletRequest request) |
| Modifier and Type | Method and Description |
|---|---|
String |
buildFirstPageUrl() |
String |
buildNextPageUrl(byte[] lastRow) |
List<String> |
getErrorMessages() |
String |
getName() |
MetaBrowser.Results |
getResults() |
Integer |
getScanLimit() |
RegionState.State |
getScanRegionState() |
byte[] |
getScanStart() |
TableName |
getScanTable() |
String |
toString() |
public static final String NAME_PARAM
public static final String SCAN_LIMIT_PARAM
public static final String SCAN_REGION_STATE_PARAM
public static final String SCAN_START_PARAM
public static final String SCAN_TABLE_PARAM
public static final int SCAN_LIMIT_DEFAULT
public static final int SCAN_LIMIT_MAX
public MetaBrowser(AsyncConnection connection, javax.servlet.http.HttpServletRequest request)
public String getName()
public Integer getScanLimit()
public byte[] getScanStart()
public RegionState.State getScanRegionState()
public TableName getScanTable()
public MetaBrowser.Results getResults()
public String buildFirstPageUrl()
public String buildNextPageUrl(byte[] lastRow)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.