Skip to content
Snippets Groups Projects
Commit dfee35f7 authored by Kanzhe Jiang's avatar Kanzhe Jiang
Browse files

clean up log msg

parent 0ae432f4
No related branches found
No related tags found
No related merge requests found
...@@ -787,7 +787,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe ...@@ -787,7 +787,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
if (isPortStatusDelOrModify(ps)) { if (isPortStatusDelOrModify(ps)) {
SwitchPortTuple id = new SwitchPortTuple(sw, SwitchPortTuple id = new SwitchPortTuple(sw,
ps.getDesc().getPortNumber()); ps.getDesc().getPortNumber());
log.debug("PortStatusMessage: {}", id);
lock.writeLock().lock(); lock.writeLock().lock();
try { try {
devMgrMaps.removeSwPort(id); devMgrMaps.removeSwPort(id);
...@@ -813,9 +812,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe ...@@ -813,9 +812,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
} }
writeDeviceToStorage(device, currentDate); writeDeviceToStorage(device, currentDate);
updateStatus(device, true); updateStatus(device, true);
if (log.isDebugEnabled()) {
log.debug("New device learned {}", device);
}
} }
private boolean isGratArp(Ethernet eth) { private boolean isGratArp(Ethernet eth) {
...@@ -882,8 +878,8 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe ...@@ -882,8 +878,8 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
match.loadFromPacket(pi.getPacketData(), pi.getInPort(), sw.getId()); match.loadFromPacket(pi.getPacketData(), pi.getInPort(), sw.getId());
// Add this packet-in to event history // Add this packet-in to event history
evHistPktIn(match); evHistPktIn(match);
if (log.isDebugEnabled()) if (log.isTraceEnabled())
log.debug("Entering packet_in processing sw {}, port {}. {} --> {}, type {}", log.trace("Entering packet_in processing sw {}, port {}. {} --> {}, type {}",
new Object[] { sw.getStringId(), pi.getInPort(), new Object[] { sw.getStringId(), pi.getInPort(),
HexString.toHexString(match.getDataLayerSource()), HexString.toHexString(match.getDataLayerSource()),
HexString.toHexString(match.getDataLayerDestination()), HexString.toHexString(match.getDataLayerDestination()),
...@@ -895,8 +891,8 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe ...@@ -895,8 +891,8 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
*/ */
if ((eth.isBroadcast() || eth.isMulticast()) && if ((eth.isBroadcast() || eth.isMulticast()) &&
!topology.isIncomingBroadcastAllowed(pinSw, pinPort)) { !topology.isIncomingBroadcastAllowed(pinSw, pinPort)) {
if (log.isDebugEnabled()) { if (log.isTraceEnabled()) {
log.debug("Drop broadcast/multicast packets with src {} from not-allowed incoming broadcast ports {} {}", log.trace("Drop broadcast/multicast packets with src {} from not-allowed incoming broadcast ports {} {}",
new Object[] {HexString.toHexString(eth.getSourceMACAddress()), new Object[] {HexString.toHexString(eth.getSourceMACAddress()),
HexString.toHexString(pinSw), pinPort}); HexString.toHexString(pinSw), pinPort});
} }
...@@ -923,7 +919,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe ...@@ -923,7 +919,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
if (vlan < 0) vlan = null; if (vlan < 0) vlan = null;
int nwSrc = getSrcNwAddr(eth, dlAddr); int nwSrc = getSrcNwAddr(eth, dlAddr);
Device srcDevice = devMgrMaps.getDeviceByDataLayerAddr(dlAddr); Device srcDevice = devMgrMaps.getDeviceByDataLayerAddr(dlAddr);
log.debug("SRC device {}", srcDevice);
if (log.isTraceEnabled()) { if (log.isTraceEnabled()) {
long dstAddr = Ethernet.toLong(match.getDataLayerDestination()); long dstAddr = Ethernet.toLong(match.getDataLayerDestination());
Device dstDevice = devMgrMaps.getDeviceByDataLayerAddr(dstAddr); Device dstDevice = devMgrMaps.getDeviceByDataLayerAddr(dstAddr);
...@@ -1021,7 +1016,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe ...@@ -1021,7 +1016,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
if (newAttachmentPoint || newNetworkAddress || updateDeviceVlan || if (newAttachmentPoint || newNetworkAddress || updateDeviceVlan ||
updateNeworkAddressMap) { updateNeworkAddressMap) {
Device nd = new Device(srcDevice); Device nd = new Device(srcDevice);
log.debug("Copied device {}", nd);
try { try {
// Check if we have seen this attachmentPoint recently, // Check if we have seen this attachmentPoint recently,
...@@ -1308,7 +1302,7 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe ...@@ -1308,7 +1302,7 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
} }
} else { } else {
updateStatus(device, true); updateStatus(device, true);
log.debug("Device {} added {}", device, swPort); log.debug("Device {} added AP at {}", device, swPort);
} }
writeAttachmentPointToStorage(device, attachmentPoint, currentDate); writeAttachmentPointToStorage(device, attachmentPoint, currentDate);
...@@ -1331,9 +1325,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe ...@@ -1331,9 +1325,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
devMgrMaps.delFromMaps(device); devMgrMaps.delFromMaps(device);
removeDeviceDiscoveredStateFromStorage(device); removeDeviceDiscoveredStateFromStorage(device);
updateStatus(device, false); updateStatus(device, false);
if (log.isDebugEnabled()) {
log.debug("Removed device {}", device);
}
processUpdates(); processUpdates();
} }
...@@ -1471,7 +1462,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe ...@@ -1471,7 +1462,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
@Override @Override
public void removedSwitch (IOFSwitch sw) { public void removedSwitch (IOFSwitch sw) {
log.debug("RemovedSwitch {}", sw);
// remove all devices attached to this switch // remove all devices attached to this switch
if (!devMgrMaps.isSwitchPresent(sw)) { if (!devMgrMaps.isSwitchPresent(sw)) {
// Switch not present // Switch not present
...@@ -1495,7 +1485,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe ...@@ -1495,7 +1485,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
// Remove all devices living on this switch:port now that it is // Remove all devices living on this switch:port now that it is
// internal // internal
SwitchPortTuple switchPort = new SwitchPortTuple(floodlightProvider.getSwitches().get(dstSw), dstPort); SwitchPortTuple switchPort = new SwitchPortTuple(floodlightProvider.getSwitches().get(dstSw), dstPort);
log.debug("addedOrUpdatedLink: remove internal port {}", switchPort);
lock.writeLock().lock(); lock.writeLock().lock();
try { try {
devMgrMaps.removeSwPort(switchPort); devMgrMaps.removeSwPort(switchPort);
...@@ -1513,7 +1502,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe ...@@ -1513,7 +1502,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
synchronized (updates) { synchronized (updates) {
Update update = null; Update update = null;
while ((update = updates.poll()) != null) { while ((update = updates.poll()) != null) {
log.debug ("processUpdates, update: {}", update);
if (deviceManagerAware == null) if (deviceManagerAware == null)
continue; continue;
for (IDeviceManagerAware dma : deviceManagerAware) { for (IDeviceManagerAware dma : deviceManagerAware) {
...@@ -1709,9 +1697,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe ...@@ -1709,9 +1697,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
*/ */
d.setAttachmentPoints(tempAPMap.values()); d.setAttachmentPoints(tempAPMap.values());
for (DeviceAttachmentPoint dap: tempAPMap.values()) { for (DeviceAttachmentPoint dap: tempAPMap.values()) {
if (log.isDebugEnabled()) {
log.debug("Reset AP {} for device {}", dap, d);
}
boolean isblocked = dap.isBlocked(); boolean isblocked = dap.isBlocked();
dap.resetConflictState(); dap.resetConflictState();
// only write to DB if the blocking state is reset. // only write to DB if the blocking state is reset.
...@@ -1723,16 +1708,11 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe ...@@ -1723,16 +1708,11 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
// Delete from memory after storage, // Delete from memory after storage,
// otherwise an exception will // otherwise an exception will
// leave stale attachment points on storage. // leave stale attachment points on storage.
log.debug("Remove AP {} from storage for device {}", dap, d.getDlAddrString());
removeAttachmentPointFromStorage(d.getDlAddrString(), removeAttachmentPointFromStorage(d.getDlAddrString(),
HexString.toHexString(dap.getSwitchPort().getSw().getId()), HexString.toHexString(dap.getSwitchPort().getSw().getId()),
dap.getSwitchPort().getPort().toString()); dap.getSwitchPort().getPort().toString());
d.removeOldAttachmentPoint(dap); d.removeOldAttachmentPoint(dap);
} }
if (log.isDebugEnabled()) {
log.debug("After cleanup, device {}", d);
}
} }
public void clearAllDeviceStateFromMemory() { public void clearAllDeviceStateFromMemory() {
...@@ -2077,7 +2057,9 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe ...@@ -2077,7 +2057,9 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
} }
Date agedBoundary = ageBoundaryDifference(currentDate, expire); Date agedBoundary = ageBoundaryDifference(currentDate, expire);
if (ap.getLastSeen().before(agedBoundary)) { if (ap.getLastSeen().before(agedBoundary)) {
log.debug("Remove aged AP {} from device {}", ap, HexString.toHexString(dlAddr)); if (log.isDebugEnabled()) {
log.debug("Remove aged AP {} from device {}", ap, HexString.toHexString(dlAddr));
}
devMgrMaps.delDevAttachmentPoint(dlAddr, ap.getSwitchPort()); devMgrMaps.delDevAttachmentPoint(dlAddr, ap.getSwitchPort());
evHistAttachmtPt(device.getDataLayerAddressAsLong(), evHistAttachmtPt(device.getDataLayerAddressAsLong(),
ap.getSwitchPort(), EvAction.REMOVED, ap.getSwitchPort(), EvAction.REMOVED,
...@@ -2161,13 +2143,7 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe ...@@ -2161,13 +2143,7 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
// serialize the devMgrMaps updates // serialize the devMgrMaps updates
synchronized (devMgrMaps) { synchronized (devMgrMaps) {
Collection<Device> devices = devMgrMaps.getDevices(); Collection<Device> devices = devMgrMaps.getDevices();
if (log.isDebugEnabled()) {
log.debug("DeviceUpdateWorker: devMgrMaps has {} devices", devices.size());
}
for (Device d : devices) { for (Device d : devices) {
if (log.isDebugEnabled()) {
log.debug("DeviceUpdateWorker: cleaning up attachment points for device {}", d);
}
try { try {
Device dCopy = new Device(d); Device dCopy = new Device(d);
cleanupAttachmentPoints(dCopy); cleanupAttachmentPoints(dCopy);
...@@ -2181,7 +2157,9 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe ...@@ -2181,7 +2157,9 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
} }
} }
lastTopoChangeTime = new Date(); lastTopoChangeTime = new Date();
log.debug("Set lastTopoChangeTime {}", lastTopoChangeTime); if (log.isDebugEnabled()) {
log.debug("Set lastTopoChangeTime {}", lastTopoChangeTime);
}
} }
} catch (StorageException e) { } catch (StorageException e) {
log.error("DeviceUpdateWorker had a storage exception, " + log.error("DeviceUpdateWorker had a storage exception, " +
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment