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
Sho SHIMIZU
2016-05-13 13:09:32 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a7e3277817589b25179d25a538788aec8043833e
a7e32778
1 parent
b05d70a9
Refactor: Rename
Change-Id: I5429759af26ff99623338c605f1b03bddeb7b814
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
core/store/dist/src/main/java/org/onosproject/store/resource/impl/TransactionalContinuousResourceStore.java
core/store/dist/src/main/java/org/onosproject/store/resource/impl/TransactionalContinuousResourceStore.java
View file @
a7e3277
...
...
@@ -174,22 +174,22 @@ class TransactionalContinuousResourceStore {
boolean
release
(
ContinuousResource
resource
,
ResourceConsumer
consumer
)
{
ContinuousResourceAllocation
oldAllocation
=
consumers
.
get
(
resource
.
id
());
List
<
ResourceAllocation
>
nonMatch
Resources
=
oldAllocation
.
allocations
().
stream
()
List
<
ResourceAllocation
>
nonMatch
ed
=
oldAllocation
.
allocations
().
stream
()
.
filter
(
x
->
!(
x
.
consumer
().
equals
(
consumer
)
&&
((
ContinuousResource
)
x
.
resource
()).
value
()
==
resource
.
value
()))
.
collect
(
Collectors
.
toList
());
List
<
ResourceAllocation
>
match
Resources
=
oldAllocation
.
allocations
().
stream
()
List
<
ResourceAllocation
>
match
ed
=
oldAllocation
.
allocations
().
stream
()
.
filter
(
x
->
(
x
.
consumer
().
equals
(
consumer
)
&&
((
ContinuousResource
)
x
.
resource
()).
value
()
==
resource
.
value
()))
.
collect
(
Collectors
.
toList
());
if
(
match
Resources
.
size
()
>
1
)
{
match
Resources
.
remove
(
0
);
if
(
match
ed
.
size
()
>
1
)
{
match
ed
.
remove
(
0
);
}
ImmutableList
<
ResourceAllocation
>
finalAllocations
=
Stream
.
concat
(
nonMatch
Resources
.
stream
(),
match
Resources
.
stream
()).
collect
(
GuavaCollectors
.
toImmutableList
());
ImmutableList
<
ResourceAllocation
>
finalAllocations
=
Stream
.
concat
(
nonMatch
ed
.
stream
(),
match
ed
.
stream
()).
collect
(
GuavaCollectors
.
toImmutableList
());
if
(!
consumers
.
replace
(
resource
.
id
(),
oldAllocation
,
new
ContinuousResourceAllocation
(
oldAllocation
.
original
(),
finalAllocations
)))
{
...
...
Please
register
or
login
to post a comment