Priyanka B

[ONOS-4794] [ONOS-4793] [ONOS-4669]TE_COST and bandwidth information on update flow was not correct

Change-Id: Ib91b7c47c95e005a0ace1fdaa7e82fbdb7f02533
...@@ -27,9 +27,7 @@ import java.util.Map; ...@@ -27,9 +27,7 @@ import java.util.Map;
27 import java.util.Optional; 27 import java.util.Optional;
28 import java.util.Map.Entry; 28 import java.util.Map.Entry;
29 import java.util.Set; 29 import java.util.Set;
30 -import java.util.concurrent.Executors;
31 import java.util.concurrent.ScheduledExecutorService; 30 import java.util.concurrent.ScheduledExecutorService;
32 -import java.util.concurrent.TimeUnit;
33 31
34 import org.onlab.packet.Ethernet; 32 import org.onlab.packet.Ethernet;
35 import org.onlab.packet.IPv4; 33 import org.onlab.packet.IPv4;
...@@ -263,9 +261,6 @@ public class PceManager implements PceService { ...@@ -263,9 +261,6 @@ public class PceManager implements PceService {
263 261
264 packetService.addProcessor(processor, PacketProcessor.director(4)); 262 packetService.addProcessor(processor, PacketProcessor.director(4));
265 topologyService.addListener(topologyListener); 263 topologyService.addListener(topologyListener);
266 - executor = Executors.newSingleThreadScheduledExecutor();
267 - //Start a timer when the component is up, with initial delay of 30min and periodic delays at 30min
268 - executor.scheduleAtFixedRate(new GlobalOptimizationTimer(), INITIAL_DELAY, PERIODIC_DELAY, TimeUnit.MINUTES);
269 264
270 // Reserve global node pool 265 // Reserve global node pool
271 if (!srTeHandler.reserveGlobalPool(GLOBAL_LABEL_SPACE_MIN, GLOBAL_LABEL_SPACE_MAX)) { 266 if (!srTeHandler.reserveGlobalPool(GLOBAL_LABEL_SPACE_MIN, GLOBAL_LABEL_SPACE_MAX)) {
...@@ -283,8 +278,6 @@ public class PceManager implements PceService { ...@@ -283,8 +278,6 @@ public class PceManager implements PceService {
283 netCfgService.removeListener(cfgListener); 278 netCfgService.removeListener(cfgListener);
284 packetService.removeProcessor(processor); 279 packetService.removeProcessor(processor);
285 topologyService.removeListener(topologyListener); 280 topologyService.removeListener(topologyListener);
286 - // Shutdown the thread when component is deactivated
287 - executor.shutdown();
288 log.info("Stopped"); 281 log.info("Stopped");
289 } 282 }
290 283
......
...@@ -495,7 +495,7 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler { ...@@ -495,7 +495,7 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler {
495 @Override 495 @Override
496 public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { 496 public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception {
497 497
498 - log.info("[exceptionCaught]: " + e.toString()); 498 + log.error("[exceptionCaught]: " + e.toString());
499 499
500 if (e.getCause() instanceof ReadTimeoutException) { 500 if (e.getCause() instanceof ReadTimeoutException) {
501 // device timeout 501 // device timeout
......
...@@ -1531,7 +1531,6 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid ...@@ -1531,7 +1531,6 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
1531 bandwidth = attributes.getBandwidthObject().getBandwidth(); 1531 bandwidth = attributes.getBandwidthObject().getBandwidth();
1532 } 1532 }
1533 } 1533 }
1534 -
1535 List<Object> eroSubObjList = buildPathFromEroObj(eroObj, providerId); 1534 List<Object> eroSubObjList = buildPathFromEroObj(eroObj, providerId);
1536 List<Link> links = new ArrayList<>(); 1535 List<Link> links = new ArrayList<>();
1537 List<LabelResourceId> labels = new ArrayList<>(); 1536 List<LabelResourceId> labels = new ArrayList<>();
...@@ -1542,10 +1541,8 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid ...@@ -1542,10 +1541,8 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
1542 labels.add(LabelResourceId.labelResourceId(((Integer) linkOrLabel).longValue())); 1541 labels.add(LabelResourceId.labelResourceId(((Integer) linkOrLabel).longValue()));
1543 } 1542 }
1544 } 1543 }
1545 -
1546 Path path = new DefaultPath(providerId, links, cost, EMPTY); 1544 Path path = new DefaultPath(providerId, links, cost, EMPTY);
1547 NetworkResource labelStack = new DefaultLabelStack(labels); 1545 NetworkResource labelStack = new DefaultLabelStack(labels);
1548 -
1549 // To carry PST TLV, SRP object can be present with value 0 even when PCRpt is not in response to any action 1546 // To carry PST TLV, SRP object can be present with value 0 even when PCRpt is not in response to any action
1550 // from PCE. 1547 // from PCE.
1551 PcepSrpObject srpObj = stateRpt.getSrpObject(); 1548 PcepSrpObject srpObj = stateRpt.getSrpObject();
...@@ -1577,7 +1574,6 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid ...@@ -1577,7 +1574,6 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
1577 log.error("Stateful IPv4 identifier TLV is null in PCRpt msg."); 1574 log.error("Stateful IPv4 identifier TLV is null in PCRpt msg.");
1578 return; 1575 return;
1579 } 1576 }
1580 -
1581 IpTunnelEndPoint tunnelEndPointSrc = IpTunnelEndPoint 1577 IpTunnelEndPoint tunnelEndPointSrc = IpTunnelEndPoint
1582 .ipTunnelPoint(IpAddress.valueOf(ipv4LspIdenTlv.getIpv4IngressAddress())); 1578 .ipTunnelPoint(IpAddress.valueOf(ipv4LspIdenTlv.getIpv4IngressAddress()));
1583 IpTunnelEndPoint tunnelEndPointDst = IpTunnelEndPoint 1579 IpTunnelEndPoint tunnelEndPointDst = IpTunnelEndPoint
...@@ -1591,7 +1587,6 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid ...@@ -1591,7 +1587,6 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
1591 pcepClientController.getClient(pccId).setLspAndDelegationInfo( 1587 pcepClientController.getClient(pccId).setLspAndDelegationInfo(
1592 new LspKey(lspObj.getPlspId(), ipv4LspIdenTlv.getLspId()), lspObj.getDFlag()); 1588 new LspKey(lspObj.getPlspId(), ipv4LspIdenTlv.getLspId()), lspObj.getDFlag());
1593 } 1589 }
1594 -
1595 Tunnel tunnel = null; 1590 Tunnel tunnel = null;
1596 // Asynchronous status change message from PCC for LSP reported earlier. 1591 // Asynchronous status change message from PCC for LSP reported earlier.
1597 for (Tunnel tunnelObj : tunnelQueryResult) { 1592 for (Tunnel tunnelObj : tunnelQueryResult) {
...@@ -1684,7 +1679,13 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid ...@@ -1684,7 +1679,13 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
1684 1679
1685 //delegated owner will update can be a master or non-master 1680 //delegated owner will update can be a master or non-master
1686 if (lspObj.getDFlag()) { 1681 if (lspObj.getDFlag()) {
1687 - annotations = getAnnotations(lspObj, ipv4LspIdenTlv, bandwidth, lspType, costType); 1682 +
1683 + if (tunnel.annotations().value(BANDWIDTH) != null) {
1684 + bandwidth = Float.parseFloat(tunnel.annotations().value(BANDWIDTH));
1685 + }
1686 + annotations = getAnnotations(lspObj, ipv4LspIdenTlv,
1687 + bandwidth, lspType,
1688 + tunnel.annotations().value(COST_TYPE));
1688 td = new DefaultTunnelDescription(null, tunnelEndPointSrc, tunnelEndPointDst, MPLS, new DefaultGroupId( 1689 td = new DefaultTunnelDescription(null, tunnelEndPointSrc, tunnelEndPointDst, MPLS, new DefaultGroupId(
1689 0), providerId, TunnelName.tunnelName(new String(pathNameTlv.getValue())), 1690 0), providerId, TunnelName.tunnelName(new String(pathNameTlv.getValue())),
1690 tunnel.path(), labelStack, annotations); 1691 tunnel.path(), labelStack, annotations);
......