BUG-2383: cache effective attributes in import 79/19779/4
authorRobert Varga <rovarga@cisco.com>
Thu, 7 May 2015 08:26:12 +0000 (10:26 +0200)
committerRobert Varga <nite@hq.sk>
Thu, 7 May 2015 09:39:20 +0000 (09:39 +0000)
commitff7a5daa1e8a22f46e0423f7e6317bf8ea7ea078
tree8e890b6221f78a88ac74648b1ae4864d7caca0b5
parent45e441f5b159f616ae85bcf62c0e0d2432d485ad
BUG-2383: cache effective attributes in import

This patch introduces a simple identity cache decorator around
AbstractImportPolicy. It is then used by ImportPolicyPeerTracker and
EffectiveRibInWriter to make sure we do not needlessly explode
attribute objects. This would typically happen when we receive multiple
routes within a single message and the import policy modifies the
attributes -- leading to a per-route attribute object.

Change-Id: I8581df3e3a2aae07a16d44f2554026afbad264fd
Signed-off-by: Robert Varga <rovarga@cisco.com>
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/CachingImportPolicy.java [new file with mode: 0644]
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/ImportPolicyPeerTracker.java