Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
floodlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
croft1
floodlight
Commits
cb07c688
Commit
cb07c688
authored
12 years ago
by
Monoreet Mutsuddi
Browse files
Options
Downloads
Patches
Plain Diff
dont update Switch/Port table on SLAVE
parent
5f87ec5f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/net/floodlightcontroller/core/internal/Controller.java
+19
-4
19 additions, 4 deletions
...va/net/floodlightcontroller/core/internal/Controller.java
with
19 additions
and
4 deletions
src/main/java/net/floodlightcontroller/core/internal/Controller.java
+
19
−
4
View file @
cb07c688
...
...
@@ -354,6 +354,10 @@ public class Controller implements IFloodlightProviderService,
@Override
public
void
setRole
(
Role
role
)
{
if
(
role
==
null
)
throw
new
NullPointerException
(
"Role can not be null."
);
if
(
role
==
Role
.
MASTER
&&
this
.
role
==
Role
.
SLAVE
)
{
// Reset db state to Inactive for all switches.
updateAllInactiveSwitchInfo
();
}
// Need to synchronize to ensure a reliable ordering on role request
// messages send and to ensure the list of connected switches is stable
...
...
@@ -369,10 +373,6 @@ public class Controller implements IFloodlightProviderService,
Role
oldRole
=
this
.
role
;
this
.
role
=
role
;
if
(
role
==
Role
.
MASTER
)
{
updateAllInactiveSwitchInfo
();
}
log
.
debug
(
"Submitting role change request to role {}"
,
role
);
roleChanger
.
submitRequest
(
connectedSwitches
,
role
);
...
...
@@ -1487,6 +1487,9 @@ public class Controller implements IFloodlightProviderService,
// **************
protected
void
updateAllInactiveSwitchInfo
()
{
if
(
role
==
Role
.
SLAVE
)
{
return
;
}
String
controllerId
=
getControllerId
();
String
[]
switchColumns
=
{
SWITCH_DATAPATH_ID
,
SWITCH_CONTROLLER_ID
,
...
...
@@ -1544,6 +1547,9 @@ public class Controller implements IFloodlightProviderService,
}
protected
void
updateActiveSwitchInfo
(
IOFSwitch
sw
)
{
if
(
role
==
Role
.
SLAVE
)
{
return
;
}
// Obtain the row info for the switch
Map
<
String
,
Object
>
switchInfo
=
new
HashMap
<
String
,
Object
>();
String
datapathIdString
=
sw
.
getStringId
();
...
...
@@ -1588,6 +1594,9 @@ public class Controller implements IFloodlightProviderService,
}
protected
void
updateInactiveSwitchInfo
(
IOFSwitch
sw
)
{
if
(
role
==
Role
.
SLAVE
)
{
return
;
}
log
.
debug
(
"Update DB with inactiveSW {}"
,
sw
);
// Update the controller info in the storage source to be inactive
Map
<
String
,
Object
>
switchInfo
=
new
HashMap
<
String
,
Object
>();
...
...
@@ -1599,6 +1608,9 @@ public class Controller implements IFloodlightProviderService,
}
protected
void
updatePortInfo
(
IOFSwitch
sw
,
OFPhysicalPort
port
)
{
if
(
role
==
Role
.
SLAVE
)
{
return
;
}
String
datapathIdString
=
sw
.
getStringId
();
Map
<
String
,
Object
>
portInfo
=
new
HashMap
<
String
,
Object
>();
int
portNumber
=
U16
.
f
(
port
.
getPortNumber
());
...
...
@@ -1672,6 +1684,9 @@ public class Controller implements IFloodlightProviderService,
}
protected
void
removePortInfo
(
IOFSwitch
sw
,
short
portNumber
)
{
if
(
role
==
Role
.
SLAVE
)
{
return
;
}
String
datapathIdString
=
sw
.
getStringId
();
String
id
=
datapathIdString
+
"|"
+
portNumber
;
storageSource
.
deleteRowAsync
(
PORT_TABLE_NAME
,
id
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment