mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-22 12:51:09 +02:00
update and get available link resource consindering existing linkAllocations
Change-Id: Iee93253d253ff38d23630a2c5ac9c0a14329d92f
This commit is contained in:
parent
112c703dc5
commit
00c94f5533
@ -86,7 +86,7 @@ public interface LinkResourceService {
|
|||||||
* @param allocations allocations to be included as available
|
* @param allocations allocations to be included as available
|
||||||
* @return available resources for the target link
|
* @return available resources for the target link
|
||||||
*/
|
*/
|
||||||
ResourceRequest getAvailableResources(Link link,
|
Iterable<ResourceRequest> getAvailableResources(Link link,
|
||||||
LinkResourceAllocations allocations);
|
LinkResourceAllocations allocations);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -269,7 +269,7 @@ public class IntentTestsMocks {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResourceRequest getAvailableResources(Link link, LinkResourceAllocations allocations) {
|
public Iterable<ResourceRequest> getAvailableResources(Link link, LinkResourceAllocations allocations) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -156,8 +156,8 @@ public class LinkResourceManager implements LinkResourceService {
|
|||||||
@Override
|
@Override
|
||||||
public LinkResourceAllocations updateResources(LinkResourceRequest req,
|
public LinkResourceAllocations updateResources(LinkResourceRequest req,
|
||||||
LinkResourceAllocations oldAllocations) {
|
LinkResourceAllocations oldAllocations) {
|
||||||
// TODO
|
releaseResources(oldAllocations);
|
||||||
return null;
|
return requestResources(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -196,10 +196,13 @@ public class LinkResourceManager implements LinkResourceService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResourceRequest getAvailableResources(Link link,
|
public Iterable<ResourceRequest> getAvailableResources(Link link,
|
||||||
LinkResourceAllocations allocations) {
|
LinkResourceAllocations allocations) {
|
||||||
// TODO
|
Set<ResourceRequest> result = new HashSet<>();
|
||||||
return null;
|
Set<ResourceAllocation> allocatedRes = allocations.getResourceAllocation(link);
|
||||||
|
result = (Set<ResourceRequest>) getAvailableResources(link);
|
||||||
|
result.addAll(allocatedRes);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user