hbase-webapps.master.quotas.jsp Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hbase-server Show documentation
Show all versions of hbase-server Show documentation
Server functionality for HBase
<%--
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
--%>
<%@ page contentType="text/html;charset=UTF-8"
import="java.util.concurrent.TimeUnit"
import="java.util.ArrayList"
import="java.util.List"
import="org.apache.hadoop.conf.Configuration"
import="org.apache.hadoop.hbase.master.HMaster"
import="org.apache.hadoop.hbase.quotas.MasterQuotaManager"
import="org.apache.hadoop.hbase.quotas.QuotaRetriever"
import="org.apache.hadoop.hbase.quotas.QuotaSettings"
import="org.apache.hadoop.hbase.quotas.ThrottleSettings"
%>
<%
HMaster master = (HMaster) getServletContext().getAttribute(HMaster.MASTER);
Configuration conf = master.getConfiguration();
pageContext.setAttribute("pageTitle", "HBase Master Quotas: " + master.getServerName());
List regionServerThrottles = new ArrayList<>();
List namespaceThrottles = new ArrayList<>();
List userThrottles = new ArrayList<>();
MasterQuotaManager quotaManager = master.getMasterQuotaManager();
boolean exceedThrottleQuotaEnabled = false;
if (quotaManager != null) {
exceedThrottleQuotaEnabled = quotaManager.isExceedThrottleQuotaEnabled();
try (QuotaRetriever scanner = QuotaRetriever.open(conf, null)) {
for (QuotaSettings quota : scanner) {
if (quota instanceof ThrottleSettings) {
ThrottleSettings throttle = (ThrottleSettings) quota;
if (throttle.getUserName() != null) {
userThrottles.add(throttle);
} else if (throttle.getNamespace() != null) {
namespaceThrottles.add(throttle);
} else if (throttle.getRegionServer() != null) {
regionServerThrottles.add(throttle);
}
}
}
}
}
%>
Throttle Quotas
<%if (quotaManager != null) {%>
Rpc Throttle Enabled
<%if (quotaManager.isRpcThrottleEnabled()) {%>
Rpc throttle is enabled.
<% } else {%>
Rpc throttle is disabled. All requests will not be throttled.
Use 'enable_rpc_throttle' shell command to enable it.
<% } %>
Exceed Throttle Quota Enabled
<%if (exceedThrottleQuotaEnabled) {%>
Exceed throttle quota is enabled. The user/table/namespace throttle quotas can exceed the limit
if a region server has available quotas.
Use 'disable_exceed_throttle_quota' shell command to disable it.
<% } else {%>
Exceed throttle quota is disabled.
<% } %>
RegionServer Throttle Quotas
<%
if (regionServerThrottles.size() > 0) {
%>
RegionServer
Limit
Type
TimeUnit
Scope
<% for (ThrottleSettings throttle : regionServerThrottles) { %>
<%= throttle.getRegionServer() == null ? "" : throttle.getRegionServer() %>
<%= throttle.getSoftLimit() %>
<%= throttle.getThrottleType() %>
<%= throttle.getTimeUnit() %>
<%= throttle.getQuotaScope() %>
<% if (exceedThrottleQuotaEnabled && throttle.getTimeUnit() != null && throttle.getTimeUnit() != TimeUnit.SECONDS) { %>
Exceed throttle quota is enabled, but RegionServer throttle is not in SECONDS time unit.
<% }%>
<% } %>
<% } else if (exceedThrottleQuotaEnabled) { %>
Exceed throttle quota is enabled, but RegionServer throttle quotas are not set.
Please set RegionServer read and write throttle quotas in SECONDS time unit.
eg. set_quota TYPE => THROTTLE, REGIONSERVER => 'all', THROTTLE_TYPE => WRITE, LIMIT => '20000req/sec'
<%}%>
Namespace Throttle Quotas
<%
if (namespaceThrottles.size() > 0) {
%>
Namespace
Limit
Type
TimeUnit
Scope
<% for (ThrottleSettings throttle : namespaceThrottles) { %>
<%= throttle.getNamespace() == null ? "" : throttle.getNamespace() %>
<%= throttle.getSoftLimit() %>
<%= throttle.getThrottleType() %>
<%= throttle.getTimeUnit() %>
<%= throttle.getQuotaScope() %>
<% } %>
<% } %>
User Throttle Quotas
<%
if (userThrottles.size() > 0) {
%>
User
Namespace
Table
Limit
Type
TimeUnit
Scope
<% for (ThrottleSettings throttle : userThrottles) { %>
<%= throttle.getUserName() == null ? "" : throttle.getUserName() %>
<%= throttle.getNamespace() == null ? "" : throttle.getNamespace() %>
<%= throttle.getTableName() == null ? "" : throttle.getTableName() %>
<%= throttle.getSoftLimit() %>
<%= throttle.getThrottleType() %>
<%= throttle.getTimeUnit() %>
<%= throttle.getQuotaScope() %>
<% } %>
<% } %>
<% } %>