Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Thomas Vachuska
2014-10-21 23:52:34 -0700
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
e0d90df6983ad177ea0b4d43d9f7e791c9418d1a
e0d90df6
2 parents
5d42c6b1
67dce883
Merge remote-tracking branch 'origin/master'
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
core/net/src/main/java/org/onlab/onos/net/device/impl/DeviceManager.java
core/net/src/main/java/org/onlab/onos/net/device/impl/DeviceManager.java
View file @
e0d90df
...
...
@@ -153,8 +153,11 @@ public class DeviceManager
DeviceProvider
provider
=
getProvider
(
device
.
providerId
());
if
(
provider
!=
null
)
{
provider
.
roleChanged
(
device
,
newRole
);
// only trigger event when request was sent to provider
// TODO: consider removing this from Device event type?
post
(
new
DeviceEvent
(
DEVICE_MASTERSHIP_CHANGED
,
device
));
}
post
(
new
DeviceEvent
(
DEVICE_MASTERSHIP_CHANGED
,
device
));
}
}
...
...
@@ -164,6 +167,7 @@ public class DeviceManager
// XXX is this intended to apply to the full global topology?
// if so, we probably don't want the fact that we aren't
// MASTER to get in the way, as it would do now.
// FIXME: forward or broadcast and let the Master handler the event.
DeviceEvent
event
=
store
.
removeDevice
(
deviceId
);
if
(
event
!=
null
)
{
log
.
info
(
"Device {} administratively removed"
,
deviceId
);
...
...
@@ -347,6 +351,9 @@ public class DeviceManager
deviceId
);
if
(
role
==
MastershipRole
.
MASTER
)
{
mastershipService
.
relinquishMastership
(
deviceId
);
// TODO: Shouldn't we be triggering event?
//final Device device = getDevice(deviceId);
//post(new DeviceEvent(DEVICE_MASTERSHIP_CHANGED, device));
}
}
}
...
...
@@ -367,7 +374,7 @@ public class DeviceManager
final
NodeId
myNodeId
=
clusterService
.
getLocalNode
().
id
();
log
.
info
(
"## got Mastershipevent for dev {}"
,
did
);
if
(
myNodeId
.
equals
(
event
.
node
()))
{
if
(
myNodeId
.
equals
(
event
.
roleInfo
().
master
()))
{
MastershipTerm
term
=
termService
.
getMastershipTerm
(
did
);
if
(!
myNodeId
.
equals
(
term
.
master
()))
{
...
...
@@ -398,7 +405,7 @@ public class DeviceManager
}
//TODO re-collect device information to fix potential staleness
applyRole
(
did
,
MastershipRole
.
MASTER
);
}
else
{
}
else
if
(
event
.
roleInfo
().
backups
().
contains
(
myNodeId
))
{
applyRole
(
did
,
MastershipRole
.
STANDBY
);
}
}
...
...
Please
register
or
login
to post a comment