BGPCEP-574: Remove old ImportPolicyPeerTracker 43/68943/1
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Thu, 1 Mar 2018 11:01:21 +0000 (12:01 +0100)
committerClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Thu, 1 Mar 2018 11:48:04 +0000 (12:48 +0100)
Change-Id: Ife1849081727a6ab06038f3f5dbab010797347a7
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
20 files changed:
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/ApplicationPeer.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPPeer.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/CachingImportPolicy.java [deleted file]
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/EffectiveRibInWriter.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/ExportPolicyPeerTrackerImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/FromExternalImportPolicy.java [deleted file]
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/FromInternalImportPolicy.java [deleted file]
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/FromInternalReflectorClientImportPolicy.java [deleted file]
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/FromReflectorClientImportPolicy.java [deleted file]
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/ImportPolicyPeerTrackerImpl.java [deleted file]
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/PolicyDatabase.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/RIBImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/config/RibImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/spi/AbstractImportPolicy.java [deleted file]
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/spi/ImportPolicyPeerTracker.java [deleted file]
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/spi/RIB.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/FromExternalImportPolicyTest.java [deleted file]
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/config/AbstractConfig.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/config/RibImplTest.java
bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/PeerTrackerInformation.java

index f8333d8e5f1e2f0923bda0e506ddceace81dd821..a93d7bd363ca8752279d2b5627f1197abcb0f61e 100644 (file)
@@ -145,9 +145,7 @@ public class ApplicationPeer extends BGPPeerStateImpl implements org.opendayligh
         this.adjRibInWriter = this.adjRibInWriter.transform(this.peerId, context, localTables, Collections.emptyMap(),
                 registerAppPeerListener);
         this.effectiveRibInWriter = EffectiveRibInWriter
-                .create(this.rib, this.rib.createPeerChain(this), this.peerIId,
-                this.rib.getImportPolicyPeerTracker(), PeerRole.Internal,
-                localTables);
+                .create(this.rib, this.rib.createPeerChain(this), this.peerIId, localTables);
         this.bgpSessionState.registerMessagesCounter(this);
         this.trackerRegistration = this.rib.getPeerTracker().registerPeer(this);
     }
index c5d55cae9adb4e3d09773757b5466dd039447768..3e47a7cbf297d4443e00b94b9118de86780e4f5e 100644 (file)
@@ -327,11 +327,8 @@ public class BGPPeer extends BGPPeerStateImpl implements BGPSessionListener, Pee
         }
         addBgp4Support();
 
-        this.effRibInWriter = EffectiveRibInWriter.create(this.rib,
-                this.rib.createPeerChain(this),
-                this.peerIId, this.rib.getImportPolicyPeerTracker(),
-                this.peerRole,
-                this.tables);
+        this.effRibInWriter = EffectiveRibInWriter.create(this.rib, this.rib.createPeerChain(this),
+                this.peerIId, this.tables);
         registerPrefixesCounters(this.effRibInWriter, this.effRibInWriter);
         this.ribWriter = this.ribWriter.transform(this.peerId, this.rib.getRibSupportContext(), this.tables,
                 this.addPathTableMaps);
