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
2015-10-02 15:13:27 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a005a6e5e2bfe9d88c7d2da004a403afe7f1ed40
a005a6e5
1 parent
a890e7c1
Refactor: Reduce depth of indent
Change-Id: I9a1beb803619cc0ec8b4b23761bbfb03ffc49fa4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentLinkResourceStore.java
core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentLinkResourceStore.java
View file @
a005a6e
...
...
@@ -149,16 +149,17 @@ public class ConsistentLinkResourceStore extends
}
private
Set
<
LambdaResourceAllocation
>
getLambdaResourceCapacity
(
Link
link
)
{
Set
<
LambdaResourceAllocation
>
allocations
=
new
HashSet
<>();
Port
port
=
deviceService
.
getPort
(
link
.
src
().
deviceId
(),
link
.
src
().
port
());
if
(
port
instanceof
OmsPort
)
{
OmsPort
omsPort
=
(
OmsPort
)
port
;
if
(!(
port
instanceof
OmsPort
))
{
return
Collections
.
emptySet
();
}
OmsPort
omsPort
=
(
OmsPort
)
port
;
Set
<
LambdaResourceAllocation
>
allocations
=
new
HashSet
<>();
// Assume fixed grid for now
for
(
int
i
=
0
;
i
<
omsPort
.
totalChannels
();
i
++)
{
allocations
.
add
(
new
LambdaResourceAllocation
(
LambdaResource
.
valueOf
(
i
)));
}
}
return
allocations
;
}
...
...
@@ -168,15 +169,16 @@ public class ConsistentLinkResourceStore extends
// if all fails, use DEFAULT_BANDWIDTH
BandwidthResource
bandwidth
=
DEFAULT_BANDWIDTH
;
String
strBw
=
link
.
annotations
().
value
(
BANDWIDTH
);
if
(
strBw
!=
null
)
{
if
(
strBw
==
null
)
{
return
new
BandwidthResourceAllocation
(
bandwidth
);
}
try
{
bandwidth
=
new
BandwidthResource
(
Bandwidth
.
mbps
(
Double
.
parseDouble
(
strBw
)));
}
catch
(
NumberFormatException
e
)
{
// do nothings, use default bandwidth
bandwidth
=
DEFAULT_BANDWIDTH
;
}
}
return
new
BandwidthResourceAllocation
(
bandwidth
);
}
...
...
Please
register
or
login
to post a comment