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

webapps.admin.index.jsp Maven / Gradle / Ivy

The 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 language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<%@ page import="org.apache.hadoop.fs.FileSystem" %>
<%@ page import="org.apache.tajo.conf.TajoConf" %>
<%@ page import="org.apache.tajo.master.TajoMaster" %>
<%@ page import="org.apache.tajo.service.ServiceTracker" %>
<%@ page import="org.apache.tajo.service.TajoMasterInfo" %>
<%@ page import="org.apache.tajo.master.rm.NodeStatus" %>
<%@ page import="org.apache.tajo.master.rm.NodeState" %>
<%@ page import="org.apache.tajo.storage.TablespaceManager" %>
<%@ page import="org.apache.tajo.storage.Tablespace" %>
<%@ page import="org.apache.tajo.util.NetUtils" %>
<%@ page import="org.apache.tajo.util.TUtil" %>
<%@ page import="org.apache.tajo.webapp.StaticHttpServer" %>
<%@ page import="java.util.List" %>
<%@ page import="java.net.InetSocketAddress" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.util.Map" %>

<%
  TajoMaster master = (TajoMaster) StaticHttpServer.getInstance().getAttribute("tajo.info.server.object");

  String[] masterName = master.getMasterName().split(":");
  InetSocketAddress socketAddress = new InetSocketAddress(masterName[0], Integer.parseInt(masterName[1]));
  String masterLabel = socketAddress.getAddress().getHostName()+ ":" + socketAddress.getPort();

  Map workers = master.getContext().getResourceManager().getNodes();
  Map inactiveWorkers = master.getContext().getResourceManager().getInactiveNodes();

  int numWorkers = 0;
  int numLiveWorkers = 0;
  int numDeadWorkers = 0;
  int numDecommissionWorkers = 0;

  int numQueryMasters = 0;
  int numLiveQueryMasters = 0;
  int numDeadQueryMasters = 0;
  int runningQueryMasterTask = 0;


  for(NodeStatus eachWorker: workers.values()) {
    numQueryMasters++;
    numLiveQueryMasters++;
    runningQueryMasterTask += eachWorker.getNumRunningQueryMaster();
    numWorkers++;
    numLiveWorkers++;
  }

  for (NodeStatus eachWorker : inactiveWorkers.values()) {
    if (eachWorker.getState() == NodeState.LOST) {
      numQueryMasters++;
      numDeadQueryMasters++;
      numWorkers++;
      numDeadWorkers++;
    } else if(eachWorker.getState() == NodeState.DECOMMISSIONED) {
      numDecommissionWorkers++;
    }
  }

  String numDeadWorkersHtml = numDeadWorkers == 0 ? "0" : "" + numDeadWorkers + "";
  String numDeadQueryMastersHtml = numDeadQueryMasters == 0 ? "0" : "" + numDeadQueryMasters + "";

  ServiceTracker haService = master.getContext().getHAService();
  List masters = TUtil.newList();

  String activeLabel = "";
  if (haService != null) {
    if (haService.isActiveMaster()) {
      activeLabel = "(active)";
    } else {
      activeLabel = "(backup)";
    }

    masters.addAll(haService.getMasters());
  }

  int numLiveMasters = 0;
  int numDeadMasters = 0;

  for(TajoMasterInfo eachMaster : masters) {
    if (eachMaster.isAvailable()) {
      numLiveMasters++;
    } else {
      numDeadMasters++;
    }
  }
%>




  
  
  Tajo


<%@ include file="header.jsp"%>

Tajo Master: <%=masterLabel%> <%=activeLabel%>


Master Status

Version:<%=master.getVersion()%>
Started:<%=new Date(master.getStartTime())%>
File System:<%=master.getContext().getConf().get(FileSystem.FS_DEFAULT_NAME_KEY)%>
Root dir:<%=TajoConf.getTajoRootDir(master.getContext().getConf())%>
System dir:<%=TajoConf.getSystemDir(master.getContext().getConf())%>
Warehouse dir:<%=TajoConf.getWarehouseDir(master.getContext().getConf())%>
Staging dir:<%=TajoConf.getDefaultRootStagingDir(master.getContext().getConf())%>
Client Service:<%=master.getTajoMasterClientService().getBindAddress().getHostName() + ":" + master.getTajoMasterClientService().getBindAddress().getPort()%>
Catalog Service:<%=master.getCatalogServer().getBindAddress().getHostName() + ":" + master.getCatalogServer().getBindAddress().getPort()%>
Heap(Free/Total/Max): <%=Runtime.getRuntime().freeMemory()/1024/1024%> MB / <%=Runtime.getRuntime().totalMemory()/1024/1024%> MB / <%=Runtime.getRuntime().maxMemory()/1024/1024%> MB
Configuration:detail...
Environment:detail...
Threads:thread dump...

Tablespaces

<% for (Tablespace space : TablespaceManager.getAllTablespaces()) { if (space.isVisible()) { %> <% }}%>
Tablespace NameURIHandler
<%=space.getName()%><%=space.getUri()%><%=space.getClass().getName()%>

Cluster Summary

<% if (haService != null) { %> <% } %>
TypeTotalLiveDeadRunning MasterAvailableTotal
Query Master <%=numQueryMasters%> <%=numLiveQueryMasters%> <%=numDeadQueryMastersHtml%> <%=runningQueryMasterTask%> - -
Worker <%=numWorkers%> <%=numLiveWorkers%> <%=numDeadWorkersHtml%> - <%=master.getContext().getResourceManager().getScheduler().getClusterResource()%> <%=master.getContext().getResourceManager().getScheduler().getMaximumResourceCapability()%>
Masters <%=haService.getMasters().size()%> <%=numLiveMasters%> <%=numDeadMasters%> - - -


Query Summary

Running QueriesFinished QueriesAverage Execution TimeMin. Execution TimeMax. Execution Time
<%=master.getContext().getQueryJobManager().getRunningQueries().size()%> <%=master.getContext().getQueryJobManager().getExecutedQuerySize() %> <%=master.getContext().getQueryJobManager().getAvgExecutionTime()/1000%> sec <%=master.getContext().getQueryJobManager().getMinExecutionTime()/1000%> sec <%=master.getContext().getQueryJobManager().getMaxExecutionTime()/1000%> sec




© 2015 - 2025 Weber Informatics LLC | Privacy Policy