Skip to content

Commit

Permalink
SAMZA-846 : Refactor logging in ContainerAllocator and LocalityManage…
Browse files Browse the repository at this point in the history
…r that is flooding the AM log
  • Loading branch information
navina committed Dec 22, 2015
1 parent 0fb0586 commit 0bacbbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,14 @@ public Map<Integer, Map<String, String>> readContainerLocality() {
localityMappings.put(SetContainerHostMapping.HOST_KEY, mapping.getHostLocality());
localityMappings.put(SetContainerHostMapping.JMX_URL_KEY, mapping.getJmxUrl());
localityMappings.put(SetContainerHostMapping.JMX_TUNNELING_URL_KEY, mapping.getJmxTunnelingUrl());
log.info(String.format("Read locality for container %s: %s", mapping.getKey(), localityMappings));
allMappings.put(Integer.parseInt(mapping.getKey()), localityMappings);
}
containerToHostMapping = Collections.unmodifiableMap(allMappings);

for (Map.Entry<Integer, Map<String, String>> entry : containerToHostMapping.entrySet()) {
log.debug(String.format("Locality for container %s: %s", entry.getKey(), entry.getValue()));
}

return allMappings;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public synchronized int releaseExtraContainers() {

if (hostAffinityEnabled) {
if (requestsQueue.isEmpty()) {
log.info("Requests Queue is empty. Should clear up state.");
log.debug("Container Requests Queue is empty.");

List<String> allocatedHosts = getAllocatedHosts();
for (String host : allocatedHosts) {
Expand All @@ -224,7 +224,7 @@ public synchronized int releaseExtraContainers() {
}
} else {
if (requestsQueue.isEmpty()) {
log.info("No more pending requests in queue.");
log.debug("No more pending requests in Container Requests Queue.");

List<Container> availableContainers = getContainersOnAHost(ANY_HOST);
while(availableContainers != null && !availableContainers.isEmpty()) {
Expand Down

0 comments on commit 0bacbbe

Please sign in to comment.