import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
-import javax.transaction.SystemException;
-
import org.opendaylight.controller.clustering.services.CacheConfigException;
import org.opendaylight.controller.clustering.services.CacheExistException;
import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
return controllerNodesMap.get(controller);
}
- @SuppressWarnings("deprecation")
public Set<Node> getNodes() {
return getNodes(clusterServices.getMyAddress());
}
return nodeConnections;
}
- @SuppressWarnings("deprecation")
public boolean isLocal(Node node) {
if (nodeConnections == null) return false;
InetAddress myController = clusterServices.getMyAddress();
return (controllers != null && controllers.contains(myController));
}
- @SuppressWarnings("deprecation")
public Status removeNode (Node node) {
return removeNodeFromController(node, clusterServices.getMyAddress());
}
* with this controller to take hold of a Node.
*/
if (isConnectionAllowed(node)) {
- if (!nodeConnections.replace(node, oldControllers, newControllers)) {
+ if (oldControllers == null || !nodeConnections.replace(node, oldControllers, newControllers)) {
clusterServices.trollback();
try {
Thread.sleep(100);
} catch ( InterruptedException e) {}
- log.debug("Replace failed... old={} with new={} for {} to {}", oldControllers.toString(), newControllers.toString(),
- controller.getHostAddress(), node.toString());
+ log.debug("Retrying ... {} with {}", controller.getHostAddress(), node.toString());
return putNodeToController(node, controller);
} else {
log.debug("Replace successful old={} with new={} for {} to {}", oldControllers.toString(), newControllers.toString(),
} catch (CacheConfigException cce) {
log.error("\nCache configuration invalid - check cache mode");
} catch (Exception e) {
- e.printStackTrace();
+ log.error("An error occured",e);
}
}
}