From 0003ea3ae182807e591869d0d1af3cf903ad25cc Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Thu, 17 Sep 2015 04:41:28 +0200 Subject: [PATCH] BUG-2399: handle new ModificationTypes The set of possible modification types has expanded with automatic structural container lifecycle. Account for the new types in our switch statements. Change-Id: I7e6a78acfb87c9f5916ec83e7f10b9e271c24093 Signed-off-by: Robert Varga --- .../protocol/bgp/rib/impl/AdjRibOutListener.java | 2 ++ .../protocol/bgp/rib/impl/EffectiveRibInWriter.java | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AdjRibOutListener.java b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AdjRibOutListener.java index d1fcc0ba0e..c1b57205c6 100644 --- a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AdjRibOutListener.java +++ b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AdjRibOutListener.java @@ -90,9 +90,11 @@ final class AdjRibOutListener implements DOMDataTreeChangeListener { LOG.debug("Skipping unmodified route {}", route.getIdentifier()); continue; case DELETE: + case DISAPPEARED: // FIXME: we can batch deletions into a single batch update = withdraw((MapEntryNode) route.getDataBefore().get()); break; + case APPEARED: case SUBTREE_MODIFIED: case WRITE: update = advertise((MapEntryNode) route.getDataAfter().get()); diff --git a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/EffectiveRibInWriter.java b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/EffectiveRibInWriter.java index dfaaeea77f..ae0df9c5ff 100644 --- a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/EffectiveRibInWriter.java +++ b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/EffectiveRibInWriter.java @@ -84,11 +84,13 @@ final class EffectiveRibInWriter implements AutoCloseable { final YangInstanceIdentifier routeId = ribSupport.routePath(routesPath, route.getIdentifier()); switch (route.getModificationType()) { case DELETE: + case DISAPPEARED: tx.delete(LogicalDatastoreType.OPERATIONAL, routeId); break; case UNMODIFIED: // No-op break; + case APPEARED: case SUBTREE_MODIFIED: case WRITE: tx.put(LogicalDatastoreType.OPERATIONAL, routeId, route.getDataAfter().get()); @@ -125,6 +127,7 @@ final class EffectiveRibInWriter implements AutoCloseable { final YangInstanceIdentifier childPath = tablePath.node(child.getIdentifier()); switch (child.getModificationType()) { case DELETE: + case DISAPPEARED: tx.delete(LogicalDatastoreType.OPERATIONAL, tablePath.node(child.getIdentifier())); break; case UNMODIFIED: @@ -139,6 +142,7 @@ final class EffectiveRibInWriter implements AutoCloseable { tx.put(LogicalDatastoreType.OPERATIONAL, childPath, child.getDataAfter().get()); } break; + case APPEARED: case WRITE: tx.put(LogicalDatastoreType.OPERATIONAL, childPath, child.getDataAfter().get()); // Routes are special, as they may end up being filtered. The previous put conveniently @@ -232,6 +236,7 @@ final class EffectiveRibInWriter implements AutoCloseable { switch (root.getModificationType()) { case DELETE: + case DISAPPEARED: // delete the corresponding effective table tx.delete(LogicalDatastoreType.OPERATIONAL, effectiveTablePath(peerKey, tableKey)); break; @@ -241,6 +246,7 @@ final class EffectiveRibInWriter implements AutoCloseable { case UNMODIFIED: LOG.info("Ignoring spurious notification on {} data {}", rootPath, table); break; + case APPEARED: case WRITE: writeTable(tx, peerKey, tableKey, table); break; -- 2.36.6