diff --git a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/CachingImportPolicy.java b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/CachingImportPolicy.java
deleted file mode 100644 (file)
index 07c17e5..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.protocol.bgp.rib.impl;
-
-import static java.util.Objects.requireNonNull;
-
-import com.google.common.collect.Interner;
-import com.google.common.collect.Interners;
-import com.google.common.collect.MapMaker;
-import java.util.concurrent.ConcurrentMap;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-import javax.annotation.concurrent.NotThreadSafe;
-import org.opendaylight.protocol.bgp.rib.impl.spi.AbstractImportPolicy;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.tables.Attributes;
-import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
-import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
-
-/**
- * A caching decorator for {@link AbstractImportPolicy}. Performs caching of effective
- * attributes using an identity-and-hashCode-based map for fast lookup and reuse of resulting
- * objects.
- */
-@NotThreadSafe
-final class CachingImportPolicy extends AbstractImportPolicy {
-
-    // A dummy ContainerNode, stored in the cache to indicate null effective attributes
-    private static final ContainerNode MASKED_NULL = ImmutableNodes.containerNode(Attributes.QNAME);
-
-    // We maintain a weak cache of returned effective attributes, so we end up reusing
-    // the same instance when asked. We set concurrency level to 1, as we do not expect
-    // the cache to be accessed from multiple threads. That may need to be changed
-    // if we end up sharing the cache across peers.
-    private final ConcurrentMap<ContainerNode, ContainerNode> cache =
-            new MapMaker().concurrencyLevel(1).weakKeys().weakValues().makeMap();
-
-    /*
-     * The cache itself is weak, which means we end up with identity hash/comparisons.
-     * That is good, but we want the cache to be effective even when equivalent attributes
-     * are presented. For that purpose we maintain a weak interner, which will allow us
-     * to map attributes to a canonical object without preventing garbage collection.
-     */
-    private final Interner<ContainerNode> interner = Interners.newWeakInterner();
-
-    private final AbstractImportPolicy delegate;
-
-    CachingImportPolicy(final AbstractImportPolicy delegate) {
-        this.delegate = requireNonNull(delegate);
-    }
-
-    @Nonnull private static ContainerNode maskNull(@Nullable final ContainerNode unmasked) {
-        return unmasked == null ? MASKED_NULL : unmasked;
-    }
-
-    @Nullable private static ContainerNode unmaskNull(@Nonnull final ContainerNode masked) {
-        return MASKED_NULL.equals(masked) ? null : masked;
-    }
-
-    @Override
-    public ContainerNode effectiveAttributes(final ContainerNode attributes) {
-        ContainerNode ret = this.cache.get(attributes);
-        if (ret != null) {
-            return unmaskNull(ret);
-        }
-
-        /*
-         * The cache returned empty. The reason for that may be that the attributes
-         * passed in are not identical to the ones forming the cache's key. Intern
-         * the passed attributes, which will result in a canonical reference.
-         *
-         * If the returned reference is different, attempt to look up in the cache
-         * again. If the reference is the same, we have just populated the interner
-         * and thus are on the path to create a new cache entry.
-         */
-        final ContainerNode interned = this.interner.intern(attributes);
-        if (!interned.equals(attributes)) {
-            final ContainerNode retry = this.cache.get(interned);
-            if (retry != null) {
-                return unmaskNull(retry);
-            }
-        }
-
-        final ContainerNode effective = this.delegate.effectiveAttributes(interned);
-
-        /*
-         * Populate the cache. Note that this may have raced with another thread,
-         * in which case we want to reuse the previous entry without replacing it.
-         * Check the result of conditional put and return it unmasked if it happens
-         * to be non-null. That will throw away the attributes we just created,
-         * but that's fine, as they have not leaked to heap yet and will be GC'd
-         * quickly.
-         */
-        final ContainerNode existing = this.cache.putIfAbsent(interned, maskNull(effective));
-        return existing != null ? unmaskNull(existing) : effective;
-
-    }
-}
index e39e6f9e015cd935f12bd52d7181cb237c212542..c27b350d2cf6d8b09f85e2ebdee2e208a1d8679b 100644 (file)
@@ -24,8 +24,6 @@ import org.opendaylight.controller.md.sal.dom.api.ClusteredDOMDataTreeChangeList
 import org.opendaylight.controller.md.sal.dom.api.DOMDataTreeIdentifier;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
 import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
-import org.opendaylight.protocol.bgp.rib.impl.spi.AbstractImportPolicy;
-import org.opendaylight.protocol.bgp.rib.impl.spi.ImportPolicyPeerTracker;
 import org.opendaylight.protocol.bgp.rib.impl.spi.RIB;
 import org.opendaylight.protocol.bgp.rib.impl.spi.RIBSupportContext;
 import org.opendaylight.protocol.bgp.rib.impl.spi.RIBSupportContextRegistry;
@@ -114,7 +112,7 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
             return b.build();
         }
 
