Skip to content
Snippets Groups Projects
Commit 6da43355 authored by abat's avatar abat
Browse files

Merge into master from pull request #279:

Add debug messages to device manager.  Change debug messages to trace in link discovery manager. (https://github.com/floodlight/floodlight/pull/279)
parents addef886 6e385e76
No related branches found
No related tags found
No related merge requests found
......@@ -1076,9 +1076,9 @@ IFlowReconcileListener, IInfoProvider, IHAListener {
deviceKey = Long.valueOf(deviceKeyCounter++);
}
device = allocateDevice(deviceKey, entity, entityClass);
if (logger.isTraceEnabled()) {
logger.trace("New device created: {} deviceKey={}",
device, deviceKey);
if (logger.isDebugEnabled()) {
logger.debug("New device created: {} deviceKey={}, entity={}",
new Object[]{device, deviceKey, entity});
}
// Add the new device to the primary map with a simple put
......@@ -1112,12 +1112,26 @@ IFlowReconcileListener, IInfoProvider, IHAListener {
device.entities[entityindex].getSwitchPort() != null) {
long sw = device.entities[entityindex].getSwitchDPID();
short port = device.entities[entityindex].getSwitchPort().shortValue();
boolean moved =
device.updateAttachmentPoint(sw,
port,
lastSeen.getTime());
if (moved)
sendDeviceMovedNotification(device);;
if (moved) {
sendDeviceMovedNotification(device);
if (logger.isDebugEnabled()) {
logger.debug("Device moved: attachment points {}," +
"entities {}", device.attachmentPoints,
device.entities);
}
} else {
if (logger.isDebugEnabled()) {
logger.debug("Device attachment point udpated: attachment points {}," +
"entities {}", device.attachmentPoints,
device.entities);
}
}
}
break;
} else {
......@@ -1127,7 +1141,20 @@ IFlowReconcileListener, IInfoProvider, IHAListener {
newDevice.updateAttachmentPoint(entity.getSwitchDPID(),
entity.getSwitchPort().shortValue(),
entity.getLastSeenTimestamp().getTime());
if (moved) sendDeviceMovedNotification(newDevice);
if (moved) {
sendDeviceMovedNotification(device);
if (logger.isDebugEnabled()) {
logger.debug("Device moved: attachment points {}," +
"entities {}", device.attachmentPoints,
device.entities);
}
} else {
if (logger.isDebugEnabled()) {
logger.debug("Device attachment point udpated: attachment points {}," +
"entities {}", device.attachmentPoints,
device.entities);
}
}
}
// generate updates
......@@ -1604,11 +1631,13 @@ IFlowReconcileListener, IInfoProvider, IHAListener {
}
}
logger.debug("Triggering update to attachment points due to topology change.");
while (diter.hasNext()) {
Device d = diter.next();
if (d.updateAttachmentPoint()) {
if (logger.isTraceEnabled()) {
logger.trace("Attachment point changed for device: {}", d);
if (logger.isDebugEnabled()) {
logger.debug("Attachment point changed for device: {}", d);
}
sendDeviceMovedNotification(d);
}
......
......@@ -1581,11 +1581,11 @@ IFloodlightModule, IInfoProvider, IHAListener {
// null role implies HA mode is not enabled.
Role role = floodlightProvider.getRole();
if (role == null || role == Role.MASTER) {
log.debug("Rescheduling discovery task as role = {}", role);
log.trace("Rescheduling discovery task as role = {}", role);
discoveryTask.reschedule(DISCOVERY_TASK_INTERVAL,
TimeUnit.SECONDS);
} else {
log.debug("Stopped LLDP rescheduling due to role = {}.", role);
log.trace("Stopped LLDP rescheduling due to role = {}.", role);
}
}
}
......@@ -1608,10 +1608,10 @@ IFloodlightModule, IInfoProvider, IHAListener {
// null role implies HA mode is not enabled.
Role role = floodlightProvider.getRole();
if (role == null || role == Role.MASTER) {
log.debug("Setup: Rescheduling discovery task. role = {}", role);
log.trace("Setup: Rescheduling discovery task. role = {}", role);
discoveryTask.reschedule(DISCOVERY_TASK_INTERVAL, TimeUnit.SECONDS);
} else {
log.debug("Setup: Not scheduling LLDP as role = {}.", role);
log.trace("Setup: Not scheduling LLDP as role = {}.", role);
}
// Register for the OpenFlow messages we want to receive
floodlightProvider.addOFMessageListener(OFType.PACKET_IN, this);
......
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