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

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

There is a newer version: 0.11.3
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 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.ipc.QueryCoordinatorProtocol" %>
<%@ 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.QueryInProgress" %>
<%@ page import="org.apache.tajo.master.rm.Worker" %>
<%@ page import="org.apache.tajo.master.rm.WorkerState" %>
<%@ 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.util.Collection" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.net.InetSocketAddress" %>
<%@ page import="org.apache.tajo.service.ServiceTracker" %>

<%
  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().getWorkers();
  Map inactiveWorkers = master.getContext().getResourceManager().getInactiveWorkers();

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

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


  QueryCoordinatorProtocol.ClusterResourceSummary clusterResourceSummary =
          master.getContext().getResourceManager().getClusterResourceSummary();

  for(Worker eachWorker: workers.values()) {
    if(eachWorker.getResource().isQueryMasterMode()) {
      numQueryMasters++;
      numLiveQueryMasters++;
      runningQueryMasterTask += eachWorker.getResource().getNumQueryMasterTasks();
    }
    if(eachWorker.getResource().isTaskRunnerMode()) {
      numWorkers++;
      numLiveWorkers++;
    }
  }

  for (Worker eachWorker : inactiveWorkers.values()) {
    if (eachWorker.getState() == WorkerState.LOST) {
      if(eachWorker.getResource().isQueryMasterMode()) {
        numQueryMasters++;
        numDeadQueryMasters++;
      }
      if(eachWorker.getResource().isTaskRunnerMode()) {
        numWorkers++;
        numDeadWorkers++;
      }
    } else if(eachWorker.getState() == WorkerState.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:<%=NetUtils.normalizeInetSocketAddress(master.getTajoMasterClientService().getBindAddress())%>
Catalog Service:<%=master.getCatalogServer().getCatalogServerName()%>
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...

Cluster Summary

<% if (haService != null) { %> <% } %>
TypeTotalLiveDeadRunning MasterMemory Resource
(used/total)
Disk Resource
(used/total)
Query Master <%=numQueryMasters%> <%=numLiveQueryMasters%> <%=numDeadQueryMastersHtml%> <%=runningQueryMasterTask%> - -
Worker <%=numWorkers%> <%=numLiveWorkers%> <%=numDeadWorkersHtml%> - <%=clusterResourceSummary.getTotalMemoryMB() - clusterResourceSummary.getTotalAvailableMemoryMB()%>/<%=clusterResourceSummary.getTotalMemoryMB()%> <%=clusterResourceSummary.getTotalDiskSlots() - clusterResourceSummary.getTotalAvailableDiskSlots()%>/<%=clusterResourceSummary.getTotalDiskSlots()%>
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