All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hbase-webapps.master.procedures.jsp Maven / Gradle / Ivy

There is a newer version: 3.0.0-beta-1
Show newest version
<%--
/**
 * 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="static org.apache.commons.lang3.StringEscapeUtils.escapeXml"
  import="java.util.Collections"
  import="java.util.Comparator"
  import="java.util.ArrayList"
  import="java.util.Date"
  import="java.util.List"
  import="java.util.Set"
  import="org.apache.hadoop.hbase.master.HMaster"
  import="org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv"
  import="org.apache.hadoop.hbase.procedure2.LockedResource"
  import="org.apache.hadoop.hbase.procedure2.Procedure"
  import="org.apache.hadoop.hbase.procedure2.ProcedureExecutor"
  import="org.apache.hadoop.hbase.procedure2.util.StringUtils"
  import="org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix"
%>
<%
  HMaster master = (HMaster) getServletContext().getAttribute(HMaster.MASTER);
  ProcedureExecutor procExecutor = master.getMasterProcedureExecutor();
  List> procedures = procExecutor.getProcedures();
  Collections.sort(procedures, new Comparator() {
    @Override
    public int compare(Procedure lhs, Procedure rhs) {
      long cmp = lhs.getParentProcId() - rhs.getParentProcId();
      cmp = cmp != 0 ? cmp : lhs.getProcId() - rhs.getProcId();
      return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
    }
  });

  List lockedResources = master.getLocks();
  pageContext.setAttribute("pageTitle", "HBase Master Procedures: " + master.getServerName());
%>

    


We do not list procedures that have completed successfully; their number makes it hard to spot the problematics.

<% int displayCount = 0; for (Procedure proc : procedures) { // Don't show SUCCESS procedures. if (proc.isSuccess()) { continue; } displayCount++; %> <% } %> <% if (displayCount > 0) { %>

<%= displayCount %> procedure(s).

<% } %>
Id Parent State Owner Type Start Time Last Update Errors Parameters
<%= proc.getProcId() %> <%= proc.hasParent() ? proc.getParentProcId() : "" %> <%= escapeXml(proc.getState().toString() + (proc.isBypass() ? "(Bypass)" : "")) %> <%= proc.hasOwner() ? escapeXml(proc.getOwner()) : "" %> <%= escapeXml(proc.getProcName()) %> <%= new Date(proc.getSubmittedTime()) %> <%= new Date(proc.getLastUpdate()) %> <%= escapeXml(proc.isFailed() ? proc.getException().unwrapRemoteIOException().getMessage() : "") %> <%= escapeXml(proc.toString()) %>

<% if (lockedResources.size() > 0) { %>

<%= lockedResources.size() %> lock(s).

<% } %> <% for (LockedResource lockedResource : lockedResources) { %>

<%= lockedResource.getResourceType() %>: <%= lockedResource.getResourceName() %>

<% switch (lockedResource.getLockType()) { case EXCLUSIVE: %>

Lock type: EXCLUSIVE

Owner procedure: <%= escapeXml(lockedResource.getExclusiveLockOwnerProcedure().toStringDetails()) %>

<% break; case SHARED: %>

Lock type: SHARED

Number of shared locks: <%= lockedResource.getSharedLockCount() %>

<% break; } List> waitingProcedures = lockedResource.getWaitingProcedures(); if (!waitingProcedures.isEmpty()) { %>

Waiting procedures

<% for (Procedure proc : procedures) { %> <% } %>
<%= escapeXml(proc.toStringDetails()) %>
<% } %> <% } %>





© 2015 - 2024 Weber Informatics LLC | Privacy Policy