diff --git a/src/main/java/net/floodlightcontroller/core/internal/Controller.java b/src/main/java/net/floodlightcontroller/core/internal/Controller.java index 0f9f77bf15bde0bde303a72477aee2438cfaaefb..3c0f7c033fabed421413769cd47ac267a42a4747 100644 --- a/src/main/java/net/floodlightcontroller/core/internal/Controller.java +++ b/src/main/java/net/floodlightcontroller/core/internal/Controller.java @@ -182,12 +182,14 @@ public class Controller implements IFloodlightProviderService, protected static final String SWITCH_IP = "ip"; protected static final String SWITCH_CONTROLLER_ID = "controller_id"; protected static final String SWITCH_ACTIVE = "active"; - protected static final String SWITCH_CORE_SWITCH = "core_switch"; protected static final String SWITCH_CONNECTED_SINCE = "connected_since"; protected static final String SWITCH_CAPABILITIES = "capabilities"; protected static final String SWITCH_BUFFERS = "buffers"; protected static final String SWITCH_TABLES = "tables"; protected static final String SWITCH_ACTIONS = "actions"; + + protected static final String SWITCH_CONFIG_TABLE_NAME = "controller_switchconfig"; + protected static final String SWITCH_CONFIG_CORE_SWITCH = "core_switch"; protected static final String PORT_TABLE_NAME = "controller_port"; protected static final String PORT_ID = "id"; @@ -593,20 +595,20 @@ public class Controller implements IFloodlightProviderService, try { String swid = sw.getStringId(); resultSet = - storageSource.getRow(SWITCH_TABLE_NAME, swid); + storageSource.getRow(SWITCH_CONFIG_TABLE_NAME, swid); for (Iterator<IResultSet> it = resultSet.iterator(); it.hasNext();) { // In case of multiple rows, use the status // in last row? Map<String, Object> row = it.next().getRow(); - if (row.containsKey(SWITCH_CORE_SWITCH)) { + if (row.containsKey(SWITCH_CONFIG_CORE_SWITCH)) { if (log.isDebugEnabled()) { log.debug("Reading SWITCH_IS_CORE_SWITCH " + "config for switch={}, is-core={}", - sw, row.get(SWITCH_CORE_SWITCH)); + sw, row.get(SWITCH_CONFIG_CORE_SWITCH)); } String ics = - (String)row.get(SWITCH_CORE_SWITCH); + (String)row.get(SWITCH_CONFIG_CORE_SWITCH); is_core_switch = ics.equals("true"); } } diff --git a/src/main/java/net/floodlightcontroller/linkdiscovery/internal/LinkDiscoveryManager.java b/src/main/java/net/floodlightcontroller/linkdiscovery/internal/LinkDiscoveryManager.java index 14da2f1f065bfc80593260a009ac0804bd7c8392..a1f58f0b35c7c30516cd8c159ed50dd4d89143aa 100644 --- a/src/main/java/net/floodlightcontroller/linkdiscovery/internal/LinkDiscoveryManager.java +++ b/src/main/java/net/floodlightcontroller/linkdiscovery/internal/LinkDiscoveryManager.java @@ -134,8 +134,8 @@ public class LinkDiscoveryManager private static final String LINK_VALID_TIME = "valid_time"; private static final String LINK_TYPE = "link_type"; - private static final String SWITCH_TABLE_NAME = "controller_switch"; - private static final String SWITCH_CORE_SWITCH = "core_switch"; + private static final String SWITCH_CONFIG_TABLE_NAME = "controller_switchconfig"; + private static final String SWITCH_CONFIG_CORE_SWITCH = "core_switch"; protected IFloodlightProviderService floodlightProvider; protected IStorageSourceService storageSource; @@ -1244,8 +1244,8 @@ public class LinkDiscoveryManager for (Iterator<IResultSet> it = resultSet.iterator(); it.hasNext();) { // In case of multiple rows, use the status in last row? Map<String, Object> row = it.next().getRow(); - if (row.containsKey(SWITCH_CORE_SWITCH)) { - new_status = ((String)row.get(SWITCH_CORE_SWITCH)).equals("true"); + if (row.containsKey(SWITCH_CONFIG_CORE_SWITCH)) { + new_status = ((String)row.get(SWITCH_CONFIG_CORE_SWITCH)).equals("true"); } } } @@ -1357,9 +1357,9 @@ public class LinkDiscoveryManager storageSource.setTablePrimaryKeyName(LINK_TABLE_NAME, LINK_ID); // Register for storage updates for the switch table try { - storageSource.addListener(SWITCH_TABLE_NAME, this); + storageSource.addListener(SWITCH_CONFIG_TABLE_NAME, this); } catch (StorageException ex) { - log.error("Error in installing listener for switch table - {}", SWITCH_TABLE_NAME); + log.error("Error in installing listener for switch table - {}", SWITCH_CONFIG_TABLE_NAME); } ScheduledExecutorService ses = threadPool.getScheduledExecutor();