Skip to content
Snippets Groups Projects
Commit b1df8865 authored by Srinivasan Ramasubramanian's avatar Srinivasan Ramasubramanian
Browse files

Use writeLink instead of writeLinkInfo at all places.

parent 2a796537
No related branches found
No related tags found
No related merge requests found
...@@ -676,7 +676,7 @@ public class LinkDiscoveryManager ...@@ -676,7 +676,7 @@ public class LinkDiscoveryManager
// Write changes to storage. This will always write the updated // Write changes to storage. This will always write the updated
// valid time, plus the port states if they've changed (i.e. if // valid time, plus the port states if they've changed (i.e. if
// they weren't set to null in the previous block of code. // they weren't set to null in the previous block of code.
writeLinkInfo(lt, newLinkInfo); writeLink(lt, newLinkInfo);
if (linkChanged) { if (linkChanged) {
updateOperation = UpdateOperation.UPDATE; updateOperation = UpdateOperation.UPDATE;
...@@ -826,7 +826,7 @@ public class LinkDiscoveryManager ...@@ -826,7 +826,7 @@ public class LinkDiscoveryManager
} }
if ((updatedSrcPortState != null) || if ((updatedSrcPortState != null) ||
(updatedDstPortState != null)) { (updatedDstPortState != null)) {
writeLinkInfo(link, linkInfo); writeLink(link, linkInfo);
topologyChanged = true; topologyChanged = true;
} }
} }
...@@ -1069,6 +1069,7 @@ public class LinkDiscoveryManager ...@@ -1069,6 +1069,7 @@ public class LinkDiscoveryManager
Map<String, Object> rowValues = new HashMap<String, Object>(); Map<String, Object> rowValues = new HashMap<String, Object>();
String id = getLinkId(lt); String id = getLinkId(lt);
rowValues.put(LINK_ID, id); rowValues.put(LINK_ID, id);
rowValues.put(LINK_VALID_TIME, linkInfo.getUnicastValidTime());
String srcDpid = lt.getSrc().getSw().getStringId(); String srcDpid = lt.getSrc().getSw().getStringId();
rowValues.put(LINK_SRC_SWITCH, srcDpid); rowValues.put(LINK_SRC_SWITCH, srcDpid);
rowValues.put(LINK_SRC_PORT, lt.getSrc().getPort()); rowValues.put(LINK_SRC_PORT, lt.getSrc().getPort());
...@@ -1080,8 +1081,10 @@ public class LinkDiscoveryManager ...@@ -1080,8 +1081,10 @@ public class LinkDiscoveryManager
rowValues.put(LINK_SRC_PORT_STATE, rowValues.put(LINK_SRC_PORT_STATE,
OFPhysicalPort.OFPortState.OFPPS_STP_BLOCK.getValue()); OFPhysicalPort.OFPortState.OFPPS_STP_BLOCK.getValue());
} else { } else {
log.trace("writeLink, link {}, info {}, srcPortState {}", if (log.isTraceEnabled()) {
new Object[]{ lt, linkInfo, linkInfo.getSrcPortState() }); log.trace("writeLink, link {}, info {}, srcPortState {}",
new Object[]{ lt, linkInfo, linkInfo.getSrcPortState() });
}
rowValues.put(LINK_SRC_PORT_STATE, linkInfo.getSrcPortState()); rowValues.put(LINK_SRC_PORT_STATE, linkInfo.getSrcPortState());
} }
String dstDpid = lt.getDst().getSw().getStringId(); String dstDpid = lt.getDst().getSw().getStringId();
...@@ -1097,13 +1100,10 @@ public class LinkDiscoveryManager ...@@ -1097,13 +1100,10 @@ public class LinkDiscoveryManager
} else { } else {
if (log.isTraceEnabled()) { if (log.isTraceEnabled()) {
log.trace("writeLink, link {}, info {}, dstPortState {}", log.trace("writeLink, link {}, info {}, dstPortState {}",
new Object[]{ lt, linkInfo, new Object[]{ lt, linkInfo, linkInfo.getDstPortState() });
linkInfo.getDstPortState() });
} }
rowValues.put(LINK_DST_PORT_STATE, linkInfo.getDstPortState()); rowValues.put(LINK_DST_PORT_STATE, linkInfo.getDstPortState());
} }
rowValues.put(LINK_VALID_TIME, linkInfo.getUnicastValidTime());
storageSource.updateRowAsync(LINK_TABLE_NAME, rowValues); storageSource.updateRowAsync(LINK_TABLE_NAME, rowValues);
} }
} }
......
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