1 /**
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements.  See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership.  The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License.  You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 package org.apache.hadoop.yarn.server.resourcemanager.webapp;
20 
21 import static org.apache.hadoop.yarn.util.StringHelper.join;
22 import static org.apache.hadoop.yarn.webapp.view.JQueryUI.DATATABLES;
23 import static org.apache.hadoop.yarn.webapp.view.JQueryUI.DATATABLES_ID;
24 import static org.apache.hadoop.yarn.webapp.view.JQueryUI.initID;
25 
26 import org.apache.hadoop.yarn.server.webapp.WebPageUtils;
27 import org.apache.hadoop.yarn.webapp.SubView;
28 import org.apache.hadoop.yarn.webapp.YarnWebParams;
29 
30 
31 public class AppAttemptPage extends RmView {
32 
33   @Override
preHead(Page.HTML<_> html)34   protected void preHead(Page.HTML<_> html) {
35     commonPreHead(html);
36 
37     String appAttemptId = $(YarnWebParams.APPLICATION_ATTEMPT_ID);
38     set(
39       TITLE,
40       appAttemptId.isEmpty() ? "Bad request: missing application attempt ID"
41           : join("Application Attempt ",
42             $(YarnWebParams.APPLICATION_ATTEMPT_ID)));
43 
44     set(DATATABLES_ID, "containers");
45     set(initID(DATATABLES, "containers"), WebPageUtils.containersTableInit());
46     setTableStyles(html, "containers", ".queue {width:6em}", ".ui {width:8em}");
47 
48     set(YarnWebParams.WEB_UI_TYPE, YarnWebParams.RM_WEB_UI);
49   }
50 
51   @Override
content()52   protected Class<? extends SubView> content() {
53     return RMAppAttemptBlock.class;
54   }
55 
56 }