YARN-10143. YARN-10101 broke Yarn logs CLI. Contributed by Adam Antal

This commit is contained in:
Szilard Nemeth 2020-02-24 21:27:31 +01:00
parent af46658baf
commit 92ad3bd099
1 changed files with 4 additions and 3 deletions

View File

@ -592,8 +592,8 @@ public class LogAggregationIndexedFileController
ApplicationId appId = logRequest.getAppId();
String appOwner = logRequest.getAppOwner();
ApplicationAttemptId appAttemptId = logRequest.getAppAttemptId();
boolean getAllContainers = ((containerIdStr == null ||
containerIdStr.isEmpty()) && appAttemptId != null);
boolean getAllContainers = (containerIdStr == null ||
containerIdStr.isEmpty());
String nodeIdStr = (nodeId == null || nodeId.isEmpty()) ? null
: LogAggregationUtils.getNodeString(nodeId);
RemoteIterator<FileStatus> nodeFiles = LogAggregationUtils
@ -638,7 +638,8 @@ public class LogAggregationIndexedFileController
for (Entry<String, List<IndexedFileLogMeta>> log : logMeta
.getLogMetas().entrySet()) {
String currentContainerIdStr = log.getKey();
if (!belongsToAppAttempt(appAttemptId, currentContainerIdStr)) {
if (appAttemptId != null &&
!belongsToAppAttempt(appAttemptId, currentContainerIdStr)) {
continue;
}
ContainerLogMeta meta = new ContainerLogMeta(