Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
tag guide user to see all region messages.
*/
private static String moreRegionsToRender(int numRegionsRendered, int numRegions, String fqtn) {
if (numRegions > numRegionsRendered) {
String allRegionsUrl = "?name=" + URLEncoder.encode(fqtn) + "&numRegions=all";
return "This table has " + numRegions
+ " regions in total, in order to improve the page load time, only "
+ numRegionsRendered + " regions are displayed here, click here to see all regions.
";
}
return "";
}
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List _jspx_dependants;
private org.glassfish.jsp.api.ResourceInjector _jspx_resourceInjector;
public java.util.List getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
_jspx_resourceInjector = (org.glassfish.jsp.api.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector");
out.write("\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
out.write('\n');
final String ZEROMB = "0 MB";
HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
Configuration conf = master.getConfiguration();
String fqtn = request.getParameter("name");
final String escaped_fqtn = StringEscapeUtils.escapeHtml4(fqtn);
Table table = master.getConnection().getTable(TableName.valueOf(fqtn));
boolean showFragmentation = conf.getBoolean("hbase.master.ui.fragmentation.enabled", false);
boolean readOnly = !InfoServer.canUserModifyUI(request, getServletContext(), conf);
int numMetaReplicas =
master.getTableDescriptors().get(TableName.META_TABLE_NAME).getRegionReplication();
Map frags = null;
if (showFragmentation) {
frags = FSUtils.getTableFragmentation(master);
}
boolean quotasEnabled = conf.getBoolean("hbase.quota.enabled", false);
String action = request.getParameter("action");
String key = request.getParameter("key");
String left = request.getParameter("left");
String right = request.getParameter("right");
long totalStoreFileSizeMB = 0;
final String numRegionsParam = request.getParameter("numRegions");
// By default, the page render up to 10000 regions to improve the page load time
int numRegionsToRender = 10000;
if (numRegionsParam != null) {
// either 'all' or a number
if (numRegionsParam.equals("all")) {
numRegionsToRender = -1;
} else {
try {
numRegionsToRender = Integer.parseInt(numRegionsParam);
} catch (NumberFormatException ex) {
// ignore
}
}
}
int numRegions = 0;
String pageTitle;
if ( !readOnly && action != null ) {
pageTitle = "HBase Master: " + StringEscapeUtils.escapeHtml4(master.getServerName().toString());
} else {
pageTitle = "Table: " + escaped_fqtn;
}
pageContext.setAttribute("pageTitle", pageTitle);
final AsyncConnection connection = master.getAsyncConnection();
final AsyncAdmin admin = connection.getAdminBuilder()
.setOperationTimeout(5, TimeUnit.SECONDS)
.build();
final MetaBrowser metaBrowser = new MetaBrowser(connection, request);
out.write('\n');
out.write('\n');
org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "header.jsp" + "?" + org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode("pageTitle", request.getCharacterEncoding())+ "=" + org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${pageTitle}", java.lang.String.class, (PageContext)_jspx_page_context, null), request.getCharacterEncoding()), out, false);
out.write('\n');
out.write('\n');
// handle the case for fqtn is null or master is not initialized with error message + redirect
if (fqtn == null || ! master.isInitialized()) {
out.write("\n
\n \n \n ");
// NOTE: Presumes meta with one or more replicas
for (int j = 0; j < numMetaReplicas; j++) {
RegionInfo meta = RegionReplicaUtil.getRegionInfoForReplica(
RegionInfoBuilder.FIRST_META_REGIONINFO, j);
//If a metaLocation is null, All of its info would be empty here to be displayed.
RegionStateNode rsn = master.getAssignmentManager().getRegionStates()
.getRegionStateNode(meta);
ServerName metaLocation = rsn != null ? rsn.getRegionLocation() : null;
for (int i = 0; i < 1; i++) {
//If metaLocation is null, default value below would be displayed in UI.
String hostAndPort = "";
String readReq = "N/A";
String writeReq = "N/A";
String fileSize = ZEROMB;
String fileCount = "N/A";
String memSize = ZEROMB;
if (metaLocation != null) {
ServerMetrics sl = master.getServerManager().getLoad(metaLocation);
// The host name portion should be safe, but I don't know how we handle IDNs so err on the side of failing safely.
hostAndPort = URLEncoder.encode(metaLocation.getHostname()) + ":" + master.getRegionServerInfoPort(metaLocation);
if (sl != null) {
Map map = sl.getRegionMetrics();
if (map.containsKey(meta.getRegionName())) {
RegionMetrics load = map.get(meta.getRegionName());
readReq = String.format("%,1d", load.getReadRequestCount());
writeReq = String.format("%,1d", load.getWriteRequestCount());
double rSize = load.getStoreFileSize().get(Size.Unit.BYTE);
if (rSize > 0) {
fileSize = StringUtils.byteDesc((long) rSize);
}
fileCount = String.format("%,1d", load.getStoreFileCount());
double mSize = load.getMemStoreSize().get(Size.Unit.BYTE);
if (mSize > 0) {
memSize = StringUtils.byteDesc((long)mSize);
}
}
}
}
out.write("\n
\n \n \n ");
// NOTE: Presumes meta with one or more replicas
for (int j = 0; j < numMetaReplicas; j++) {
RegionInfo meta = RegionReplicaUtil.getRegionInfoForReplica(
RegionInfoBuilder.FIRST_META_REGIONINFO, j);
//If a metaLocation is null, All of its info would be empty here to be displayed.
RegionStateNode rsn = master.getAssignmentManager().getRegionStates()
.getRegionStateNode(meta);
ServerName metaLocation = rsn != null ? rsn.getRegionLocation() : null;
for (int i = 0; i < 1; i++) {
//If metaLocation is null, default value below would be displayed in UI.
String hostAndPort = "";
float locality = 0.0f;
float localityForSsd = 0.0f;
if (metaLocation != null) {
ServerMetrics sl = master.getServerManager().getLoad(metaLocation);
hostAndPort = URLEncoder.encode(metaLocation.getHostname()) + ":" + master.getRegionServerInfoPort(metaLocation);
if (sl != null) {
Map map = sl.getRegionMetrics();
if (map.containsKey(meta.getRegionName())) {
RegionMetrics load = map.get(meta.getRegionName());
locality = load.getDataLocality();
localityForSsd = load.getDataLocalityForSsd();
}
}
}
out.write("\n
\n \n \n ");
// NOTE: Presumes meta with one or more replicas
for (int j = 0; j < numMetaReplicas; j++) {
RegionInfo meta = RegionReplicaUtil.getRegionInfoForReplica(
RegionInfoBuilder.FIRST_META_REGIONINFO, j);
//If a metaLocation is null, All of its info would be empty here to be displayed.
RegionStateNode rsn = master.getAssignmentManager().getRegionStates()
.getRegionStateNode(meta);
ServerName metaLocation = rsn != null ? rsn.getRegionLocation() : null;
for (int i = 0; i < 1; i++) {
//If metaLocation is null, default value below would be displayed in UI.
String hostAndPort = "";
long compactingCells = 0;
long compactedCells = 0;
String compactionProgress = "";
if (metaLocation != null) {
ServerMetrics sl = master.getServerManager().getLoad(metaLocation);
hostAndPort = URLEncoder.encode(metaLocation.getHostname()) + ":" + master.getRegionServerInfoPort(metaLocation);
if (sl != null) {
Map map = sl.getRegionMetrics();
if (map.containsKey(meta.getRegionName())) {
RegionMetrics load = map.get(meta.getRegionName());
compactingCells = load.getCompactingCellCount();
compactedCells = load.getCompactedCellCount();
if (compactingCells > 0) {
compactionProgress = String.format("%.2f", 100 * ((float)
compactedCells / compactingCells)) + "%";
}
}
}
}
out.write("\n