-        private void processRoute(final DOMDataWriteTransaction tx, final RIBSupport ribSupport, final AbstractImportPolicy policy,
+        private void processRoute(final DOMDataWriteTransaction tx, final RIBSupport ribSupport,
                 final YangInstanceIdentifier routesPath, final DataTreeCandidateNode route) {
             LOG.debug("Process route {}", route.getIdentifier());
             final YangInstanceIdentifier routeId = ribSupport.routePath(routesPath, route.getIdentifier());
@@ -197,11 +195,11 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
                         // No-op
                         break;
                     case SUBTREE_MODIFIED:
-                        processModifiedRouteTables(child, childIdentifier, tx, ribSupport, EffectiveRibInWriter.this.importPolicy, childPath, childDataAfter);
+                        processModifiedRouteTables(child, childIdentifier, tx, ribSupport, childPath, childDataAfter);
                         break;
                     case APPEARED:
                     case WRITE:
-                        writeRouteTables(child, childIdentifier, tx, ribSupport, EffectiveRibInWriter.this.importPolicy, childPath, childDataAfter);
+                        writeRouteTables(child, childIdentifier, tx, ribSupport, childPath, childDataAfter);
 
                         break;
                     default:
@@ -212,17 +210,19 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
         }
 
         private void processModifiedRouteTables(final DataTreeCandidateNode child, final PathArgument childIdentifier, final DOMDataWriteTransaction tx,
-                final RIBSupport ribSupport, final AbstractImportPolicy policy, final YangInstanceIdentifier childPath, final Optional<NormalizedNode<?, ?>> childDataAfter) {
+                final RIBSupport ribSupport, final YangInstanceIdentifier childPath, final Optional<NormalizedNode<?, ?>> childDataAfter) {
             if (TABLE_ROUTES.equals(childIdentifier)) {
                 for (final DataTreeCandidateNode route : ribSupport.changedRoutes(child)) {
-                    processRoute(tx, ribSupport, policy, childPath, route);
+                    processRoute(tx, ribSupport, childPath, route);
                 }
             } else {
                 tx.put(LogicalDatastoreType.OPERATIONAL, childPath, childDataAfter.get());
             }
         }
 
-        private void writeRouteTables(final DataTreeCandidateNode child, final PathArgument childIdentifier, final DOMDataWriteTransaction tx, final RIBSupport ribSupport, final AbstractImportPolicy policy, final YangInstanceIdentifier childPath, final Optional<NormalizedNode<?, ?>> childDataAfter) {
+        private void writeRouteTables(final DataTreeCandidateNode child, final PathArgument childIdentifier,
+                final DOMDataWriteTransaction tx, final RIBSupport ribSupport,
+                final YangInstanceIdentifier childPath, final Optional<NormalizedNode<?, ?>> childDataAfter) {
             if (TABLE_ROUTES.equals(childIdentifier)) {
                 final Collection<DataTreeCandidateNode> changedRoutes = ribSupport.changedRoutes(child);
                 if (!changedRoutes.isEmpty()) {
@@ -230,7 +230,7 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
                     // Routes are special, as they may end up being filtered. The previous put conveniently
                     // ensured that we have them in at target, so a subsequent delete will not fail :)
                     for (final DataTreeCandidateNode route : changedRoutes) {
-                        processRoute(tx, ribSupport, policy, childPath, route);
+                        processRoute(tx, ribSupport, childPath, route);
                     }
                 }
             }
@@ -361,21 +361,16 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
     }
 
     private final AdjInTracker adjInTracker;
-    private final AbstractImportPolicy importPolicy;
 
     static EffectiveRibInWriter create(@Nonnull final RIB rib,
             @Nonnull final DOMTransactionChain chain,
             @Nonnull final YangInstanceIdentifier peerIId,
-            @Nonnull final ImportPolicyPeerTracker importPolicyPeerTracker,
-            final PeerRole peerRole,
             @Nonnull final Set<TablesKey> tables) {
-        return new EffectiveRibInWriter(rib, chain, peerIId, importPolicyPeerTracker, peerRole, tables);
+        return new EffectiveRibInWriter(rib, chain, peerIId, tables);
     }
 
     private EffectiveRibInWriter(final RIB rib, final DOMTransactionChain chain, final YangInstanceIdentifier peerIId,
-            final ImportPolicyPeerTracker importPolicyPeerTracker, final PeerRole peerRole, @Nonnull final Set<TablesKey> tables) {
-        importPolicyPeerTracker.peerRoleChanged(peerIId, peerRole);
-        this.importPolicy = importPolicyPeerTracker.policyFor(IdentifierUtils.peerId((NodeIdentifierWithPredicates) peerIId.getLastPathArgument()));
+            @Nonnull final Set<TablesKey> tables) {
         this.adjInTracker = new AdjInTracker(rib, chain, peerIId, tables);
     }
 
index 4e50ed1e5006d00e2abefc878920e252dc21ba12..a6ccf8f56bcea837fbd5c58fd380ce9201ff3f88 100644 (file)
@@ -12,7 +12,6 @@ import static java.util.Objects.requireNonNull;
 import java.util.EnumMap;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Optional;
 import java.util.function.BiConsumer;
 import javax.annotation.concurrent.GuardedBy;
 import javax.annotation.concurrent.ThreadSafe;
diff --git a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/FromExternalImportPolicy.java b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/FromExternalImportPolicy.java
deleted file mode 100644 (file)
index d57aa14..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.protocol.bgp.rib.impl;
-
-import org.opendaylight.protocol.bgp.rib.impl.spi.AbstractImportPolicy;
-import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
-
-/**
- * Import policy invoked on routes which we get from outside of our home AS.
- */
-final class FromExternalImportPolicy extends AbstractImportPolicy {
-    @Override
-    public ContainerNode effectiveAttributes(final ContainerNode attributes) {
-        /*
-         * Filter out non-transitive attributes, so they do not cross inter-AS
-         * boundaries.
-         *
-         * FIXME: to be completely flexible, we need to allow for retaining
-         *        the MED attribute. @see https://tools.ietf.org/html/rfc4271#section-5.1.4.
-         */
-        return AttributeOperations.getInstance(attributes).transitiveAttributes(attributes);
-    }
-}
\ No newline at end of file
diff --git a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/FromInternalImportPolicy.java b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/FromInternalImportPolicy.java
deleted file mode 100644 (file)
index a078dac..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.protocol.bgp.rib.impl;
-
-import static java.util.Objects.requireNonNull;
-
-import org.opendaylight.protocol.bgp.rib.impl.spi.AbstractImportPolicy;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.ClusterIdentifier;
-import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
-import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode;
-import org.opendaylight.yangtools.yang.data.api.schema.LeafSetNode;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Invoked on routes which we get from our normal home AS peers.
- */
-class FromInternalImportPolicy extends AbstractImportPolicy {
-    private static final Logger LOG = LoggerFactory.getLogger(FromInternalImportPolicy.class);
-    private final ClusterIdentifier clusterIdentifier;
-    private final Ipv4Address bgpIdentifier;
-
-    FromInternalImportPolicy(final Ipv4Address bgpIdentifier, final ClusterIdentifier clusterIdentifier) {
-        this.bgpIdentifier = requireNonNull(bgpIdentifier);
-        this.clusterIdentifier = requireNonNull(clusterIdentifier);
-    }
-
-    @Override
-    public ContainerNode effectiveAttributes(final ContainerNode attributes) {
-        final AttributeOperations oper = AttributeOperations.getInstance(attributes);
-
-        /*
-         * This is an implementation of https://tools.ietf.org/html/rfc4456#section-8
-         *
-         * We first check the ORIGINATOR_ID, if present. If it matches our BGP identifier,
-         * we filter the route.
-         */
-        final Object originatorId = oper.getOriginatorId(attributes);
-        if (this.bgpIdentifier.getValue().equals(originatorId)) {
-            LOG.debug("Filtering route with our ORIGINATOR_ID {}", this.bgpIdentifier);
-            return null;
-        }
-
-        /*
-         * Second we check CLUSTER_LIST, if present. If it contains our CLUSTER_ID, we issue
-         * a warning and ignore the route.
-         */
-        final LeafSetNode<?> clusterList = oper.getClusterList(attributes);
-        if (clusterList != null) {
-            for (final LeafSetEntryNode<?> node : clusterList.getValue()) {
-                if (this.clusterIdentifier.getValue().equals(node.getValue())) {
-                    LOG.info("Received a route with our CLUSTER_ID {} in CLUSTER_LIST {}, filtering it", this.clusterIdentifier.getValue(), clusterList);
-                    return null;
-                }
-            }
-        }
-
-        return attributes;
-    }
-}
diff --git a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/FromInternalReflectorClientImportPolicy.java b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/FromInternalReflectorClientImportPolicy.java
deleted file mode 100644 (file)
index 7889336..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.protocol.bgp.rib.impl;
-
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.ClusterIdentifier;
-
-/**
- * Invoked on routes which we get from our Internal peers. This is a special-case of
- * FromInternalImportPolicy.
- */
-final class FromInternalReflectorClientImportPolicy extends FromInternalImportPolicy {
-    FromInternalReflectorClientImportPolicy(final Ipv4Address bgpIdentifier, final ClusterIdentifier clusterIdentifier) {
-        super(bgpIdentifier, clusterIdentifier);
-    }
-}
diff --git a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/FromReflectorClientImportPolicy.java b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/FromReflectorClientImportPolicy.java
deleted file mode 100644 (file)
index 29f6673..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.protocol.bgp.rib.impl;
-
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.ClusterIdentifier;
-import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
-
-/**
- * Invoked on routes which we get from our reflector peers. This is a special-case of
- * FromInternalImportPolicy.
- */
-final class FromReflectorClientImportPolicy extends FromInternalImportPolicy {
-    FromReflectorClientImportPolicy(final Ipv4Address bgpIdentifier, final ClusterIdentifier clusterIdentifier) {
-        super(bgpIdentifier, clusterIdentifier);
-    }
-
-    @Override
-    public ContainerNode effectiveAttributes(final ContainerNode attributes) {
-        // TODO: (defensiveness) verify ORIGINATOR_ID (should have been set)
-
-        return super.effectiveAttributes(attributes);
-    }
-}
diff --git a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/ImportPolicyPeerTrackerImpl.java b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/ImportPolicyPeerTrackerImpl.java
deleted file mode 100644 (file)
index 1452696..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.protocol.bgp.rib.impl;
-
-import static java.util.Objects.requireNonNull;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import org.opendaylight.protocol.bgp.rib.impl.spi.AbstractImportPolicy;
-import org.opendaylight.protocol.bgp.rib.impl.spi.ImportPolicyPeerTracker;
-import org.opendaylight.protocol.bgp.rib.spi.IdentifierUtils;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.PeerId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.PeerRole;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-final class ImportPolicyPeerTrackerImpl implements ImportPolicyPeerTracker {
-    private static final Logger LOG = LoggerFactory.getLogger(ImportPolicyPeerTrackerImpl.class);
-
-    private final Map<PeerId, AbstractImportPolicy> policies = new ConcurrentHashMap<>();
-    private final PolicyDatabase policyDatabase;
-
-    protected ImportPolicyPeerTrackerImpl(final PolicyDatabase policyDatabase) {
-        super();
-        this.policyDatabase = requireNonNull(policyDatabase);
-    }
-
-    @Override
-    public void peerRoleChanged(final YangInstanceIdentifier peerPath, final PeerRole role) {
-        final PeerId peer = IdentifierUtils.peerId((NodeIdentifierWithPredicates) peerPath.getLastPathArgument());
-
-        if (role != null) {
-            // Lookup policy based on role
-            final AbstractImportPolicy policy = this.policyDatabase.importPolicyForRole(role);
-
-            // Update lookup map
-            this.policies.put(peer, policy);
-            LOG.debug("Updating policy {} for peer {}", policy, peer);
-        } else {
-            this.policies.remove(peer);
-        }
-    }
-
-    @Override
-    public AbstractImportPolicy policyFor(final PeerId peerId) {
-        LOG.trace("Peer ID : {}", peerId);
-        return this.policies.get(peerId);
-    }
-}
\ No newline at end of file
index 68d64e51df2d31dadae4a8657b024a14a49b5937..8101b17e9e0c9a1d451f788ba4d52fc5624391db 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.protocol.bgp.rib.impl;
 
 import java.util.EnumMap;
 import java.util.Map;
-import org.opendaylight.protocol.bgp.rib.impl.spi.AbstractImportPolicy;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.PeerRole;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.ClusterIdentifier;
@@ -20,33 +19,15 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
  */
 final class PolicyDatabase {
     private final Map<PeerRole, AbstractExportPolicy> exportPolicies = new EnumMap<>(PeerRole.class);
-    private final Map<PeerRole, AbstractImportPolicy> importPolicies = new EnumMap<>(PeerRole.class);
 
     PolicyDatabase(final Long localAs, final Ipv4Address bgpId, final ClusterIdentifier clusterId) {
         this.exportPolicies.put(PeerRole.Ebgp, new ToExternalExportPolicy(localAs));
         this.exportPolicies.put(PeerRole.Ibgp, new ToInternalExportPolicy(bgpId, clusterId));
         this.exportPolicies.put(PeerRole.RrClient, new ToReflectorClientExportPolicy(bgpId, clusterId));
         this.exportPolicies.put(PeerRole.Internal, new ToInternalReflectorClientExportPolicy(bgpId, clusterId));
-
-        this.importPolicies.put(PeerRole.Ebgp, new FromExternalImportPolicy());
-        this.importPolicies.put(PeerRole.Ibgp, new FromInternalImportPolicy(bgpId, clusterId));
-        this.importPolicies.put(PeerRole.RrClient, new FromReflectorClientImportPolicy(bgpId, clusterId));
-        this.importPolicies.put(PeerRole.Internal, new FromInternalReflectorClientImportPolicy(bgpId, clusterId));
     }
 
     AbstractExportPolicy exportPolicyForRole(final PeerRole peerRole) {
         return this.exportPolicies.get(peerRole);
     }
-
-    AbstractImportPolicy importPolicyForRole(final PeerRole peerRole) {
-        /*
-         * TODO: this solution does not share equivalent attributes across
-         *       multiple peers. If we need to do that, consider carefully:
-         *       - whether the interner should be shared with RIBSupportContextImpl.writeRoutes()
-         *       - lookup/update contention of both the cache and the interner
-         *       - ability to share resulting attributes across import policies
-         *       - ability to share resulting attributes with export policies
-         */
-        return new CachingImportPolicy(this.importPolicies.get(peerRole));
-    }
 }
index 038b217f6b37a06773f7d5d677ae69ddb6b2dcf4..5d9427590ad1b420443d89d9e398943b73758f93 100755 (executable)
@@ -41,7 +41,6 @@ import org.opendaylight.protocol.bgp.mode.api.PathSelectionMode;
 import org.opendaylight.protocol.bgp.mode.impl.base.BasePathSelectionModeFactory;
 import org.opendaylight.protocol.bgp.rib.impl.spi.BGPDispatcher;
 import org.opendaylight.protocol.bgp.rib.impl.spi.CodecsRegistry;
-import org.opendaylight.protocol.bgp.rib.impl.spi.ImportPolicyPeerTracker;
 import org.opendaylight.protocol.bgp.rib.impl.spi.RIB;
 import org.opendaylight.protocol.bgp.rib.impl.spi.RIBSupportContext;
 import org.opendaylight.protocol.bgp.rib.impl.spi.RIBSupportContextRegistry;
@@ -107,7 +106,6 @@ public final class RIBImpl extends BGPRIBStateImpl implements RIB, TransactionCh
     private final DOMDataBrokerExtension service;
     private final Map<TransactionChain<?, ?>, LocRibWriter> txChainToLocRibWriter = new HashMap<>();
     private final Map<TablesKey, PathSelectionMode> bestPathSelectionStrategies;
-    private final ImportPolicyPeerTracker importPolicyPeerTracker;
     private final RibId ribId;
     private final BGPPeerTracker peerTracker;
     private final BGPRibRoutingPolicy ribPolicies;
@@ -154,7 +152,6 @@ public final class RIBImpl extends BGPRIBStateImpl implements RIB, TransactionCh
         final ClusterIdentifier cId = clusterId == null ? new ClusterIdentifier(localBgpId) : clusterId;
         this.ribId = ribId;
         final PolicyDatabase policyDatabase = new PolicyDatabase(this.localAs.getValue(), localBgpId, cId);
-        this.importPolicyPeerTracker = new ImportPolicyPeerTrackerImpl(policyDatabase);
 
         final ImmutableMap.Builder<TablesKey, ExportPolicyPeerTracker> exportPolicies = new ImmutableMap.Builder<>();
         for (final BgpTableType t : this.localTables) {
@@ -323,11 +320,6 @@ public final class RIBImpl extends BGPRIBStateImpl implements RIB, TransactionCh
         return this.codecsRegistry;
     }
 
-    @Override
-    public ImportPolicyPeerTracker getImportPolicyPeerTracker() {
-        return this.importPolicyPeerTracker;
-    }
-
     @Override
     public ExportPolicyPeerTracker getExportPolicyPeerTracker(final TablesKey tablesKey) {
         return this.exportPolicyPeerTrackerMap.get(tablesKey);
index fe2bd8aba863141ccec04dbb45e546c899fd3e8d..a794144c61ca74a570d6dd0da32113b908ad072c 100644 (file)
@@ -35,7 +35,6 @@ import org.opendaylight.protocol.bgp.rib.impl.CodecsRegistryImpl;
 import org.opendaylight.protocol.bgp.rib.impl.RIBImpl;
 import org.opendaylight.protocol.bgp.rib.impl.spi.BGPDispatcher;
 import org.opendaylight.protocol.bgp.rib.impl.spi.CodecsRegistry;
-import org.opendaylight.protocol.bgp.rib.impl.spi.ImportPolicyPeerTracker;
 import org.opendaylight.protocol.bgp.rib.impl.spi.RIB;
 import org.opendaylight.protocol.bgp.rib.impl.spi.RIBSupportContextRegistry;
 import org.opendaylight.protocol.bgp.rib.spi.BGPPeerTracker;
@@ -216,11 +215,6 @@ public final class RibImpl implements RIB, BGPRIBStateConsumer, AutoCloseable {
         this.serviceRegistration = serviceRegistration;
     }
 
-    @Override
-    public ImportPolicyPeerTracker getImportPolicyPeerTracker() {
-        return this.ribImpl.getImportPolicyPeerTracker();
-    }
-
     @Override
     public ExportPolicyPeerTracker getExportPolicyPeerTracker(final TablesKey tablesKey) {
         return this.ribImpl.getExportPolicyPeerTracker(tablesKey);
diff --git a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/spi/AbstractImportPolicy.java b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/spi/AbstractImportPolicy.java
deleted file mode 100644 (file)
index 88dc969..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.protocol.bgp.rib.impl.spi;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
-
-/**
- * Defines the internal hooks invoked when a new route appears.
- */
-public abstract class AbstractImportPolicy {
-    /**
-     * Transform incoming attributes according to policy.
-     *
-     * @param attributes received attributes
-     * @return Filtered attributes, or null if the advertisement should be ignored.
-     */
-    @Nullable public abstract ContainerNode effectiveAttributes(@Nonnull ContainerNode attributes);
-}
\ No newline at end of file
diff --git a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/spi/ImportPolicyPeerTracker.java b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/spi/ImportPolicyPeerTracker.java
deleted file mode 100644 (file)
index 2b064e3..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.protocol.bgp.rib.impl.spi;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.PeerId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.PeerRole;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-
-/**
- * Tracks import policy corresponding to a particular peer.
- */
-public interface ImportPolicyPeerTracker {
-
-    /**
-     * Invoked whenever a peer role changes.
-     *
-     * @param peerPath Peer's path
-     * @param role Peer's new role, null indicates the peer has disappeared.
-     */
-    void peerRoleChanged(YangInstanceIdentifier peerPath, PeerRole role);
-
-    AbstractImportPolicy policyFor(PeerId peerId);
-
-}
index 3282d462d1c00728c44743d0bdf473082cf3a825..d73b3dc53f28acb77135ecf51559c1393a7bd6ae 100755 (executable)
@@ -89,8 +89,6 @@ public interface RIB extends AttributeBindingCodecSerializer, RibReference {
      */
     DOMDataTreeChangeService getService();
 
-    ImportPolicyPeerTracker getImportPolicyPeerTracker();
-
     /**
      * Returns ExportPolicyPeerTracker for specific tableKey, where peer can register himself
      * as supporting the table. Same export policy can be used to check which peers support respective
diff --git a/bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/FromExternalImportPolicyTest.java b/bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/FromExternalImportPolicyTest.java
deleted file mode 100644 (file)
index 15b03d6..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.protocol.bgp.rib.impl;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue;
-import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
-import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
-import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode;
-import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
-import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeAttrBuilder;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeSchemaAwareBuilder;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableLeafNodeBuilder;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableLeafSetEntryNodeBuilder;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableLeafSetNodeBuilder;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableUnkeyedListNodeBuilder;
-
-public class FromExternalImportPolicyTest {
-
-    private static final QName DATA_QNAME = QName.create("urn:opendaylight:params:xml:ns:yang:bgp-inet", "2013-09-19", "attributes").intern();
-    private static final QName LOCALPREF = QName.create("urn:opendaylight:params:xml:ns:yang:bgp-inet", "2013-09-19", "local-pref").intern();
-    private static final QName CLUSTERID = QName.create("urn:opendaylight:params:xml:ns:yang:bgp-inet", "2013-09-19", "cluster-id").intern();
-    private static final QName CLUSTER = QName.create("urn:opendaylight:params:xml:ns:yang:bgp-inet", "2013-09-19", "cluster").intern();
-    private static final QName ASPATH = QName.create("urn:opendaylight:params:xml:ns:yang:bgp-inet", "2013-09-19", "as-path").intern();
-    private static final QName SEGMENT = QName.create("urn:opendaylight:params:xml:ns:yang:bgp-inet", "2013-09-19", "segments").intern();
-    private static final QName UNRECOGNIZED = QName.create("urn:opendaylight:params:xml:ns:yang:bgp-inet", "2013-09-19", "unrecognized-attributes");
-    private static final QName NEXTHOP = QName.create("urn:opendaylight:params:xml:ns:yang:bgp-inet", "2013-09-19", "c-next-hop").intern();
-    private static final QName IPV4NH = QName.create("urn:opendaylight:params:xml:ns:yang:bgp-inet", "2013-09-19", "ipv4-next-hop").intern();
-    private static final QName ORIGINATOR = QName.create("urn:opendaylight:params:xml:ns:yang:bgp-inet", "2013-09-19", "originator-id").intern();
-    private static final QName MED = QName.create("urn:opendaylight:params:xml:ns:yang:bgp-inet", "2013-09-19", "multi-exit-disc").intern();
-    private static final QName ORIGIN = QName.create("urn:opendaylight:params:xml:ns:yang:bgp-inet", "2013-09-19", "origin").intern();
-
-    @Test
-    public void testEffectiveAttributes() {
-        DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> dataContBuilder = createContBuilder(DATA_QNAME);
-        // local pref
-        dataContBuilder.addChild(createContBuilder(LOCALPREF).addChild(createValueBuilder(100L, LOCALPREF, "pref").build()).build());
-
-        // cluster pref
-        String s = "404.40.40.40";
-        LeafSetEntryNode<Object> entry1 = ImmutableLeafSetEntryNodeBuilder.create().withNodeIdentifier(
-            new NodeWithValue<>(CLUSTER, s)).withValue(s).build();
-
-        dataContBuilder.addChild(createContBuilder(CLUSTERID).addChild(ImmutableLeafSetNodeBuilder.create().withNodeIdentifier(
-            new NodeIdentifier(QName.create(CLUSTER, "cluster"))).withChild(entry1).build()).build());
-
-        // as-path pref
-        final ContainerNode asPath = createContBuilder(ASPATH).addChild(ImmutableUnkeyedListNodeBuilder.create()
-            .withNodeIdentifier(new NodeIdentifier(SEGMENT)).build()).build();
-        dataContBuilder.addChild(asPath);
-
-        // unrecognized
-        dataContBuilder.addChild(ImmutableNodes.mapNodeBuilder(UNRECOGNIZED).build());
-
-        // c-next-hop pref
-        final DataContainerNodeBuilder<NodeIdentifier, ChoiceNode> nextHop = Builders.choiceBuilder();
-        nextHop.withNodeIdentifier(new NodeIdentifier(NEXTHOP));
-        final ContainerNode cNextHop = createContBuilder(IPV4NH).addChild(createValueBuilder("199.20.160.41", IPV4NH, "global").build()).build();
-        final ChoiceNode resultNextHop = nextHop.addChild(cNextHop).build();
-        dataContBuilder.addChild(resultNextHop);
-
-        // originator pref
-        dataContBuilder.addChild(createContBuilder(ORIGINATOR).addChild(createValueBuilder("41.41.41.41", ORIGINATOR, "originator").build()).build());
-
-        // origin pref
-        final ContainerNode origin = createContBuilder(ORIGIN).addChild(createValueBuilder("igp", ORIGIN, "value").build()).build();
-        dataContBuilder.addChild(origin);
-
-        // multi-exit-disc pref
-        dataContBuilder.addChild(createContBuilder(MED).addChild(createValueBuilder("0", MED, "med").build()).build());
-        FromExternalImportPolicy importPol = new FromExternalImportPolicy();
-        final ContainerNode result = importPol.effectiveAttributes(dataContBuilder.build());
-
-        DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> dataContExpected = createContBuilder(DATA_QNAME);
-
-        dataContExpected.addChild(asPath);
-        dataContExpected.addChild(resultNextHop);
-        dataContExpected.addChild(origin);
-
-        assertEquals(dataContExpected.build(), result);
-    }
-
-    private static DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> createContBuilder(final QName qname) {
-        return ImmutableContainerNodeSchemaAwareBuilder.create().withNodeIdentifier(new NodeIdentifier(qname));
-    }
-
-    private static <T> ImmutableLeafNodeBuilder<T> createValueBuilder(final T value, final QName qname, final String localName) {
-        final ImmutableLeafNodeBuilder<T> valueBuilder = new ImmutableLeafNodeBuilder<>();
-        valueBuilder.withNodeIdentifier(new NodeIdentifier(QName.create(qname, localName))).withValue(value);
-        return valueBuilder;
-    }
-}
index c2695274dc32b27651c076a5b5a78eedaaf92bd7..8d31ce7ca8b74526caa4b37121ff9dc8dedd42ab 100644 (file)
@@ -33,11 +33,9 @@ import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryConsumer
 import org.opendaylight.protocol.bgp.parser.BgpTableTypeImpl;
 import org.opendaylight.protocol.bgp.rib.impl.BGPPeerTrackerImpl;
 import org.opendaylight.protocol.bgp.rib.impl.DefaultRibPoliciesMockTest;
-import org.opendaylight.protocol.bgp.rib.impl.spi.AbstractImportPolicy;
 import org.opendaylight.protocol.bgp.rib.impl.spi.BGPDispatcher;
 import org.opendaylight.protocol.bgp.rib.impl.spi.BGPPeerRegistry;
 import org.opendaylight.protocol.bgp.rib.impl.spi.BGPSessionPreferences;
-import org.opendaylight.protocol.bgp.rib.impl.spi.ImportPolicyPeerTracker;
 import org.opendaylight.protocol.bgp.rib.impl.spi.RIB;
 import org.opendaylight.protocol.bgp.rib.impl.spi.RIBSupportContextRegistry;
 import org.opendaylight.protocol.bgp.rib.spi.BGPPeerTracker;
@@ -85,8 +83,6 @@ class AbstractConfig extends DefaultRibPoliciesMockTest {
     @Mock
     protected DOMDataWriteTransaction domDW;
     @Mock
-    private ImportPolicyPeerTracker importPolicyPeerTracker;
-    @Mock
     private DOMDataTreeChangeService dataTreeChangeService;
     private BGPPeerTracker peerTracker = new BGPPeerTrackerImpl();
 
@@ -98,11 +94,6 @@ class AbstractConfig extends DefaultRibPoliciesMockTest {
                 .getInstanceIdentifier();
         doReturn(this.domTx).when(this.rib).createPeerChain(any(TransactionChainListener.class));
         doReturn(AS).when(this.rib).getLocalAs();
-        doReturn(this.importPolicyPeerTracker).when(this.rib).getImportPolicyPeerTracker();
-        doNothing().when(this.importPolicyPeerTracker)
-                .peerRoleChanged(any(YangInstanceIdentifier.class), any(PeerRole.class));
-        doReturn(mock(AbstractImportPolicy.class))
-                .when(this.importPolicyPeerTracker).policyFor(any(PeerId.class));
         doReturn(mock(RIBSupportContextRegistry.class)).when(this.rib).getRibSupportContext();
         doReturn(Collections.emptySet()).when(this.rib).getLocalTablesKeys();
         doNothing().when(this.domTx).close();
index 500b0eab0c05b1cbbd938eeb4b8ed344622ac037..5d2191b80a0fcd5a42eeee091933f988b1506bd2 100644 (file)
@@ -123,7 +123,6 @@ public class RibImplTest extends AbstractConfig {
         assertEquals("RIBImpl{}", ribImpl.toString());
         assertEquals(Collections.singleton(new TablesKey(Ipv4AddressFamily.class,
                 UnicastSubsequentAddressFamily.class)), ribImpl.getLocalTablesKeys());
-        assertNotNull(ribImpl.getImportPolicyPeerTracker());
         assertNotNull(ribImpl.getService());
         assertNotNull(ribImpl.getInstanceIdentifier());
         assertEquals(AS, ribImpl.getLocalAs());
index 2825c9481c2e71018e8f653390071fd2f77aa6c3..0a72d834cd2a688e3a0d2331c4a18fbde6111a9f 100644 (file)
@@ -62,7 +62,7 @@ public interface PeerTrackerInformation {
      *
      * @return Peer YangInstanceIdentifier
      */
-    @Nullable
+    @Nonnull
     YangInstanceIdentifier getPeerRibInstanceIdentifier();
 
     /**