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
a7697708
Commit
a7697708
authored
12 years ago
by
Gregor Maier
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'floodlight/master'
parents
4bced348
e8809cc5
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/topology/TopologyManager.java
+30
-12
30 additions, 12 deletions
...va/net/floodlightcontroller/topology/TopologyManager.java
with
30 additions
and
12 deletions
src/main/java/net/floodlightcontroller/topology/TopologyManager.java
+
30
−
12
View file @
a7697708
...
...
@@ -106,7 +106,17 @@ public class TopologyManager implements
protected
SingletonTask
newInstanceTask
;
private
Date
lastUpdateTime
;
protected
boolean
recomputeTopologyFlag
;
/**
* Flag that indicates if links (direct/tunnel/multihop links) were
* updated as part of LDUpdate.
*/
protected
boolean
linksUpdated
;
/**
* Flag that indicates if direct or tunnel links were updated as
* part of LDUpdate.
*/
protected
boolean
dtLinksUpdated
;
/**
* Thread for recomputing topology. The thread is always running,
...
...
@@ -130,12 +140,14 @@ public class TopologyManager implements
}
public
boolean
updateTopology
()
{
recomputeTopologyFlag
=
false
;
boolean
newInstanceFlag
;
linksUpdated
=
false
;
dtLinksUpdated
=
false
;
applyUpdates
();
createNewInstance
();
newInstanceFlag
=
createNewInstance
();
lastUpdateTime
=
new
Date
();
informListeners
();
return
recomputeTopology
Flag
;
return
newInstance
Flag
;
}
// **********************
...
...
@@ -866,12 +878,13 @@ public class TopologyManager implements
/**
* This function computes a new topology instance.
* It ignores links connected to all broadcast domain ports
* and tunnel ports.
* and tunnel ports. The method returns if a new instance of
* topology was created or not.
*/
protected
void
createNewInstance
()
{
protected
boolean
createNewInstance
()
{
Set
<
NodePortTuple
>
blockedPorts
=
new
HashSet
<
NodePortTuple
>();
if
(!
recomputeTopologyFlag
)
return
;
if
(!
linksUpdated
)
return
false
;
Map
<
NodePortTuple
,
Set
<
Link
>>
openflowLinks
;
openflowLinks
=
...
...
@@ -899,6 +912,7 @@ public class TopologyManager implements
// If needed, we may compute them differently.
currentInstance
=
nt
;
currentInstanceWithoutTunnels
=
nt
;
return
true
;
}
...
...
@@ -1017,18 +1031,19 @@ public class TopologyManager implements
addLinkToStructure
(
portBroadcastDomainLinks
,
link
);
flag1
=
removeLinkFromStructure
(
tunnelLinks
,
link
);
flag2
=
removeLinkFromStructure
(
directLinks
,
link
);
recomputeTopologyFlag
=
flag1
||
flag2
;
dtLinksUpdated
=
flag1
||
flag2
;
}
else
if
(
type
.
equals
(
LinkType
.
TUNNEL
))
{
addLinkToStructure
(
tunnelLinks
,
link
);
removeLinkFromStructure
(
portBroadcastDomainLinks
,
link
);
removeLinkFromStructure
(
directLinks
,
link
);
recomputeTopologyFlag
=
true
;
dtLinksUpdated
=
true
;
}
else
if
(
type
.
equals
(
LinkType
.
DIRECT_LINK
))
{
addLinkToStructure
(
directLinks
,
link
);
removeLinkFromStructure
(
tunnelLinks
,
link
);
removeLinkFromStructure
(
portBroadcastDomainLinks
,
link
);
recomputeTopologyFlag
=
true
;
dtLinksUpdated
=
true
;
}
linksUpdated
=
true
;
}
public
void
removeLink
(
Link
link
)
{
...
...
@@ -1037,7 +1052,8 @@ public class TopologyManager implements
flag1
=
removeLinkFromStructure
(
directLinks
,
link
);
flag2
=
removeLinkFromStructure
(
tunnelLinks
,
link
);
recomputeTopologyFlag
=
flag1
||
flag2
;
linksUpdated
=
true
;
dtLinksUpdated
=
flag1
||
flag2
;
removeLinkFromStructure
(
portBroadcastDomainLinks
,
link
);
removeLinkFromStructure
(
switchPortLinks
,
link
);
...
...
@@ -1068,7 +1084,7 @@ public class TopologyManager implements
}
}
public
void
removeLink
(
long
srcId
,
short
srcPort
,
public
void
removeLink
(
long
srcId
,
short
srcPort
,
long
dstId
,
short
dstPort
)
{
Link
link
=
new
Link
(
srcId
,
srcPort
,
dstId
,
dstPort
);
removeLink
(
link
);
...
...
@@ -1089,6 +1105,8 @@ public class TopologyManager implements
*/
private
void
clearCurrentTopology
()
{
this
.
clear
();
linksUpdated
=
true
;
dtLinksUpdated
=
true
;
createNewInstance
();
lastUpdateTime
=
new
Date
();
}
...
...
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