示例#1
0
文件: Placer.java 项目: sdnnfv/vCRIB
 protected void updateLinks(Map<Link, Long> oldTraffic, Map<Link, Long> linkTraffic) {
   for (Map.Entry<Link, Long> linkDoubleEntry : linkTraffic.entrySet()) {
     Link link = linkDoubleEntry.getKey();
     if (oldTraffic != null) {
       oldTraffic.put(link, link.getUsedCapacity());
     }
     link.setUsedCapacity(linkDoubleEntry.getValue());
   }
 }
示例#2
0
文件: Placer.java 项目: sdnnfv/vCRIB
 protected boolean linkFails(Map<Link, Long> linkTraffic) {
   for (Map.Entry<Link, Long> linkUsedCapacityEntry : linkTraffic.entrySet()) {
     Link link = linkUsedCapacityEntry.getKey();
     if (link.getCapacity() < linkTraffic.get(link)) {
       Util.logger.info(
           link.toString() + " failed. " + linkTraffic.get(link) + ">" + link.getCapacity());
       return true;
     }
   }
   return false;
 }