Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Relaxing a strict check in updateNode in SwitchManager to handle a condition in which...
[controller.git]
/
opendaylight
/
switchmanager
/
implementation
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
switchmanager
/
internal
/
SwitchManager.java
diff --git
a/opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java
b/opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java
index b5d0a48c28709e575f13646971e00ab1ddbc3ea0..674da37afb5676a971905aefc3caf2a84eb2c761 100644
(file)
--- a/
opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java
+++ b/
opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java
@@
-175,16
+175,11
@@
public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
retrieveCaches();
/*
retrieveCaches();
/*
- * Read startup and build database if we have not already gotten the
- * configurations synced from another node
+ * Read startup and build database if we are the coordinator
*/
*/
- if (
subnetsConfigList.isEmpty(
)) {
+ if (
(clusterContainerService != null) && (clusterContainerService.amICoordinator()
)) {
loadSubnetConfiguration();
loadSubnetConfiguration();
- }
- if (spanConfigList.isEmpty()) {
loadSpanConfiguration();
loadSpanConfiguration();
- }
- if (nodeConfigList.isEmpty()) {
loadSwitchConfiguration();
}
loadSwitchConfiguration();
}
@@
-242,7
+237,7
@@
public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
@SuppressWarnings({ "unchecked" })
private void retrieveCaches() {
if (this.clusterContainerService == null) {
@SuppressWarnings({ "unchecked" })
private void retrieveCaches() {
if (this.clusterContainerService == null) {
- log.
info
("un-initialized clusterContainerService, can't create cache");
+ log.
warn
("un-initialized clusterContainerService, can't create cache");
return;
}
return;
}
@@
-794,7
+789,7
@@
public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
return;
}
return;
}
- log.
info
("Set Node {}'s Mode to {}", nodeId, cfgObject.getMode());
+ log.
trace
("Set Node {}'s Mode to {}", nodeId, cfgObject.getMode());
if (modeChange) {
notifyModeChange(node, cfgObject.isProactive());
if (modeChange) {
notifyModeChange(node, cfgObject.isProactive());
@@
-1108,8
+1103,7
@@
public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
private void updateNode(Node node, Set<Property> props) {
log.trace("{} updated, props: {}", node, props);
private void updateNode(Node node, Set<Property> props) {
log.trace("{} updated, props: {}", node, props);
- if (nodeProps == null || !nodeProps.containsKey(node) ||
- props == null || props.isEmpty()) {
+ if (nodeProps == null || props == null) {
return;
}
return;
}
@@
-1310,10
+1304,6
@@
public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
if (nodeProps.replace(node, propMapCurr, propMap)) {
return;
}
if (nodeProps.replace(node, propMapCurr, propMap)) {
return;
}
- if (!propMapCurr.get(prop.getName()).equals(nodeProps.get(node).get(prop.getName()))) {
- log.debug("Cluster conflict: Unable to add property {} to node {}.", prop.getName(), node.getID());
- return;
- }
}
log.warn("Cluster conflict: Unable to add property {} to node {}.", prop.getName(), node.getID());
}
}
log.warn("Cluster conflict: Unable to add property {} to node {}.", prop.getName(), node.getID());
}
@@
-1331,12
+1321,6
@@
public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
if (nodeProps.replace(node, propMapCurr, propMap)) {
return new Status(StatusCode.SUCCESS);
}
if (nodeProps.replace(node, propMapCurr, propMap)) {
return new Status(StatusCode.SUCCESS);
}
- if (!propMapCurr.get(propName).equals(nodeProps.get(node).get(propName))) {
- String msg = "Cluster conflict: Unable to remove property " + propName + " for node "
- + node.getID();
- return new Status(StatusCode.CONFLICT, msg);
- }
-
} else {
return new Status(StatusCode.SUCCESS);
}
} else {
return new Status(StatusCode.SUCCESS);
}