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

webapps.worker.queryplan.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.tajo.webapp.StaticHttpServer" %>
<%@ page import="org.apache.tajo.worker.*" %>
<%@ page import="org.apache.tajo.querymaster.Query" %>
<%@ page import="org.apache.tajo.QueryId" %>
<%@ page import="org.apache.tajo.util.TajoIdUtils" %>
<%@ page import="org.apache.tajo.querymaster.QueryMasterTask" %>
<%@ page import="org.apache.tajo.querymaster.Stage" %>
<%@ page import="org.apache.tajo.engine.planner.global.ExecutionBlock" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.tajo.ExecutionBlockId" %>
<%@ page import="org.apache.tajo.engine.planner.global.MasterPlan" %>
<%@ page import="org.apache.tajo.engine.planner.global.DataChannel" %>

<%
  QueryId queryId = TajoIdUtils.parseQueryId(request.getParameter("queryId"));

  TajoWorker tajoWorker = (TajoWorker) StaticHttpServer.getInstance().getAttribute("tajo.info.server.object");
  QueryMasterTask queryMasterTask = tajoWorker.getWorkerContext()
          .getQueryMasterManagerService().getQueryMaster().getQueryMasterTask(queryId, true);

  if(queryMasterTask == null) {
    out.write("");
    return;
  }

  Query query = queryMasterTask.getQuery();

  Map stageMap = new HashMap();

  for(Stage eachStage : query.getStages()) {
    stageMap.put(eachStage.getId(), eachStage);
  }

  class StageInfo {
    ExecutionBlock executionBlock;
    Stage stage;
    ExecutionBlockId parentId;
    int px;
    int py;
    int pos; // 0: mid 1: left 2: right
    public StageInfo(ExecutionBlock executionBlock, Stage stage, ExecutionBlockId parentId, int px, int py, int pos) {
      this.executionBlock = executionBlock;
      this.stage = stage;
      this.parentId = parentId;
      this.px = px;
      this.py = py;
      this.pos = pos;
    }
  }
%>




  
  
  
  Tajo
  
  
  


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

Tajo Worker: <%=tajoWorker.getWorkerContext().getWorkerName()%>


Distributed Query Execution Plan

NEW
ALLOCATED
INIT
RUNNING
SUCCEEDED
FAILED
<% MasterPlan masterPlan = query.getPlan(); String curIdStr = null; int x=35, y=1; int pos; List stageInfos = new ArrayList(); stageInfos.add(new StageInfo(masterPlan.getRoot(), null, null, x, y, 0)); while (!stageInfos.isEmpty()) { StageInfo eachStageInfo = stageInfos.remove(0); curIdStr = eachStageInfo.executionBlock.getId().toString(); y = eachStageInfo.py + 13; if (eachStageInfo.pos == 0) { x = eachStageInfo.px; } else if (eachStageInfo.pos == 1) { x = eachStageInfo.px - 20; } else if (eachStageInfo.pos == 2) { x = eachStageInfo.px + 20; } %> <% if (eachStageInfo.parentId != null) { String outgoing = ""; String prefix = ""; for (DataChannel channel : masterPlan.getOutgoingChannels(eachStageInfo.executionBlock.getId())) { outgoing += prefix + channel.getShuffleType(); prefix = "; "; } %> <% } //end of if %> <% List children = masterPlan.getChilds(eachStageInfo.executionBlock.getId()); if (children.size() == 1) { pos = 0; } else { pos = 1; } for (ExecutionBlock child : children) { stageInfos.add(new StageInfo(child, stageMap.get(child.getId()), eachStageInfo.executionBlock.getId(), x, y, pos++)); } } //end of while %>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy