BUG-2383: cache effective attributes in import 92/19792/2
authorRobert Varga <rovarga@cisco.com>
Thu, 7 May 2015 08:26:12 +0000 (10:26 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 7 May 2015 13:51:06 +0000 (13:51 +0000)
commit0f45fddaa8c98c92ec9cb0571fa32443ef214dc4
treef719eb64ca2b051065aed24f1b3f47f5e7d8b8b7
parent95d012a0826b56b2a6fea9ac85d20b50a1042b05
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>
(cherry picked from commit ff7a5daa1e8a22f46e0423f7e6317bf8ea7ea078)
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