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
Yuta HIGUCHI
2014-09-24 22:15:10 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ce58fa760367cb96b2188576b8bb409ded7247d5
ce58fa76
1 parent
843173d4
populate DevicePorts on activate
Change-Id: If716b27fb13dcd64021cf56a0a49b76bc2258a5e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
core/store/src/main/java/org/onlab/onos/store/device/impl/DistributedDeviceStore.java
core/store/src/main/java/org/onlab/onos/store/device/impl/DistributedDeviceStore.java
View file @
ce58fa7
...
...
@@ -95,6 +95,7 @@ public class DistributedDeviceStore
rawDevicePorts
.
addEntryListener
(
new
RemotePortEventHandler
(
devicePorts
),
includeValue
);
loadDeviceCache
();
loadDevicePortsCache
();
log
.
info
(
"Started"
);
}
...
...
@@ -122,13 +123,16 @@ public class DistributedDeviceStore
}
private
void
loadDeviceCache
()
{
log
.
info
(
"{}:{}"
,
rawDevices
.
size
(),
devices
.
size
());
if
(
rawDevices
.
size
()
!=
devices
.
size
())
{
for
(
Map
.
Entry
<
byte
[],
byte
[]>
e
:
rawDevices
.
entrySet
())
{
final
DeviceId
key
=
deserialize
(
e
.
getKey
());
final
DefaultDevice
val
=
deserialize
(
e
.
getValue
());
devices
.
put
(
key
,
Optional
.
of
(
val
));
}
for
(
byte
[]
keyBytes
:
rawDevices
.
keySet
())
{
final
DeviceId
id
=
deserialize
(
keyBytes
);
devices
.
refresh
(
id
);
}
}
private
void
loadDevicePortsCache
()
{
for
(
byte
[]
keyBytes
:
rawDevicePorts
.
keySet
())
{
final
DeviceId
id
=
deserialize
(
keyBytes
);
devicePorts
.
refresh
(
id
);
}
}
...
...
Please
register
or
login
to post a comment