Skip to content
Snippets Groups Projects
Commit bcd18f0e authored by Michael Stolarchuk's avatar Michael Stolarchuk
Browse files

Move core-switch from controller_switch to controller_switchconfig

parent 92f23d31
No related branches found
No related tags found
No related merge requests found
......@@ -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");
}
}
......
......@@ -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();
......
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