Search in sources :

Example 1 with LogAggregationReport

use of org.apache.hadoop.yarn.server.api.protocolrecords.LogAggregationReport in project hadoop by apache.

the class NodeStatusUpdaterImpl method getLogAggregationReportsForApps.

private List<LogAggregationReport> getLogAggregationReportsForApps(ConcurrentLinkedQueue<LogAggregationReport> lastestLogAggregationStatus) {
    LogAggregationReport status;
    while ((status = lastestLogAggregationStatus.poll()) != null) {
        this.logAggregationReportForAppsTempList.add(status);
    }
    List<LogAggregationReport> reports = new ArrayList<LogAggregationReport>();
    reports.addAll(logAggregationReportForAppsTempList);
    return reports;
}
Also used : LogAggregationReport(org.apache.hadoop.yarn.server.api.protocolrecords.LogAggregationReport) ArrayList(java.util.ArrayList)

Example 2 with LogAggregationReport

use of org.apache.hadoop.yarn.server.api.protocolrecords.LogAggregationReport in project hadoop by apache.

the class AppLogAggregatorImpl method sendLogAggregationReport.

private void sendLogAggregationReport(LogAggregationStatus logAggregationStatus, String diagnosticMessage) {
    LogAggregationReport report = Records.newRecord(LogAggregationReport.class);
    report.setApplicationId(appId);
    report.setDiagnosticMessage(diagnosticMessage);
    report.setLogAggregationStatus(logAggregationStatus);
    this.context.getLogAggregationStatusForApps().add(report);
}
Also used : LogAggregationReport(org.apache.hadoop.yarn.server.api.protocolrecords.LogAggregationReport)

Example 3 with LogAggregationReport

use of org.apache.hadoop.yarn.server.api.protocolrecords.LogAggregationReport in project hadoop by apache.

the class NodeHeartbeatRequestPBImpl method initLogAggregationReportsForApps.

private void initLogAggregationReportsForApps() {
    NodeHeartbeatRequestProtoOrBuilder p = viaProto ? proto : builder;
    List<LogAggregationReportProto> list = p.getLogAggregationReportsForAppsList();
    this.logAggregationReportsForApps = new ArrayList<LogAggregationReport>();
    for (LogAggregationReportProto c : list) {
        this.logAggregationReportsForApps.add(convertFromProtoFormat(c));
    }
}
Also used : LogAggregationReport(org.apache.hadoop.yarn.server.api.protocolrecords.LogAggregationReport) NodeHeartbeatRequestProtoOrBuilder(org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.NodeHeartbeatRequestProtoOrBuilder) LogAggregationReportProto(org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.LogAggregationReportProto)

Example 4 with LogAggregationReport

use of org.apache.hadoop.yarn.server.api.protocolrecords.LogAggregationReport in project hadoop by apache.

the class RMAppImpl method aggregateLogReport.

public void aggregateLogReport(NodeId nodeId, LogAggregationReport report) {
    try {
        this.writeLock.lock();
        if (this.logAggregationEnabled && !isLogAggregationFinished()) {
            LogAggregationReport curReport = this.logAggregationStatus.get(nodeId);
            boolean stateChangedToFinal = false;
            if (curReport == null) {
                this.logAggregationStatus.put(nodeId, report);
                if (isLogAggregationFinishedForNM(report)) {
                    stateChangedToFinal = true;
                }
            } else {
                if (isLogAggregationFinishedForNM(report)) {
                    if (!isLogAggregationFinishedForNM(curReport)) {
                        stateChangedToFinal = true;
                    }
                }
                if (report.getLogAggregationStatus() != LogAggregationStatus.RUNNING || curReport.getLogAggregationStatus() != LogAggregationStatus.RUNNING_WITH_FAILURE) {
                    if (curReport.getLogAggregationStatus() == LogAggregationStatus.TIME_OUT && report.getLogAggregationStatus() == LogAggregationStatus.RUNNING) {
                        // RUNNING_WITH_FAILURE
                        if (logAggregationFailureMessagesForNMs.get(nodeId) != null && !logAggregationFailureMessagesForNMs.get(nodeId).isEmpty()) {
                            report.setLogAggregationStatus(LogAggregationStatus.RUNNING_WITH_FAILURE);
                        }
                    }
                    curReport.setLogAggregationStatus(report.getLogAggregationStatus());
                }
            }
            updateLogAggregationDiagnosticMessages(nodeId, report);
            if (isAppInFinalState(this) && stateChangedToFinal) {
                updateLogAggregationStatus(nodeId);
            }
        }
    } finally {
        this.writeLock.unlock();
    }
}
Also used : LogAggregationReport(org.apache.hadoop.yarn.server.api.protocolrecords.LogAggregationReport)

Example 5 with LogAggregationReport

use of org.apache.hadoop.yarn.server.api.protocolrecords.LogAggregationReport 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

LogAggregationReport (org.apache.hadoop.yarn.server.api.protocolrecords.LogAggregationReport)7 NodeId (org.apache.hadoop.yarn.api.records.NodeId)3 ArrayList (java.util.ArrayList)2 LogAggregationStatus (org.apache.hadoop.yarn.api.records.LogAggregationStatus)2 RMApp (org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp)2 HashMap (java.util.HashMap)1 Iterator (java.util.Iterator)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 Entry (java.util.Map.Entry)1 ApplicationId (org.apache.hadoop.yarn.api.records.ApplicationId)1 ContainerStatus (org.apache.hadoop.yarn.api.records.ContainerStatus)1 Resource (org.apache.hadoop.yarn.api.records.Resource)1 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)1 LogAggregationReportProto (org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.LogAggregationReportProto)1 NodeHeartbeatRequestProtoOrBuilder (org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.NodeHeartbeatRequestProtoOrBuilder)1 NodeStatus (org.apache.hadoop.yarn.server.api.records.NodeStatus)1 RMAppEvent (org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppEvent)1 RMAppRunningOnNodeEvent (org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppRunningOnNodeEvent)1 RMNodeImpl (org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNodeImpl)1