protected override void Render(HtmlBlock.Block html) { html.(typeof(MetricsOverviewTable)); Hamlet.UL <Hamlet.DIV <Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> > > ul = html.Div("#cs-wrapper.ui-widget").Div(".ui-widget-header.ui-corner-top").("Application Queues" ).().Div("#cs.ui-widget-content.ui-corner-bottom").Ul(); if (fs == null) { ul.Li().A(Q).$style(Width(QMaxWidth)).Span().$style(QEnd).("100% ").().Span(".q", "default").().(); } else { FairSchedulerInfo sinfo = new FairSchedulerInfo(fs); fsqinfo.qinfo = sinfo.GetRootQueueInfo(); float used = fsqinfo.qinfo.GetUsedMemoryFraction(); ul.Li().$style("margin-bottom: 1em").Span().$style("font-weight: bold").("Legend:" ).().Span().$class("qlegend ui-corner-all").$style(QGiven).$title("The steady fair shares consider all queues, " + "both active (with running applications) and inactive.").(SteadyFairShare).() .Span().$class("qlegend ui-corner-all").$style(QInstantaneousFs).$title("The instantaneous fair shares consider only active " + "queues (with running applications).").(InstantaneousFairShare).().Span().$class ("qlegend ui-corner-all").$style(QUnder).("Used").().Span().$class("qlegend ui-corner-all" ).$style(QOver).("Used (over fair share)").().Span().$class("qlegend ui-corner-all ui-state-default" ).("Max Capacity").().().Li().A(Q).$style(Width(QMaxWidth)).Span().$style(StringHelper.Join (Width(used), ";left:0%;", used > 1 ? QOver : QUnder)).(".").().Span(".q", "root" ).().Span().$class("qstats").$style(Left(QStatsPos)).(StringHelper.Join(Percent( used), " used")).().(typeof(FairSchedulerPage.QueueBlock)).(); } ul.().().Script().$type("text/javascript").("$('#cs').hide();").().().(typeof(FairSchedulerAppsBlock )); }
private void CreateResourceRequestsTable(HtmlBlock.Block html) { AppInfo app = new AppInfo(rm, rm.GetRMContext().GetRMApps()[this.appAttemptId.GetApplicationId ()], true, WebAppUtils.GetHttpSchemePrefix(conf)); IList <ResourceRequest> resourceRequests = app.GetResourceRequests(); if (resourceRequests == null || resourceRequests.IsEmpty()) { return; } Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> div = html.Div(JQueryUI.InfoWrap ); Hamlet.TABLE <Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> > table = div .H3("Total Outstanding Resource Requests: " + GetTotalResource(resourceRequests) ).Table("#ResourceRequests"); table.Tr().Th(JQueryUI.Th, "Priority").Th(JQueryUI.Th, "ResourceName").Th(JQueryUI .Th, "Capability").Th(JQueryUI.Th, "NumContainers").Th(JQueryUI.Th, "RelaxLocality" ).Th(JQueryUI.Th, "NodeLabelExpression").(); bool odd = false; foreach (ResourceRequest request in resourceRequests) { if (request.GetNumContainers() == 0) { continue; } table.Tr((odd = !odd) ? JQueryUI.Odd : JQueryUI.Even).Td(request.GetPriority().ToString ()).Td(request.GetResourceName()).Td(request.GetCapability().ToString()).Td(request .GetNumContainers().ToString()).Td(request.GetRelaxLocality().ToString()).Td(request .GetNodeLabelExpression() == null ? "N/A" : request.GetNodeLabelExpression()).(); } table.(); div.(); }
protected override void Render(HtmlBlock.Block html) { html.(typeof(MetricsOverviewTable)); Hamlet.UL <Hamlet.DIV <Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> > > ul = html.Div("#cs-wrapper.ui-widget").Div(".ui-widget-header.ui-corner-top").("FifoScheduler Queue" ).().Div("#cs.ui-widget-content.ui-corner-bottom").Ul(); if (fs == null) { ul.Li().A(Q).$style(Width(WidthF)).Span().$style(QEnd).("100% ").().Span(".q", "default" ).().(); } else { float used = sinfo.GetUsedCapacity(); float set = sinfo.GetCapacity(); float delta = Math.Abs(set - used) + 0.001f; ul.Li().A(Q).$style(Width(WidthF)).$title(StringHelper.Join("used:", Percent(used ))).Span().$style(QEnd).("100%").().Span().$style(StringHelper.Join(Width(delta) , ';', used > set ? Over : Under, ';', used > set ? Left(set) : Left(used))).("." ).().Span(".q", sinfo.GetQueueName()).().(typeof(DefaultSchedulerPage.QueueInfoBlock )).(); } ul.().().Script().$type("text/javascript").("$('#cs').hide();").().().(typeof(AppsBlock )); }
protected override void Render(HtmlBlock.Block html) { ContainerId containerID; try { containerID = ConverterUtils.ToContainerId($(ContainerId)); } catch (ArgumentException) { html.P().("Invalid containerId " + $(ContainerId)).(); return; } Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> div = html.Div("#content" ); Org.Apache.Hadoop.Yarn.Server.Nodemanager.Containermanager.Container.Container container = this.nmContext.GetContainers()[containerID]; if (container == null) { div.H1("Unknown Container. Container might have completed, " + "please go back to the previous page and retry." ).(); return; } ContainerInfo info = new ContainerInfo(this.nmContext, container); Info("Container information").("ContainerID", info.GetId()).("ContainerState", info .GetState()).("ExitStatus", info.GetExitStatus()).("Diagnostics", info.GetDiagnostics ()).("User", info.GetUser()).("TotalMemoryNeeded", info.GetMemoryNeeded()).("TotalVCoresNeeded" , info.GetVCoresNeeded()).("logs", info.GetShortLogLink(), "Link to logs"); html.(typeof(InfoBlock)); }
protected override void Render(HtmlBlock.Block html) { html.(typeof(MetricsOverviewTable)); Hamlet.UL <Hamlet.DIV <Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> > > ul = html.Div("#cs-wrapper.ui-widget").Div(".ui-widget-header.ui-corner-top").("Application Queues" ).().Div("#cs.ui-widget-content.ui-corner-bottom").Ul(); if (cs == null) { ul.Li().A(Q).$style(Width(QMaxWidth)).Span().$style(QEnd).("100% ").().Span(".q", "default").().(); } else { CSQueue root = cs.GetRootQueue(); CapacitySchedulerInfo sinfo = new CapacitySchedulerInfo(root); csqinfo.csinfo = sinfo; csqinfo.qinfo = null; float used = sinfo.GetUsedCapacity() / 100; ul.Li().$style("margin-bottom: 1em").Span().$style("font-weight: bold").("Legend:" ).().Span().$class("qlegend ui-corner-all").$style(QGiven).("Capacity").().Span( ).$class("qlegend ui-corner-all").$style(QUnder).("Used").().Span().$class("qlegend ui-corner-all" ).$style(QOver).("Used (over capacity)").().Span().$class("qlegend ui-corner-all ui-state-default" ).("Max Capacity").().().Li().A(Q).$style(Width(QMaxWidth)).Span().$style(StringHelper.Join (Width(used), ";left:0%;", used > 1 ? QOver : QUnder)).(".").().Span(".q", "root" ).().Span().$class("qstats").$style(Left(QStatsPos)).(StringHelper.Join(Percent( used), " used")).().(typeof(CapacitySchedulerPage.QueueBlock)).(); } ul.().().Script().$type("text/javascript").("$('#cs').hide();").().().(typeof(RMAppsBlock )); }
protected override void Render(HtmlBlock.Block html) { string rmweb = $(AMParams.RmWeb); Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> nav = html.Div("#nav").H3 ("Cluster").Ul().Li().A(Url(rmweb, "cluster", "cluster"), "About").().Li().A(Url (rmweb, "cluster", "apps"), "Applications").().Li().A(Url(rmweb, "cluster", "scheduler" ), "Scheduler").().().H3("Application").Ul().Li().A(Url("app/info"), "About").() .Li().A(Url("app"), "Jobs").().(); if (app.GetJob() != null) { string jobid = MRApps.ToString(app.GetJob().GetID()); IList <AMInfo> amInfos = app.GetJob().GetAMInfos(); AMInfo thisAmInfo = amInfos[amInfos.Count - 1]; string nodeHttpAddress = thisAmInfo.GetNodeManagerHost() + ":" + thisAmInfo.GetNodeManagerHttpPort (); nav.H3("Job").Ul().Li().A(Url("job", jobid), "Overview").().Li().A(Url("jobcounters" , jobid), "Counters").().Li().A(Url("conf", jobid), "Configuration").().Li().A(Url ("tasks", jobid, "m"), "Map tasks").().Li().A(Url("tasks", jobid, "r"), "Reduce tasks" ).().Li().A(".logslink", Url(MRWebAppUtil.GetYARNWebappScheme(), nodeHttpAddress , "node", "containerlogs", thisAmInfo.GetContainerId().ToString(), app.GetJob(). GetUserName()), "AM Logs").().(); if (app.GetTask() != null) { string taskid = MRApps.ToString(app.GetTask().GetID()); nav.H3("Task").Ul().Li().A(Url("task", taskid), "Task Overview").().Li().A(Url("taskcounters" , taskid), "Counters").().(); } } nav.H3("Tools").Ul().Li().A("/conf", "Configuration").().Li().A("/logs", "Local logs" ).().Li().A("/stacks", "Server stacks").().Li().A("/jmx?qry=Hadoop:*", "Server metrics" ).().().(); }
protected override void Render(HtmlBlock.Block html) { html.Div("#nav").H3("Application History").Ul().Li().A(Url("apps"), "Applications" ).Ul().Li().A(Url("apps", YarnApplicationState.Finished.ToString()), YarnApplicationState .Finished.ToString()).().Li().A(Url("apps", YarnApplicationState.Failed.ToString ()), YarnApplicationState.Failed.ToString()).().Li().A(Url("apps", YarnApplicationState .Killed.ToString()), YarnApplicationState.Killed.ToString()).().().().().(); }
/* * (non-Javadoc) * @see org.apache.hadoop.yarn.webapp.view.HtmlBlock#render(org.apache.hadoop.yarn.webapp.view.HtmlBlock.Block) */ protected override void Render(HtmlBlock.Block html) { string jid = $(AMParams.JobId); if (jid.IsEmpty()) { html.P().("Sorry, can't do anything without a JobID.").(); return; } JobId jobID = MRApps.ToJobID(jid); Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job job = appContext.GetJob(jobID); if (job == null) { html.P().("Sorry, ", jid, " not found.").(); return; } Path confPath = job.GetConfFile(); try { ConfInfo info = new ConfInfo(job); html.Div().H3(confPath.ToString()).(); Hamlet.TBODY <Hamlet.TABLE <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> > tbody = html .Table("#conf").Thead().Tr().Th(JQueryUI.Th, "key").Th(JQueryUI.Th, "value").Th( JQueryUI.Th, "source chain").().().Tbody(); // Tasks table foreach (ConfEntryInfo entry in info.GetProperties()) { StringBuilder buffer = new StringBuilder(); string[] sources = entry.GetSource(); //Skip the last entry, because it is always the same HDFS file, and // output them in reverse order so most recent is output first bool first = true; for (int i = (sources.Length - 2); i >= 0; i--) { if (!first) { // \u2B05 is an arrow <-- buffer.Append(" \u2B05 "); } first = false; buffer.Append(sources[i]); } tbody.Tr().Td(entry.GetName()).Td(entry.GetValue()).Td(buffer.ToString()).(); } tbody.().Tfoot().Tr().Th().Input("search_init").$type(HamletSpec.InputType.text). $name("key").$value("key").().().Th().Input("search_init").$type(HamletSpec.InputType .text).$name("value").$value("value").().().Th().Input("search_init").$type(HamletSpec.InputType .text).$name("source chain").$value("source chain").().().().().(); } catch (IOException e) { Log.Error("Error while reading " + confPath, e); html.P().("Sorry got an error while reading conf file. ", confPath); } }
protected override void Render(HtmlBlock.Block html) { string RMWebAppURL = WebAppUtils.GetResolvedRemoteRMWebAppURLWithScheme(this.conf ); html.Div("#nav").H3().("ResourceManager").().Ul().Li().A(RMWebAppURL, "RM Home"). ().().H3().("NodeManager").().Ul().Li().A(Url("node"), "Node Information").().Li ().A(Url("allApplications"), "List of Applications").().Li().A(Url("allContainers" ), "List of Containers").().().H3("Tools").Ul().Li().A("/conf", "Configuration") .().Li().A("/logs", "Local logs").().Li().A("/stacks", "Server stacks").().Li(). A("/jmx?qry=Hadoop:*", "Server metrics").().().(); }
protected override void Render(HtmlBlock.Block html) { if (job == null) { html.P().("Sorry, no counters for nonexistent", $(AMParams.JobId, "job")).(); return; } if (!$(AMParams.TaskId).IsEmpty() && task == null) { html.P().("Sorry, no counters for nonexistent", $(AMParams.TaskId, "task")).(); return; } string columnType = task == null ? "Task" : "Task Attempt"; Hamlet.TBODY <Hamlet.TABLE <Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> > > tbody = html.Div(JQueryUI.InfoWrap).Table("#singleCounter").Thead().Tr().Th(".ui-state-default" , columnType).Th(".ui-state-default", "Value").().().Tbody(); foreach (KeyValuePair <string, long> entry in values) { Hamlet.TR <Hamlet.TBODY <Hamlet.TABLE <Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet > > > > row = tbody.Tr(); string id = entry.Key; string val = entry.Value.ToString(); if (task != null) { row.Td(id); row.Td().Br().$title(val).().(val).(); } else { row.Td().A(Url("singletaskcounter", entry.Key, $(AMParams.CounterGroup), $(AMParams .CounterName)), id).(); row.Td().Br().$title(val).().A(Url("singletaskcounter", entry.Key, $(AMParams.CounterGroup ), $(AMParams.CounterName)), val).(); } row.(); } tbody.().().(); }
protected override void Render(HtmlBlock.Block html) { Hamlet.TBODY <Hamlet.TABLE <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> > tbody = html .Table("#userinfo").Thead().$class("ui-widget-header").Tr().Th().$class("ui-state-default" ).("User Name").().Th().$class("ui-state-default").("Max Resource").().Th().$class ("ui-state-default").("Used Resource").().Th().$class("ui-state-default").("Max AM Resource" ).().Th().$class("ui-state-default").("Used AM Resource").().Th().$class("ui-state-default" ).("Schedulable Apps").().Th().$class("ui-state-default").("Non-Schedulable Apps" ).().().().Tbody(); AList <UserInfo> users = lqinfo.GetUsers().GetUsersList(); foreach (UserInfo userInfo in users) { tbody.Tr().Td(userInfo.GetUsername()).Td(userInfo.GetUserResourceLimit().ToString ()).Td(userInfo.GetResourcesUsed().ToString()).Td(lqinfo.GetUserAMResourceLimit( ).ToString()).Td(userInfo.GetAMResourcesUsed().ToString()).Td(Sharpen.Extensions.ToString (userInfo.GetNumActiveApplications())).Td(Sharpen.Extensions.ToString(userInfo.GetNumPendingApplications ())).(); } html.Div().$class("usersinfo").H5("Active Users Info").(); tbody.().(); }
/* * (non-Javadoc) * @see org.apache.hadoop.yarn.webapp.view.HtmlBlock#render(org.apache.hadoop.yarn.webapp.view.HtmlBlock.Block) */ protected override void Render(HtmlBlock.Block html) { Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> nav = html.Div("#nav").H3 ("Application").Ul().Li().A(Url("about"), "About").().Li().A(Url("app"), "Jobs") .().(); if (app.GetJob() != null) { string jobid = MRApps.ToString(app.GetJob().GetID()); nav.H3("Job").Ul().Li().A(Url("job", jobid), "Overview").().Li().A(Url("jobcounters" , jobid), "Counters").().Li().A(Url("conf", jobid), "Configuration").().Li().A(Url ("tasks", jobid, "m"), "Map tasks").().Li().A(Url("tasks", jobid, "r"), "Reduce tasks" ).().(); if (app.GetTask() != null) { string taskid = MRApps.ToString(app.GetTask().GetID()); nav.H3("Task").Ul().Li().A(Url("task", taskid), "Task Overview").().Li().A(Url("taskcounters" , taskid), "Counters").().(); } } nav.H3("Tools").Ul().Li().A("/conf", "Configuration").().Li().A("/logs", "Local logs" ).().Li().A("/stacks", "Server stacks").().Li().A("/jmx?qry=Hadoop:*", "Server metrics" ).().().(); }
private void CreateContainerLocalityTable(HtmlBlock.Block html) { RMAppAttemptMetrics attemptMetrics = null; RMAppAttempt attempt = GetRMAppAttempt(); if (attempt != null) { attemptMetrics = attempt.GetRMAppAttemptMetrics(); } if (attemptMetrics == null) { return; } Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> div = html.Div(JQueryUI.InfoWrap ); Hamlet.TABLE <Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> > table = div .H3("Total Allocated Containers: " + attemptMetrics.GetTotalAllocatedContainers( )).H3("Each table cell" + " represents the number of NodeLocal/RackLocal/OffSwitch containers" + " satisfied by NodeLocal/RackLocal/OffSwitch resource requests.").Table("#containerLocality" ); table.Tr().Th(JQueryUI.Th, string.Empty).Th(JQueryUI.Th, "Node Local Request").Th (JQueryUI.Th, "Rack Local Request").Th(JQueryUI.Th, "Off Switch Request").(); string[] containersType = new string[] { "Num Node Local Containers (satisfied by)" , "Num Rack Local Containers (satisfied by)", "Num Off Switch Containers (satisfied by)" }; bool odd = false; for (int i = 0; i < attemptMetrics.GetLocalityStatistics().Length; i++) { table.Tr((odd = !odd) ? JQueryUI.Odd : JQueryUI.Even).Td(containersType[i]).Td(attemptMetrics .GetLocalityStatistics()[i][0].ToString()).Td(i == 0 ? string.Empty : attemptMetrics .GetLocalityStatistics()[i][1].ToString()).Td(i <= 1 ? string.Empty : attemptMetrics .GetLocalityStatistics()[i][2].ToString()).(); } table.(); div.(); }
protected override void Render(HtmlBlock.Block html) { Hamlet.UL <Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> > mainList = html .Div("#nav").H3("Cluster").Ul().Li().A(Url("cluster"), "About").().Li().A(Url("nodes" ), "Nodes").().Li().A(Url("nodelabels"), "Node Labels").(); Hamlet.UL <Hamlet.LI <Hamlet.UL <Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet > > > > subAppsList = mainList.Li().A(Url("apps"), "Applications").Ul(); subAppsList.Li().(); foreach (YarnApplicationState state in YarnApplicationState.Values()) { subAppsList.Li().A(Url("apps", state.ToString()), state.ToString()).(); } subAppsList.().(); mainList.Li().A(Url("scheduler"), "Scheduler").().().H3("Tools").Ul().Li().A("/conf" , "Configuration").().Li().A("/logs", "Local logs").().Li().A("/stacks", "Server stacks" ).().Li().A("/jmx?qry=Hadoop:*", "Server metrics").().().(); }
protected override void Render(HtmlBlock.Block html) { string jid = $(AMParams.JobId); if (jid.IsEmpty()) { html.P().("Sorry, can't do anything without a JobID.").(); return; } JobId jobID = MRApps.ToJobID(jid); Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job job = appContext.GetJob(jobID); if (job == null) { html.P().("Sorry, ", jid, " not found.").(); return; } IList <AMInfo> amInfos = job.GetAMInfos(); string amString = amInfos.Count == 1 ? "ApplicationMaster" : "ApplicationMasters"; JobInfo jinfo = new JobInfo(job, true); Info("Job Overview").("Job Name:", jinfo.GetName()).("State:", jinfo.GetState()). ("Uberized:", jinfo.IsUberized()).("Started:", Sharpen.Extensions.CreateDate(jinfo .GetStartTime())).("Elapsed:", StringUtils.FormatTime(jinfo.GetElapsedTime())); Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> div = html.(typeof(InfoBlock )).Div(JQueryUI.InfoWrap); // MRAppMasters Table Hamlet.TABLE <Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> > table = div .Table("#job"); table.Tr().Th(amString).().Tr().Th(JQueryUI.Th, "Attempt Number").Th(JQueryUI.Th, "Start Time").Th(JQueryUI.Th, "Node").Th(JQueryUI.Th, "Logs").(); foreach (AMInfo amInfo in amInfos) { AMAttemptInfo attempt = new AMAttemptInfo(amInfo, jinfo.GetId(), jinfo.GetUserName ()); table.Tr().Td(attempt.GetAttemptId().ToString()).Td(Sharpen.Extensions.CreateDate (attempt.GetStartTime()).ToString()).Td().A(".nodelink", Url(MRWebAppUtil.GetYARNWebappScheme (), attempt.GetNodeHttpAddress()), attempt.GetNodeHttpAddress()).().Td().A(".logslink" , Url(attempt.GetLogsLink()), "logs").().(); } table.(); div.(); html.Div(JQueryUI.InfoWrap).Table("#job").Tr().Th(JQueryUI.Th, "Task Type").Th(JQueryUI .Th, "Progress").Th(JQueryUI.Th, "Total").Th(JQueryUI.Th, "Pending").Th(JQueryUI .Th, "Running").Th(JQueryUI.Th, "Complete").().Tr(JQueryUI.Odd).Th("Map").Td().Div (JQueryUI.Progressbar).$title(StringHelper.Join(jinfo.GetMapProgressPercent(), '%' )).Div(JQueryUI.ProgressbarValue).$style(StringHelper.Join("width:", jinfo.GetMapProgressPercent (), '%')).().().().Td().A(Url("tasks", jid, "m", "ALL"), jinfo.GetMapsTotal().ToString ()).().Td().A(Url("tasks", jid, "m", "PENDING"), jinfo.GetMapsPending().ToString ()).().Td().A(Url("tasks", jid, "m", "RUNNING"), jinfo.GetMapsRunning().ToString ()).().Td().A(Url("tasks", jid, "m", "COMPLETED"), jinfo.GetMapsCompleted().ToString ()).().().Tr(JQueryUI.Even).Th("Reduce").Td().Div(JQueryUI.Progressbar).$title(StringHelper.Join (jinfo.GetReduceProgressPercent(), '%')).Div(JQueryUI.ProgressbarValue).$style(StringHelper.Join ("width:", jinfo.GetReduceProgressPercent(), '%')).().().().Td().A(Url("tasks", jid, "r", "ALL"), jinfo.GetReducesTotal().ToString()).().Td().A(Url("tasks", jid , "r", "PENDING"), jinfo.GetReducesPending().ToString()).().Td().A(Url("tasks", jid, "r", "RUNNING"), jinfo.GetReducesRunning().ToString()).().Td().A(Url("tasks" , jid, "r", "COMPLETED"), jinfo.GetReducesCompleted().ToString()).().().().Table ("#job").Tr().Th(JQueryUI.Th, "Attempt Type").Th(JQueryUI.Th, "New").Th(JQueryUI .Th, "Running").Th(JQueryUI.Th, "Failed").Th(JQueryUI.Th, "Killed").Th(JQueryUI. Th, "Successful").().Tr(JQueryUI.Odd).Th("Maps").Td().A(Url("attempts", jid, "m" , MRApps.TaskAttemptStateUI.New.ToString()), jinfo.GetNewMapAttempts().ToString( )).().Td().A(Url("attempts", jid, "m", MRApps.TaskAttemptStateUI.Running.ToString ()), jinfo.GetRunningMapAttempts().ToString()).().Td().A(Url("attempts", jid, "m" , MRApps.TaskAttemptStateUI.Failed.ToString()), jinfo.GetFailedMapAttempts().ToString ()).().Td().A(Url("attempts", jid, "m", MRApps.TaskAttemptStateUI.Killed.ToString ()), jinfo.GetKilledMapAttempts().ToString()).().Td().A(Url("attempts", jid, "m" , MRApps.TaskAttemptStateUI.Successful.ToString()), jinfo.GetSuccessfulMapAttempts ().ToString()).().().Tr(JQueryUI.Even).Th("Reduces").Td().A(Url("attempts", jid, "r", MRApps.TaskAttemptStateUI.New.ToString()), jinfo.GetNewReduceAttempts().ToString ()).().Td().A(Url("attempts", jid, "r", MRApps.TaskAttemptStateUI.Running.ToString ()), jinfo.GetRunningReduceAttempts().ToString()).().Td().A(Url("attempts", jid, "r", MRApps.TaskAttemptStateUI.Failed.ToString()), jinfo.GetFailedReduceAttempts ().ToString()).().Td().A(Url("attempts", jid, "r", MRApps.TaskAttemptStateUI.Killed .ToString()), jinfo.GetKilledReduceAttempts().ToString()).().Td().A(Url("attempts" , jid, "r", MRApps.TaskAttemptStateUI.Successful.ToString()), jinfo.GetSuccessfulReduceAttempts ().ToString()).().().().(); }
protected override void Render(HtmlBlock.Block html) { if (job == null) { html.P().("Sorry, no counters for nonexistent", $(AMParams.JobId, "job")).(); return; } if (!$(AMParams.TaskId).IsEmpty() && task == null) { html.P().("Sorry, no counters for nonexistent", $(AMParams.TaskId, "task")).(); return; } if (total == null || total.GetGroupNames() == null || total.CountCounters() == 0) { string type = $(AMParams.TaskId); if (type == null || type.IsEmpty()) { type = $(AMParams.JobId, "the job"); } html.P().("Sorry it looks like ", type, " has no counters.").(); return; } string urlBase; string urlId; if (task != null) { urlBase = "singletaskcounter"; urlId = MRApps.ToString(task.GetID()); } else { urlBase = "singlejobcounter"; urlId = MRApps.ToString(job.GetID()); } int numGroups = 0; Hamlet.TBODY <Hamlet.TABLE <Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> > > tbody = html.Div(JQueryUI.InfoWrap).Table("#counters").Thead().Tr().Th(".group.ui-state-default" , "Counter Group").Th(".ui-state-default", "Counters").().().Tbody(); foreach (CounterGroup g in total) { CounterGroup mg = map == null ? null : map.GetGroup(g.GetName()); CounterGroup rg = reduce == null ? null : reduce.GetGroup(g.GetName()); ++numGroups; // This is mostly for demonstration :) Typically we'd introduced // a CounterGroup block to reduce the verbosity. OTOH, this // serves as an indicator of where we're in the tag hierarchy. Hamlet.TR <Hamlet.THEAD <Hamlet.TABLE <Hamlet.TD <Hamlet.TR <Hamlet.TBODY <Hamlet.TABLE <Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> > > > > > > > groupHeadRow = tbody .Tr().Th().$title(g.GetName()).$class("ui-state-default").(FixGroupDisplayName(g .GetDisplayName())).().Td().$class(JQueryUI.CTable).Table(".dt-counters").$id(job .GetID() + "." + g.GetName()).Thead().Tr().Th(".name", "Name"); if (map != null) { groupHeadRow.Th("Map").Th("Reduce"); } // Ditto Hamlet.TBODY <Hamlet.TABLE <Hamlet.TD <Hamlet.TR <Hamlet.TBODY <Hamlet.TABLE <Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> > > > > > > group = groupHeadRow.Th(map == null ? "Value" : "Total").().().Tbody(); foreach (Counter counter in g) { // Ditto Hamlet.TR <Hamlet.TBODY <Hamlet.TABLE <Hamlet.TD <Hamlet.TR <Hamlet.TBODY <Hamlet.TABLE <Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> > > > > > > > groupRow = group .Tr(); if (task == null && mg == null && rg == null) { groupRow.Td().$title(counter.GetName()).(counter.GetDisplayName()).(); } else { groupRow.Td().$title(counter.GetName()).A(Url(urlBase, urlId, g.GetName(), counter .GetName()), counter.GetDisplayName()).(); } if (map != null) { Counter mc = mg == null ? null : mg.FindCounter(counter.GetName()); Counter rc = rg == null ? null : rg.FindCounter(counter.GetName()); groupRow.Td(mc == null ? "0" : string.Format("%,d", mc.GetValue())).Td(rc == null ? "0" : string.Format("%,d", rc.GetValue())); } groupRow.Td(string.Format("%,d", counter.GetValue())).(); } group.().().().(); } tbody.().().(); }
protected internal override void Render(HtmlBlock.Block html) { html.Div("#nav").H3().("Logs").().(); }
protected override void Render(HtmlBlock.Block html) { html.Div("#nav").H3("Tools").Ul().Li().A("/conf", "Configuration").().Li().A("/stacks" , "Thread dump").().Li().A("/logs", "Logs").().Li().A("/metrics", "Metrics").(). ().(); }
protected override void Render(HtmlBlock.Block html) { //Yes this is a hack, but there is no other way to insert //CSS in the correct spot html.Style(".metrics {margin-bottom:5px}"); ClusterMetricsInfo clusterMetrics = new ClusterMetricsInfo(this.rm); Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> div = html.Div().$class("metrics" ); div.H3("Cluster Metrics").Table("#metricsoverview").Thead().$class("ui-widget-header" ).Tr().Th().$class("ui-state-default").("Apps Submitted").().Th().$class("ui-state-default" ).("Apps Pending").().Th().$class("ui-state-default").("Apps Running").().Th().$class ("ui-state-default").("Apps Completed").().Th().$class("ui-state-default").("Containers Running" ).().Th().$class("ui-state-default").("Memory Used").().Th().$class("ui-state-default" ).("Memory Total").().Th().$class("ui-state-default").("Memory Reserved").().Th( ).$class("ui-state-default").("VCores Used").().Th().$class("ui-state-default"). ("VCores Total").().Th().$class("ui-state-default").("VCores Reserved").().Th(). $class("ui-state-default").("Active Nodes").().Th().$class("ui-state-default").( "Decommissioned Nodes").().Th().$class("ui-state-default").("Lost Nodes").().Th( ).$class("ui-state-default").("Unhealthy Nodes").().Th().$class("ui-state-default" ).("Rebooted Nodes").().().().Tbody().$class("ui-widget-content").Tr().Td(clusterMetrics .GetAppsSubmitted().ToString()).Td(clusterMetrics.GetAppsPending().ToString()).Td (clusterMetrics.GetAppsRunning().ToString()).Td((clusterMetrics.GetAppsCompleted () + clusterMetrics.GetAppsFailed() + clusterMetrics.GetAppsKilled()).ToString() ).Td(clusterMetrics.GetContainersAllocated().ToString()).Td(StringUtils.ByteDesc (clusterMetrics.GetAllocatedMB() * BytesInMb)).Td(StringUtils.ByteDesc(clusterMetrics .GetTotalMB() * BytesInMb)).Td(StringUtils.ByteDesc(clusterMetrics.GetReservedMB () * BytesInMb)).Td(clusterMetrics.GetAllocatedVirtualCores().ToString()).Td(clusterMetrics .GetTotalVirtualCores().ToString()).Td(clusterMetrics.GetReservedVirtualCores(). ToString()).Td().A(Url("nodes"), clusterMetrics.GetActiveNodes().ToString()).(). Td().A(Url("nodes/decommissioned"), clusterMetrics.GetDecommissionedNodes().ToString ()).().Td().A(Url("nodes/lost"), clusterMetrics.GetLostNodes().ToString()).().Td ().A(Url("nodes/unhealthy"), clusterMetrics.GetUnhealthyNodes().ToString()).().Td ().A(Url("nodes/rebooted"), clusterMetrics.GetRebootedNodes().ToString()).().(). ().(); string user = Request().GetRemoteUser(); if (user != null) { UserMetricsInfo userMetrics = new UserMetricsInfo(this.rm, user); if (userMetrics.MetricsAvailable()) { div.H3("User Metrics for " + user).Table("#usermetricsoverview").Thead().$class("ui-widget-header" ).Tr().Th().$class("ui-state-default").("Apps Submitted").().Th().$class("ui-state-default" ).("Apps Pending").().Th().$class("ui-state-default").("Apps Running").().Th().$class ("ui-state-default").("Apps Completed").().Th().$class("ui-state-default").("Containers Running" ).().Th().$class("ui-state-default").("Containers Pending").().Th().$class("ui-state-default" ).("Containers Reserved").().Th().$class("ui-state-default").("Memory Used").(). Th().$class("ui-state-default").("Memory Pending").().Th().$class("ui-state-default" ).("Memory Reserved").().Th().$class("ui-state-default").("VCores Used").().Th() .$class("ui-state-default").("VCores Pending").().Th().$class("ui-state-default" ).("VCores Reserved").().().().Tbody().$class("ui-widget-content").Tr().Td(userMetrics .GetAppsSubmitted().ToString()).Td(userMetrics.GetAppsPending().ToString()).Td(userMetrics .GetAppsRunning().ToString()).Td((userMetrics.GetAppsCompleted() + userMetrics.GetAppsFailed () + userMetrics.GetAppsKilled()).ToString()).Td(userMetrics.GetRunningContainers ().ToString()).Td(userMetrics.GetPendingContainers().ToString()).Td(userMetrics. GetReservedContainers().ToString()).Td(StringUtils.ByteDesc(userMetrics.GetAllocatedMB () * BytesInMb)).Td(StringUtils.ByteDesc(userMetrics.GetPendingMB() * BytesInMb) ).Td(StringUtils.ByteDesc(userMetrics.GetReservedMB() * BytesInMb)).Td(userMetrics .GetAllocatedVirtualCores().ToString()).Td(userMetrics.GetPendingVirtualCores(). ToString()).Td(userMetrics.GetReservedVirtualCores().ToString()).().().(); } } SchedulerInfo schedulerInfo = new SchedulerInfo(this.rm); div.H3("Scheduler Metrics").Table("#schedulermetricsoverview").Thead().$class("ui-widget-header" ).Tr().Th().$class("ui-state-default").("Scheduler Type").().Th().$class("ui-state-default" ).("Scheduling Resource Type").().Th().$class("ui-state-default").("Minimum Allocation" ).().Th().$class("ui-state-default").("Maximum Allocation").().().().Tbody().$class ("ui-widget-content").Tr().Td(schedulerInfo.GetSchedulerType().ToString()).Td(schedulerInfo .GetSchedulerResourceTypes().ToString()).Td(schedulerInfo.GetMinAllocation().ToString ()).Td(schedulerInfo.GetMaxAllocation().ToString()).().().(); div.(); }
protected override void Render(HtmlBlock.Block html) { string webUiType = $(YarnWebParams.WebUiType); string aid = $(YarnWebParams.ApplicationId); if (aid.IsEmpty()) { Puts("Bad request: requires Application ID"); return; } try { appID = Apps.ToAppID(aid); } catch (Exception) { Puts("Invalid Application ID: " + aid); return; } UserGroupInformation callerUGI = GetCallerUGI(); ApplicationReport appReport; try { GetApplicationReportRequest request = GetApplicationReportRequest.NewInstance(appID ); if (callerUGI == null) { appReport = appBaseProt.GetApplicationReport(request).GetApplicationReport(); } else { appReport = callerUGI.DoAs(new _PrivilegedExceptionAction_99(this, request)); } } catch (Exception e) { string message = "Failed to read the application " + appID + "."; Log.Error(message, e); html.P().(message).(); return; } if (appReport == null) { Puts("Application not found: " + aid); return; } AppInfo app = new AppInfo(appReport); SetTitle(StringHelper.Join("Application ", aid)); if (webUiType != null && webUiType.Equals(YarnWebParams.RmWebUi) && conf.GetBoolean (YarnConfiguration.RmWebappUiActionsEnabled, YarnConfiguration.DefaultRmWebappUiActionsEnabled )) { // Application Kill html.Div().Button().$onclick("confirmAction()").B("Kill Application").().(); StringBuilder script = new StringBuilder(); script.Append("function confirmAction() {").Append(" b = confirm(\"Are you sure?\");" ).Append(" if (b == true) {").Append(" $.ajax({").Append(" type: 'PUT',").Append (" url: '/ws/v1/cluster/apps/").Append(aid).Append("/state',").Append(" contentType: 'application/json'," ).Append(" data: '{\"state\":\"KILLED\"}',").Append(" dataType: 'json'").Append( " }).done(function(data){").Append(" setTimeout(function(){").Append(" location.href = '/cluster/app/" ).Append(aid).Append("';").Append(" }, 1000);").Append(" }).fail(function(data){" ).Append(" console.log(data);").Append(" });").Append(" }").Append("}"); html.Script().$type("text/javascript").(script.ToString()).(); } Info("Application Overview").("User:"******"Name:", app.GetName()).("Application Type:" , app.GetType()).("Application Tags:", app.GetApplicationTags() == null ? string.Empty : app.GetApplicationTags()).("YarnApplicationState:", app.GetAppState() == null ? Unavailable : ClarifyAppState(app.GetAppState())).("FinalStatus Reported by AM:" , ClairfyAppFinalStatus(app.GetFinalAppStatus())).("Started:", Times.Format(app. GetStartedTime())).("Elapsed:", StringUtils.FormatTime(Times.Elapsed(app.GetStartedTime (), app.GetFinishedTime()))).("Tracking URL:", app.GetTrackingUrl() == null || app .GetTrackingUrl().Equals(Unavailable) ? null : Root_url(app.GetTrackingUrl()), app .GetTrackingUrl() == null || app.GetTrackingUrl().Equals(Unavailable) ? "Unassigned" : app.GetAppState() == YarnApplicationState.Finished || app.GetAppState() == YarnApplicationState .Failed || app.GetAppState() == YarnApplicationState.Killed ? "History" : "ApplicationMaster" ).("Diagnostics:", app.GetDiagnosticsInfo() == null ? string.Empty : app.GetDiagnosticsInfo ()); ICollection <ApplicationAttemptReport> attempts; try { GetApplicationAttemptsRequest request = GetApplicationAttemptsRequest.NewInstance (appID); if (callerUGI == null) { attempts = appBaseProt.GetApplicationAttempts(request).GetApplicationAttemptList( ); } else { attempts = callerUGI.DoAs(new _PrivilegedExceptionAction_196(this, request)); } } catch (Exception e) { string message = "Failed to read the attempts of the application " + appID + "."; Log.Error(message, e); html.P().(message).(); return; } CreateApplicationMetricsTable(html); html.(typeof(InfoBlock)); GenerateApplicationTable(html, callerUGI, attempts); }
/* * (non-Javadoc) * @see org.apache.hadoop.yarn.webapp.view.HtmlBlock#render(org.apache.hadoop.yarn.webapp.view.HtmlBlock.Block) */ protected override void Render(HtmlBlock.Block html) { string jid = $(AMParams.JobId); if (jid.IsEmpty()) { html.P().("Sorry, can't do anything without a JobID.").(); return; } JobId jobID = MRApps.ToJobID(jid); Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job j = appContext.GetJob(jobID); if (j == null) { html.P().("Sorry, ", jid, " not found.").(); return; } IList <AMInfo> amInfos = j.GetAMInfos(); JobInfo job = new JobInfo(j); ResponseInfo infoBlock = Info("Job Overview").("Job Name:", job.GetName()).("User Name:" , job.GetUserName()).("Queue:", job.GetQueueName()).("State:", job.GetState()).( "Uberized:", job.IsUber()).("Submitted:", Sharpen.Extensions.CreateDate(job.GetSubmitTime ())).("Started:", Sharpen.Extensions.CreateDate(job.GetStartTime())).("Finished:" , Sharpen.Extensions.CreateDate(job.GetFinishTime())).("Elapsed:", StringUtils.FormatTime (Times.Elapsed(job.GetStartTime(), job.GetFinishTime(), false))); string amString = amInfos.Count == 1 ? "ApplicationMaster" : "ApplicationMasters"; // todo - switch to use JobInfo IList <string> diagnostics = j.GetDiagnostics(); if (diagnostics != null && !diagnostics.IsEmpty()) { StringBuilder b = new StringBuilder(); foreach (string diag in diagnostics) { b.Append(diag); } infoBlock.("Diagnostics:", b.ToString()); } if (job.GetNumMaps() > 0) { infoBlock.("Average Map Time", StringUtils.FormatTime(job.GetAvgMapTime())); } if (job.GetNumReduces() > 0) { infoBlock.("Average Shuffle Time", StringUtils.FormatTime(job.GetAvgShuffleTime() )); infoBlock.("Average Merge Time", StringUtils.FormatTime(job.GetAvgMergeTime())); infoBlock.("Average Reduce Time", StringUtils.FormatTime(job.GetAvgReduceTime())); } foreach (ConfEntryInfo entry in job.GetAcls()) { infoBlock.("ACL " + entry.GetName() + ":", entry.GetValue()); } Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> div = html.(typeof(InfoBlock )).Div(JQueryUI.InfoWrap); // MRAppMasters Table Hamlet.TABLE <Hamlet.DIV <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> > table = div .Table("#job"); table.Tr().Th(amString).().Tr().Th(JQueryUI.Th, "Attempt Number").Th(JQueryUI.Th, "Start Time").Th(JQueryUI.Th, "Node").Th(JQueryUI.Th, "Logs").(); bool odd = false; foreach (AMInfo amInfo in amInfos) { AMAttemptInfo attempt = new AMAttemptInfo(amInfo, job.GetId(), job.GetUserName(), string.Empty, string.Empty); table.Tr((odd = !odd) ? JQueryUI.Odd : JQueryUI.Even).Td(attempt.GetAttemptId().ToString ()).Td(Sharpen.Extensions.CreateDate(attempt.GetStartTime()).ToString()).Td().A( ".nodelink", Url(MRWebAppUtil.GetYARNWebappScheme(), attempt.GetNodeHttpAddress( )), attempt.GetNodeHttpAddress()).().Td().A(".logslink", Url(attempt.GetShortLogsLink ()), "logs").().(); } table.(); div.(); html.Div(JQueryUI.InfoWrap).Table("#job").Tr().Th(JQueryUI.Th, "Task Type").Th(JQueryUI .Th, "Total").Th(JQueryUI.Th, "Complete").().Tr(JQueryUI.Odd).Th().A(Url("tasks" , jid, "m"), "Map").().Td(job.GetMapsTotal().ToString().ToString()).Td(job.GetMapsCompleted ().ToString().ToString()).().Tr(JQueryUI.Even).Th().A(Url("tasks", jid, "r"), "Reduce" ).().Td(job.GetReducesTotal().ToString().ToString()).Td(job.GetReducesCompleted( ).ToString().ToString()).().().Table("#job").Tr().Th(JQueryUI.Th, "Attempt Type" ).Th(JQueryUI.Th, "Failed").Th(JQueryUI.Th, "Killed").Th(JQueryUI.Th, "Successful" ).().Tr(JQueryUI.Odd).Th("Maps").Td().A(Url("attempts", jid, "m", MRApps.TaskAttemptStateUI .Failed.ToString()), job.GetFailedMapAttempts().ToString()).().Td().A(Url("attempts" , jid, "m", MRApps.TaskAttemptStateUI.Killed.ToString()), job.GetKilledMapAttempts ().ToString()).().Td().A(Url("attempts", jid, "m", MRApps.TaskAttemptStateUI.Successful .ToString()), job.GetSuccessfulMapAttempts().ToString()).().().Tr(JQueryUI.Even) .Th("Reduces").Td().A(Url("attempts", jid, "r", MRApps.TaskAttemptStateUI.Failed .ToString()), job.GetFailedReduceAttempts().ToString()).().Td().A(Url("attempts" , jid, "r", MRApps.TaskAttemptStateUI.Killed.ToString()), job.GetKilledReduceAttempts ().ToString()).().Td().A(Url("attempts", jid, "r", MRApps.TaskAttemptStateUI.Successful .ToString()), job.GetSuccessfulReduceAttempts().ToString()).().().().(); }
protected internal override void Render(HtmlBlock.Block html) { html.Div("#sub1").("sub1 text").(); }