YARN-2794. Fixed log messages about distributing system-credentials. Contributed by Jian He.

This commit is contained in:
Zhijie Shen 2014-11-12 11:07:57 -08:00
parent 51957ca818
commit be7bf956e9
5 changed files with 15 additions and 8 deletions

View File

@ -949,6 +949,9 @@ Release 2.6.0 - 2014-11-15
YARN-2843. Fixed NodeLabelsManager to trim inputs for hosts and labels so YARN-2843. Fixed NodeLabelsManager to trim inputs for hosts and labels so
as to make them work correctly. (Wangda Tan via vinodkv) as to make them work correctly. (Wangda Tan via vinodkv)
YARN-2794. Fixed log messages about distributing system-credentials. (Jian He via
zjshen)
Release 2.5.2 - 2014-11-10 Release 2.5.2 - 2014-11-10
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -317,7 +317,7 @@ public static class NMContext implements Context {
protected final ConcurrentMap<ApplicationId, Application> applications = protected final ConcurrentMap<ApplicationId, Application> applications =
new ConcurrentHashMap<ApplicationId, Application>(); new ConcurrentHashMap<ApplicationId, Application>();
private Map<ApplicationId, Credentials> systemCredentials = private volatile Map<ApplicationId, Credentials> systemCredentials =
new HashMap<ApplicationId, Credentials>(); new HashMap<ApplicationId, Credentials>();
protected final ConcurrentMap<ContainerId, Container> containers = protected final ConcurrentMap<ContainerId, Container> containers =

View File

@ -552,7 +552,10 @@ private static Map<ApplicationId, Credentials> parseCredentials(
map.put(entry.getKey(), credentials); map.put(entry.getKey(), credentials);
} }
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("Retrieved credentials form RM: " + map); for (Map.Entry<ApplicationId, Credentials> entry : map.entrySet()) {
LOG.debug("Retrieved credentials form RM for " + entry.getKey() + ": "
+ entry.getValue().getAllTokens());
}
} }
return map; return map;
} }

View File

@ -1122,9 +1122,9 @@ private Credentials getSystemCredentialsSentFromRM(
if (systemCredentials == null) { if (systemCredentials == null) {
return null; return null;
} }
for (Token<?> token : systemCredentials.getAllTokens()) { if (LOG.isDebugEnabled()) {
LOG.info("Adding new framework-token for " + appId LOG.debug("Adding new framework-token for " + appId
+ " for localization: " + token); + " for localization: " + systemCredentials.getAllTokens());
} }
return systemCredentials; return systemCredentials;
} }

View File

@ -202,9 +202,10 @@ private void uploadLogsForContainers() {
Credentials systemCredentials = Credentials systemCredentials =
context.getSystemCredentialsForApps().get(appId); context.getSystemCredentialsForApps().get(appId);
if (systemCredentials != null) { if (systemCredentials != null) {
for (Token<?> token : systemCredentials.getAllTokens()) { if (LOG.isDebugEnabled()) {
LOG.info("Adding new framework-token for " + appId LOG.debug("Adding new framework-token for " + appId
+ " for log-aggregation: " + token + " user=" + userUgi); + " for log-aggregation: " + systemCredentials.getAllTokens()
+ "; userUgi=" + userUgi);
} }
// this will replace old token // this will replace old token
userUgi.addCredentials(systemCredentials); userUgi.addCredentials(systemCredentials);