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;
}
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);
}
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));
}
}
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();
}
}
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._();
}
Aggregations