Search in sources :

Example 6 with DIV

use of org.apache.hadoop.yarn.webapp.hamlet.Hamlet.DIV in project hadoop by apache.

the class RMAppLogAggregationStatusBlock method render.

@Override
protected void render(Block html) {
    String aid = $(APPLICATION_ID);
    if (aid.isEmpty()) {
        puts("Bad request: requires Application ID");
        return;
    }
    ApplicationId appId;
    try {
        appId = Apps.toAppID(aid);
    } catch (Exception e) {
        puts("Invalid Application ID: " + aid);
        return;
    }
    setTitle(join("Application ", aid));
    // Add LogAggregationStatus description table
    // to explain the meaning of different LogAggregationStatus
    DIV<Hamlet> div_description = html.div(_INFO_WRAP);
    TABLE<DIV<Hamlet>> table_description = div_description.table("#LogAggregationStatusDecription");
    table_description.tr().th(_TH, "Log Aggregation Status").th(_TH, "Description")._();
    table_description.tr().td(LogAggregationStatus.DISABLED.name()).td("Log Aggregation is Disabled.")._();
    table_description.tr().td(LogAggregationStatus.NOT_START.name()).td("Log Aggregation does not Start.")._();
    table_description.tr().td(LogAggregationStatus.RUNNING.name()).td("Log Aggregation is Running.")._();
    table_description.tr().td(LogAggregationStatus.RUNNING_WITH_FAILURE.name()).td("Log Aggregation is Running, but has failures " + "in previous cycles")._();
    table_description.tr().td(LogAggregationStatus.SUCCEEDED.name()).td("Log Aggregation is Succeeded. All of the logs have been " + "aggregated successfully.")._();
    table_description.tr().td(LogAggregationStatus.FAILED.name()).td("Log Aggregation is Failed. At least one of the logs " + "have not been aggregated.")._();
    table_description.tr().td(LogAggregationStatus.TIME_OUT.name()).td("The application is finished, but the log aggregation status is " + "not updated for a long time. Not sure whether the log aggregation " + "is finished or not.")._();
    table_description._();
    div_description._();
    RMApp rmApp = rm.getRMContext().getRMApps().get(appId);
    // Application Log aggregation status Table
    DIV<Hamlet> div = html.div(_INFO_WRAP);
    TABLE<DIV<Hamlet>> table = div.h3("Log Aggregation: " + (rmApp == null ? "N/A" : rmApp.getLogAggregationStatusForAppReport() == null ? "N/A" : rmApp.getLogAggregationStatusForAppReport().name())).table("#LogAggregationStatus");
    int maxLogAggregationDiagnosticsInMemory = conf.getInt(YarnConfiguration.RM_MAX_LOG_AGGREGATION_DIAGNOSTICS_IN_MEMORY, YarnConfiguration.DEFAULT_RM_MAX_LOG_AGGREGATION_DIAGNOSTICS_IN_MEMORY);
    table.tr().th(_TH, "NodeId").th(_TH, "Log Aggregation Status").th(_TH, "Last " + maxLogAggregationDiagnosticsInMemory + " Diagnostic Messages").th(_TH, "Last " + maxLogAggregationDiagnosticsInMemory + " Failure Messages")._();
    if (rmApp != null) {
        Map<NodeId, LogAggregationReport> logAggregationReports = rmApp.getLogAggregationReportsForApp();
        if (logAggregationReports != null && !logAggregationReports.isEmpty()) {
            for (Entry<NodeId, LogAggregationReport> report : logAggregationReports.entrySet()) {
                LogAggregationStatus status = report.getValue() == null ? null : report.getValue().getLogAggregationStatus();
                String message = report.getValue() == null ? null : report.getValue().getDiagnosticMessage();
                String failureMessage = report.getValue() == null ? null : ((RMAppImpl) rmApp).getLogAggregationFailureMessagesForNM(report.getKey());
                table.tr().td(report.getKey().toString()).td(status == null ? "N/A" : status.toString()).td(message == null ? "N/A" : message).td(failureMessage == null ? "N/A" : failureMessage)._();
            }
        }
    }
    table._();
    div._();
}
Also used : Hamlet(org.apache.hadoop.yarn.webapp.hamlet.Hamlet) RMApp(org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp) DIV(org.apache.hadoop.yarn.webapp.hamlet.Hamlet.DIV) LogAggregationReport(org.apache.hadoop.yarn.server.api.protocolrecords.LogAggregationReport) NodeId(org.apache.hadoop.yarn.api.records.NodeId) LogAggregationStatus(org.apache.hadoop.yarn.api.records.LogAggregationStatus) ApplicationId(org.apache.hadoop.yarn.api.records.ApplicationId)

Aggregations

DIV (org.apache.hadoop.yarn.webapp.hamlet.Hamlet.DIV)6 Hamlet (org.apache.hadoop.yarn.webapp.hamlet.Hamlet)5 Date (java.util.Date)2 AMInfo (org.apache.hadoop.mapreduce.v2.api.records.AMInfo)2 JobId (org.apache.hadoop.mapreduce.v2.api.records.JobId)2 Job (org.apache.hadoop.mapreduce.v2.app.job.Job)2 InfoBlock (org.apache.hadoop.yarn.webapp.view.InfoBlock)2 Log (org.apache.commons.logging.Log)1 Log4JLogger (org.apache.commons.logging.impl.Log4JLogger)1 Counter (org.apache.hadoop.mapreduce.Counter)1 CounterGroup (org.apache.hadoop.mapreduce.CounterGroup)1 AMAttemptInfo (org.apache.hadoop.mapreduce.v2.app.webapp.dao.AMAttemptInfo)1 ConfEntryInfo (org.apache.hadoop.mapreduce.v2.app.webapp.dao.ConfEntryInfo)1 JobInfo (org.apache.hadoop.mapreduce.v2.app.webapp.dao.JobInfo)1 UnparsedJob (org.apache.hadoop.mapreduce.v2.hs.UnparsedJob)1 AMAttemptInfo (org.apache.hadoop.mapreduce.v2.hs.webapp.dao.AMAttemptInfo)1 JobInfo (org.apache.hadoop.mapreduce.v2.hs.webapp.dao.JobInfo)1 ApplicationId (org.apache.hadoop.yarn.api.records.ApplicationId)1 LogAggregationStatus (org.apache.hadoop.yarn.api.records.LogAggregationStatus)1 NodeId (org.apache.hadoop.yarn.api.records.NodeId)1