X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fhosttracker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fhosttracker%2FHostTracker.java;h=45f3cedacbd8e5f6a0f10575820e479464965bcb;hp=7046e343e726658d37ec1ea9e49006136c4b261c;hb=fc7a2ae9b5c6b82d463fe612509a157e3f261653;hpb=c8b79431119d6952b60a092e89727aa648a89bdd diff --git a/opendaylight/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/HostTracker.java b/opendaylight/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/HostTracker.java index 7046e343e7..45f3cedacb 100644 --- a/opendaylight/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/HostTracker.java +++ b/opendaylight/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/HostTracker.java @@ -30,6 +30,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; import org.apache.felix.dm.Component; +import org.apache.taglibs.standard.lang.jstl.DivideOperator; import org.opendaylight.controller.clustering.services.CacheConfigException; import org.opendaylight.controller.clustering.services.CacheExistException; import org.opendaylight.controller.clustering.services.IClusterContainerServices; @@ -201,7 +202,7 @@ public class HostTracker implements IfIptoHost, IfHostListener, logger.debug("Retrieving cache for HostTrackerIH"); inactiveStaticHosts = (ConcurrentMap) this.clusterContainerService .getCache("hostTrackerIH"); - if (hostsDB == null) { + if (inactiveStaticHosts == null) { logger.error("Cache couldn't be retrieved for HostTrackerIH"); } logger.debug("Cache was successfully retrieved for HostTrackerIH"); @@ -638,7 +639,6 @@ public class HostTracker implements IfIptoHost, IfHostListener, if (switchNeedsTieringUpdate(dstNode, currentTier + 1)) { Tier t = new Tier(currentTier + 1); switchManager.setNodeProp(dstNode, t); - //logger.info("Updating Switch Tier "+ (currentTier+1) +" for "+String.format("%x", dstSw.getId())); needsVisiting.add(dstNode); } } @@ -683,7 +683,6 @@ public class HostTracker implements IfIptoHost, IfHostListener, return true; else if (t.getValue() > tier) return true; - //logger.info(getContainerName()+" -> "+ "Switch "+String.format("%x", sw.getId())+ " is in better Tier "+sw.getTier()+" ... skipping "+tier); return false; } @@ -955,6 +954,7 @@ public class HostTracker implements IfIptoHost, IfHostListener, } private class ARPRefreshHandler extends TimerTask { + @SuppressWarnings("deprecation") public void run() { if ((clusterContainerService != null) && !clusterContainerService.amICoordinator()) { @@ -991,8 +991,6 @@ public class HostTracker implements IfIptoHost, IfHostListener, notifyHostLearnedOrRemoved(host, false); } else if (arp_cntdown <= switchManager.getHostRetryCount()) { /* Use the services of arphandler to check if host is still there */ - // logger.info("Probe for Host:{}", host); - //logger.info("ARP Probing ("+arp_cntdown+") for "+host.toString()); logger.trace("ARP Probing ({}) for {}({})", new Object[] { arp_cntdown, host.getNetworkAddress().getHostAddress(), @@ -1215,7 +1213,7 @@ public class HostTracker implements IfIptoHost, IfHostListener, nc, Short.valueOf(vlan)); } catch (UnknownHostException e) { - e.printStackTrace(); + logger.error("",e); return new Status(StatusCode.BADREQUEST, "Invalid Address"); } } @@ -1227,7 +1225,7 @@ public class HostTracker implements IfIptoHost, IfHostListener, address = InetAddress.getByName(networkAddress); return removeStaticHostReq(address); } catch (UnknownHostException e) { - e.printStackTrace(); + logger.error("",e); return new Status(StatusCode.BADREQUEST, "Invalid Address"); } }