-
Notifications
You must be signed in to change notification settings - Fork 9.2k
YARN-11274. Impove Nodemanager#NodeStatusUpdaterImpl Log. #4783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -201,7 +201,7 @@ protected void serviceInit(Configuration conf) throws Exception { | |
| // Update configured resources via plugins. | ||
| updateConfiguredResourcesViaPlugins(totalResource); | ||
|
|
||
| LOG.info("Nodemanager resources is set to: " + totalResource); | ||
| LOG.info("Nodemanager resources is set to: {}.", totalResource); | ||
|
|
||
| metrics.addResource(totalResource); | ||
|
|
||
|
|
@@ -247,9 +247,8 @@ protected void serviceInit(Configuration conf) throws Exception { | |
| LOG.debug("{} :{}", YARN_NODEMANAGER_DURATION_TO_TRACK_STOPPED_CONTAINERS, | ||
| durationToTrackStoppedContainers); | ||
| super.serviceInit(conf); | ||
| LOG.info("Initialized nodemanager with :" + | ||
| " physical-memory=" + memoryMb + " virtual-memory=" + virtualMemoryMb + | ||
| " virtual-cores=" + virtualCores); | ||
| LOG.info("Initialized nodemanager with : physical-memory={} virtual-memory={} " + | ||
| "virtual-cores={}.", memoryMb, virtualMemoryMb, virtualCores); | ||
|
|
||
| this.logAggregationEnabled = | ||
| conf.getBoolean(YarnConfiguration.LOG_AGGREGATION_ENABLED, | ||
|
|
@@ -264,7 +263,7 @@ protected void serviceStart() throws Exception { | |
|
|
||
| // NodeManager is the last service to start, so NodeId is available. | ||
| this.nodeId = this.context.getNodeId(); | ||
| LOG.info("Node ID assigned is : " + this.nodeId); | ||
| LOG.info("Node ID assigned is : {}.", this.nodeId); | ||
| this.httpPort = this.context.getHttpPort(); | ||
| this.nodeManagerVersionId = YarnVersionInfo.getVersion(); | ||
| try { | ||
|
|
@@ -312,10 +311,9 @@ private void unRegisterNM() { | |
| request.setNodeId(this.nodeId); | ||
| try { | ||
| resourceTracker.unRegisterNodeManager(request); | ||
| LOG.info("Successfully Unregistered the Node " + this.nodeId | ||
| + " with ResourceManager."); | ||
| LOG.info("Successfully Unregistered the Node {} with ResourceManager.", this.nodeId); | ||
| } catch (Exception e) { | ||
| LOG.warn("Unregistration of the Node " + this.nodeId + " failed.", e); | ||
| LOG.warn("Unregistration of the Node {} failed.", this.nodeId, e); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -399,7 +397,7 @@ nodeManagerVersionId, containerReports, getRunningApplications(), | |
| nodeLabels, physicalResource, nodeAttributes, nodeStatus); | ||
|
|
||
| if (containerReports != null && !containerReports.isEmpty()) { | ||
| LOG.info("Registering with RM using containers :" + containerReports); | ||
| LOG.info("Registering with RM using containers.size : {}." + containerReports.size()); | ||
| } | ||
| if (logAggregationEnabled) { | ||
| // pull log aggregation status for application running in this NM | ||
|
|
@@ -641,6 +639,7 @@ private List<ApplicationId> getRunningApplications() { | |
| runningApplications.add(appEntry.getKey()); | ||
| } | ||
| } | ||
| LOG.info("Running Applications Size : {}.", runningApplications.size()); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add log, print the number of running apps. |
||
| return runningApplications; | ||
| } | ||
|
|
||
|
|
@@ -667,8 +666,8 @@ private List<NMContainerStatus> getNMContainerStatuses() throws IOException { | |
| } | ||
| } | ||
| if (!containerStatuses.isEmpty()) { | ||
| LOG.info("Sending out " + containerStatuses.size() | ||
| + " NM container statuses: " + containerStatuses); | ||
| LOG.info("Sending out {} container NM container statuses: {}.", | ||
| containerStatuses.size(), containerStatuses); | ||
| } | ||
| return containerStatuses; | ||
| } | ||
|
|
@@ -724,8 +723,7 @@ public void removeOrTrackCompletedContainersFromContext( | |
| } | ||
|
|
||
| if (!removedContainers.isEmpty()) { | ||
| LOG.info("Removed completed containers from NM context: " | ||
| + removedContainers); | ||
| LOG.info("Removed completed containers from NM context: {}.", removedContainers); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -792,7 +790,7 @@ public void removeVeryOldStoppedContainersFromCache() { | |
| try { | ||
| context.getNMStateStore().removeContainer(cid); | ||
| } catch (IOException e) { | ||
| LOG.error("Unable to remove container " + cid + " in store", e); | ||
| LOG.error("Unable to remove container {} in store.", cid, e); | ||
| } | ||
| } | ||
| } | ||
|
|
@@ -839,18 +837,15 @@ private boolean handleShutdownOrResyncCommand( | |
| if (response.getNodeAction() == NodeAction.SHUTDOWN) { | ||
| LOG.warn("Received SHUTDOWN signal from Resourcemanager as part of" | ||
| + " heartbeat, hence shutting down."); | ||
| LOG.warn("Message from ResourceManager: " | ||
| + response.getDiagnosticsMessage()); | ||
| LOG.warn("Message from ResourceManager: {}.", response.getDiagnosticsMessage()); | ||
| context.setDecommissioned(true); | ||
| dispatcher.getEventHandler().handle( | ||
| new NodeManagerEvent(NodeManagerEventType.SHUTDOWN)); | ||
| return true; | ||
| } | ||
| if (response.getNodeAction() == NodeAction.RESYNC) { | ||
| LOG.warn("Node is out of sync with ResourceManager," | ||
| + " hence resyncing."); | ||
| LOG.warn("Message from ResourceManager: " | ||
| + response.getDiagnosticsMessage()); | ||
| LOG.warn("Node is out of sync with ResourceManager, hence resyncing."); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both can be combined into 1
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for your suggestion, I will modify the code. |
||
| LOG.warn("Message from ResourceManager: {}.", response.getDiagnosticsMessage()); | ||
| // Invalidate the RMIdentifier while resync | ||
| NodeStatusUpdaterImpl.this.rmIdentifier = | ||
| ResourceManagerConstants.RM_INVALID_IDENTIFIER; | ||
|
|
@@ -1095,8 +1090,7 @@ protected void validate(Set<NodeAttribute> nodeAttributes) | |
| try { | ||
| NodeLabelUtil.validateNodeAttributes(nodeAttributes); | ||
| } catch (IOException e) { | ||
| LOG.error( | ||
| "Invalid node attribute(s) from Provider : " + e.getMessage()); | ||
| LOG.error("Invalid node attribute(s) from Provider : {}.", e.getMessage()); | ||
| throw e; | ||
| } | ||
| } | ||
|
|
@@ -1136,9 +1130,8 @@ public void verifyRMHeartbeatResponseForNodeAttributes( | |
| } else { | ||
| // case where updated node attributes from NodeAttributesProvider | ||
| // is sent to RM and RM rejected the attributes | ||
| LOG.error("NM node attributes {" + getPreviousValue() | ||
| + "} were not accepted by RM and message from RM : " + response | ||
| .getDiagnosticsMessage()); | ||
| LOG.error("NM node attributes [{}] were not accepted by RM and message from RM : {}.", | ||
| getPreviousValue(), response.getDiagnosticsMessage()); | ||
| } | ||
| } | ||
| } | ||
|
|
@@ -1262,7 +1255,7 @@ protected void validate(Set<NodeLabel> nodeLabels) | |
| } | ||
| } | ||
| if (hasInvalidLabel) { | ||
| LOG.error("Invalid Node Label(s) from Provider : " + errorMsg); | ||
| LOG.error("Invalid Node Label(s) from Provider : {}.", errorMsg); | ||
| throw new IOException(errorMsg.toString()); | ||
| } | ||
| } | ||
|
|
@@ -1287,10 +1280,8 @@ public void verifyRMHeartbeatResponseForNodeLabels( | |
| } else { | ||
| // case where updated labels from NodeLabelsProvider is sent to RM and | ||
| // RM rejected the labels | ||
| LOG.error( | ||
| "NM node labels {" + StringUtils.join(",", getPreviousValue()) | ||
| + "} were not accepted by RM and message from RM : " | ||
| + response.getDiagnosticsMessage()); | ||
| LOG.error("NM node labels [{}] were not accepted by RM and message from RM : {}.", | ||
| StringUtils.join(",", getPreviousValue()), response.getDiagnosticsMessage()); | ||
| } | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is enough to print the number directly.
This function will call getNMContainerStatuses()
Line#394: getNMContainerStatuses()
The list of Containers has been printed, no need to reprint.
Line#402: I modified it to print size directly.