import com.google.common.base.Preconditions;
final class LinkstateAdjRIBsIn extends AbstractAdjRIBsIn<CLinkstateDestination, LinkstateRoute> {
- private static final Logger LOG = LoggerFactory.getLogger(LinkstateAdjRIBsIn.class);
private abstract static class LinkstateRIBEntryData<A extends LinkStateAttribute> extends
- RIBEntryData<CLinkstateDestination, LinkstateRoute> {
+ RIBEntryData<CLinkstateDestination, LinkstateRoute> {
private final A lsattr;
protected LinkstateRIBEntryData(final PathAttributes attributes, final A lsattr) {
}
}
- LinkstateAdjRIBsIn(final DataModificationTransaction trans, final RibReference rib, final Comparator<PathAttributes> comparator, final TablesKey key) {
+ private static final Logger LOG = LoggerFactory.getLogger(LinkstateAdjRIBsIn.class);
+
+ LinkstateAdjRIBsIn(final DataModificationTransaction trans, final RibReference rib, final Comparator<PathAttributes> comparator,
+ final TablesKey key) {
super(trans, rib, comparator, key);
}
@Override
public void addRoutes(final DataModificationTransaction trans, final Peer peer, final MpReachNlri nlri,
final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.update.PathAttributes attributes) {
+ LOG.debug("Passed nlri {}", nlri);
final LinkstateDestination keys = ((DestinationLinkstateCase) nlri.getAdvertizedRoutes().getDestinationType()).getDestinationLinkstate();
if (keys == null) {
LOG.debug("No destinations present in advertized routes");
}
}
- return b.build();
+ return b.build();
}
@Override
super.remove(trans, peer, key);
}
-}
\ No newline at end of file
+}
import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionConsumerContext;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.PathAttributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.rib.TablesKey;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import com.google.common.base.Preconditions;
final class RIBTables {
+
+ private static final Logger LOG = LoggerFactory.getLogger(RIBTables.class);
+
private final Map<TablesKey, AdjRIBsIn> tables = new HashMap<>();
private final Comparator<PathAttributes> comparator;
private final RIBExtensionConsumerContext registry;
}
public synchronized AdjRIBsIn get(final TablesKey key) {
- return tables.get(key);
+ return this.tables.get(key);
}
public synchronized AdjRIBsIn getOrCreate(final DataModificationTransaction trans, final RibReference rib, final TablesKey key) {
- if (tables.containsKey(key)) {
- return tables.get(key);
+ LOG.debug("Looking for key {} in tables {}", key, this.tables);
+ if (this.tables.containsKey(key)) {
+ LOG.trace("Key found {}.", this.tables.get(key));
+ return this.tables.get(key);
}
- final AdjRIBsInFactory f = registry.getAdjRIBsInFactory(key.getAfi(), key.getSafi());
+ final AdjRIBsInFactory f = this.registry.getAdjRIBsInFactory(key.getAfi(), key.getSafi());
if (f == null) {
+ LOG.debug("RIBsInFactory not found for key {}, returning null", key);
return null;
}
- final AdjRIBsIn table = Preconditions.checkNotNull(f.createAdjRIBsIn(trans, rib, comparator, key));
- tables.put(key, table);
+ final AdjRIBsIn table = Preconditions.checkNotNull(f.createAdjRIBsIn(trans, rib, this.comparator, key));
+ LOG.debug("Table {} created for key {}", table, key);
+ this.tables.put(key, table);
return table;
}
}