From b37bcabcb7b8a021b301798bfe97fbdfb192c48e Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 8 Aug 2014 11:51:37 -0700 Subject: [PATCH] Updated RpcRegistry to accept a list of route identifiers while adding or removing routes. Removed few redundant defensive null checks. Change-Id: I24310d2a3871a4bff2afa5a06b3657f4d2709794 Signed-off-by: Abhishek Kumar --- .../remote/rpc/registry/RoutingTable.java | 3 + .../remote/rpc/registry/RpcRegistry.java | 127 +++++++++--------- .../remote/rpc/registry/gossip/Gossiper.java | 60 ++++----- .../remote/rpc/registry/gossip/Messages.java | 12 +- .../remote/rpc/registry/RpcRegistryTest.java | 14 +- .../rpc/registry/gossip/GossiperTest.java | 11 -- 6 files changed, 118 insertions(+), 109 deletions(-) diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/RoutingTable.java b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/RoutingTable.java index c25aa523e2..d99faabfe4 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/RoutingTable.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/RoutingTable.java @@ -53,6 +53,9 @@ public class RoutingTable implements Copier, Serializable { return table.containsKey(routeId); } + public Boolean isEmpty(){ + return table.isEmpty(); + } /// /// Getter, Setters /// diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistry.java b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistry.java index 51609870cc..e2ebcb2b25 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistry.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistry.java @@ -28,9 +28,10 @@ import java.util.Collections; import java.util.List; import java.util.Map; -import static org.opendaylight.controller.remote.rpc.registry.RpcRegistry.Messages.AddOrUpdateRoute; -import static org.opendaylight.controller.remote.rpc.registry.RpcRegistry.Messages.RemoveRoute; +import static org.opendaylight.controller.remote.rpc.registry.RpcRegistry.Messages.AddOrUpdateRoutes; +import static org.opendaylight.controller.remote.rpc.registry.RpcRegistry.Messages.RemoveRoutes; import static org.opendaylight.controller.remote.rpc.registry.RpcRegistry.Messages.SetLocalRouter; +import static org.opendaylight.controller.remote.rpc.registry.RpcRegistry.Messages.FindRouters; import static org.opendaylight.controller.remote.rpc.registry.gossip.Messages.BucketStoreMessages.GetAllBuckets; import static org.opendaylight.controller.remote.rpc.registry.gossip.Messages.BucketStoreMessages.GetAllBucketsReply; import static org.opendaylight.controller.remote.rpc.registry.gossip.Messages.BucketStoreMessages.GetLocalBucket; @@ -39,10 +40,9 @@ import static org.opendaylight.controller.remote.rpc.registry.gossip.Messages.Bu /** * Registry to look up cluster nodes that have registered for a given rpc. - *

+ *

* It uses {@link org.opendaylight.controller.remote.rpc.registry.gossip.BucketStore} to maintain this * cluster wide information. - * */ public class RpcRegistry extends UntypedActor { @@ -76,14 +76,14 @@ public class RpcRegistry extends UntypedActor { if (message instanceof SetLocalRouter) receiveSetLocalRouter((SetLocalRouter) message); - if (message instanceof AddOrUpdateRoute) - receiveAddRoute((AddOrUpdateRoute) message); + if (message instanceof AddOrUpdateRoutes) + receiveAddRoutes((AddOrUpdateRoutes) message); - else if (message instanceof RemoveRoute) - receiveRemoveRoute((RemoveRoute) message); + else if (message instanceof RemoveRoutes) + receiveRemoveRoutes((RemoveRoutes) message); else if (message instanceof Messages.FindRouters) - receiveGetRouter((Messages.FindRouters) message); + receiveGetRouter((FindRouters) message); else unhandled(message); @@ -95,55 +95,40 @@ public class RpcRegistry extends UntypedActor { * @param message contains {@link akka.actor.ActorRef} for rpc broker */ private void receiveSetLocalRouter(SetLocalRouter message) { - if (message == null || message.getRouter() == null) - return;//ignore - localRouter = message.getRouter(); } /** - * //TODO: update this to accept multiple route registration * @param msg */ - private void receiveAddRoute(AddOrUpdateRoute msg) { - if (msg.getRouteIdentifier() == null) - return;//ignore + private void receiveAddRoutes(AddOrUpdateRoutes msg) { Preconditions.checkState(localRouter != null, "Router must be set first"); Future futureReply = Patterns.ask(bucketStore, new GetLocalBucket(), 1000); - futureReply.map(getMapperToAddRoute(msg.getRouteIdentifier()), getContext().dispatcher()); + futureReply.map(getMapperToAddRoutes(msg.getRouteIdentifiers()), getContext().dispatcher()); } /** - * //TODO: update this to accept multiple routes - * @param msg + * @param msg contains list of route ids to remove */ - private void receiveRemoveRoute(RemoveRoute msg) { - if (msg.getRouteIdentifier() == null) - return;//ignore + private void receiveRemoveRoutes(RemoveRoutes msg) { Future futureReply = Patterns.ask(bucketStore, new GetLocalBucket(), 1000); - futureReply.map(getMapperToRemoveRoute(msg.getRouteIdentifier()), getContext().dispatcher()); + futureReply.map(getMapperToRemoveRoutes(msg.getRouteIdentifiers()), getContext().dispatcher()); } /** * Finds routers for the given rpc. + * * @param msg */ - private void receiveGetRouter(Messages.FindRouters msg) { + private void receiveGetRouter(FindRouters msg) { final ActorRef sender = getSender(); - //if empty message, return empty list - if (msg.getRouteIdentifier() == null) { - sender.tell(createEmptyReply(), getSelf()); - return; - } - Future futureReply = Patterns.ask(bucketStore, new GetAllBuckets(), 1000); futureReply.map(getMapperToGetRouter(msg.getRouteIdentifier(), sender), getContext().dispatcher()); - } /** @@ -158,6 +143,7 @@ public class RpcRegistry extends UntypedActor { /** * Helper to create a reply when routers are found for the given rpc + * * @param buckets * @param routeId * @return @@ -165,18 +151,15 @@ public class RpcRegistry extends UntypedActor { private Messages.FindRoutersReply createReplyWithRouters(Map buckets, RpcRouter.RouteIdentifier routeId) { List> routers = new ArrayList<>(); - Option> routerWithUpdateTime = null; for (Bucket bucket : buckets.values()) { RoutingTable table = (RoutingTable) bucket.getData(); - if (table == null) continue; routerWithUpdateTime = table.getRouterFor(routeId); - if (routerWithUpdateTime.isEmpty()) continue; @@ -192,7 +175,7 @@ public class RpcRegistry extends UntypedActor { /// /** - * Receives all buckets returned from bucket store and finds routers for the buckets where given rpc(routeId) is found + * Receives all buckets returned from bucket store and finds routers for the buckets where given rpc(routeId) is found * * @param routeId the rpc * @param sender client who asked to find the routers. @@ -224,10 +207,10 @@ public class RpcRegistry extends UntypedActor { * Receives local bucket from bucket store and updates routing table in it by removing the route. Subsequently, * it updates the local bucket in bucket store. * - * @param routeId rpc to remote + * @param routeIds rpc to remote * @return */ - private Mapper getMapperToRemoveRoute(final RpcRouter.RouteIdentifier routeId) { + private Mapper getMapperToRemoveRoutes(final List> routeIds) { return new Mapper() { @Override public Void apply(Object replyMessage) { @@ -246,8 +229,12 @@ public class RpcRegistry extends UntypedActor { table = new RoutingTable(); table.setRouter(localRouter); - table.removeRoute(routeId); + if (!table.isEmpty()) { + for (RpcRouter.RouteIdentifier routeId : routeIds) { + table.removeRoute(routeId); + } + } bucket.setData(table); UpdateBucket updateBucketMessage = new UpdateBucket(bucket); @@ -262,10 +249,10 @@ public class RpcRegistry extends UntypedActor { * Receives local bucket from bucket store and updates routing table in it by adding the route. Subsequently, * it updates the local bucket in bucket store. * - * @param routeId rpc to add + * @param routeIds rpc to add * @return */ - private Mapper getMapperToAddRoute(final RpcRouter.RouteIdentifier routeId) { + private Mapper getMapperToAddRoutes(final List> routeIds) { return new Mapper() { @Override @@ -285,7 +272,9 @@ public class RpcRegistry extends UntypedActor { table = new RoutingTable(); table.setRouter(localRouter); - table.addRoute(routeId); + for (RpcRouter.RouteIdentifier routeId : routeIds) { + table.addRoute(routeId); + } bucket.setData(table); @@ -305,47 +294,50 @@ public class RpcRegistry extends UntypedActor { public static class ContainsRoute { - final RpcRouter.RouteIdentifier routeIdentifier; + final List> routeIdentifiers; - public ContainsRoute(RpcRouter.RouteIdentifier routeIdentifier) { - Preconditions.checkArgument(routeIdentifier != null); - this.routeIdentifier = routeIdentifier; + public ContainsRoute(List> routeIdentifiers) { + Preconditions.checkArgument(routeIdentifiers != null && + !routeIdentifiers.isEmpty(), + "Route Identifiers must be supplied"); + this.routeIdentifiers = routeIdentifiers; } - public RpcRouter.RouteIdentifier getRouteIdentifier(){ - return this.routeIdentifier; + public List> getRouteIdentifiers() { + return this.routeIdentifiers; } @Override public String toString() { - return this.getClass().getSimpleName() + "{" + - "routeIdentifier=" + routeIdentifier + + return "ContainsRoute{" + + "routeIdentifiers=" + routeIdentifiers + '}'; } } - public static class AddOrUpdateRoute extends ContainsRoute{ + public static class AddOrUpdateRoutes extends ContainsRoute { - public AddOrUpdateRoute(RpcRouter.RouteIdentifier routeIdentifier) { - super(routeIdentifier); + public AddOrUpdateRoutes(List> routeIdentifiers) { + super(routeIdentifiers); } } - public static class RemoveRoute extends ContainsRoute { + public static class RemoveRoutes extends ContainsRoute { - public RemoveRoute(RpcRouter.RouteIdentifier routeIdentifier) { - super(routeIdentifier); + public RemoveRoutes(List> routeIdentifiers) { + super(routeIdentifiers); } } - public static class SetLocalRouter{ + public static class SetLocalRouter { private final ActorRef router; public SetLocalRouter(ActorRef router) { + Preconditions.checkArgument(router != null, "Router must not be null"); this.router = router; } - public ActorRef getRouter(){ + public ActorRef getRouter() { return this.router; } @@ -357,9 +349,23 @@ public class RpcRegistry extends UntypedActor { } } - public static class FindRouters extends ContainsRoute { + public static class FindRouters { + private final RpcRouter.RouteIdentifier routeIdentifier; + public FindRouters(RpcRouter.RouteIdentifier routeIdentifier) { - super(routeIdentifier); + Preconditions.checkArgument(routeIdentifier != null, "Route must not be null"); + this.routeIdentifier = routeIdentifier; + } + + public RpcRouter.RouteIdentifier getRouteIdentifier() { + return routeIdentifier; + } + + @Override + public String toString() { + return "FindRouters{" + + "routeIdentifier=" + routeIdentifier + + '}'; } } @@ -367,10 +373,11 @@ public class RpcRegistry extends UntypedActor { final List> routerWithUpdateTime; public FindRoutersReply(List> routerWithUpdateTime) { + Preconditions.checkArgument(routerWithUpdateTime != null, "List of routers found must not be null"); this.routerWithUpdateTime = routerWithUpdateTime; } - public List> getRouterWithUpdateTime(){ + public List> getRouterWithUpdateTime() { return routerWithUpdateTime; } diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/Gossiper.java b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/Gossiper.java index 0b64136c49..2320789d59 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/Gossiper.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/Gossiper.java @@ -41,15 +41,18 @@ import static org.opendaylight.controller.remote.rpc.registry.gossip.Messages.Go /** * Gossiper that syncs bucket store across nodes in the cluster. - *

- * It keeps a local scheduler that periodically sends Gossip ticks to itself to send bucket store's bucket versions - * to a randomly selected remote gossiper. - *

- * When bucket versions are received from a remote gossiper, it is compared with bucket store's bucket versions. - * Which ever buckets are newer locally, are sent to remote gossiper. If any bucket is older in bucket store, a - * gossip status is sent to remote gossiper so that it can send the newer buckets. - *

- * When a bucket is received from a remote gossiper, its sent to the bucket store for update. + *

+ * It keeps a local scheduler that periodically sends Gossip ticks to + * itself to send bucket store's bucket versions to a randomly selected remote + * gossiper. + *

+ * When bucket versions are received from a remote gossiper, it is compared + * with bucket store's bucket versions. Which ever buckets are newer + * locally, are sent to remote gossiper. If any bucket is older in bucket store, + * a gossip status is sent to remote gossiper so that it can send the newer buckets. + *

+ * When a bucket is received from a remote gossiper, its sent to the bucket store + * for update. * */ @@ -77,7 +80,8 @@ public class Gossiper extends UntypedActor { /** * Helpful for testing - * @param autoStartGossipTicks used for turning off gossip ticks during testing. Gossip tick can be manually sent. + * @param autoStartGossipTicks used for turning off gossip ticks during testing. + * Gossip tick can be manually sent. */ public Gossiper(Boolean autoStartGossipTicks){ this.autoStartGossipTicks = autoStartGossipTicks; @@ -94,7 +98,7 @@ public class Gossiper extends UntypedActor { if (autoStartGossipTicks) { gossipTask = getContext().system().scheduler().schedule( new FiniteDuration(1, TimeUnit.SECONDS), //initial delay - new FiniteDuration(500, TimeUnit.MILLISECONDS), //interval + new FiniteDuration(500, TimeUnit.MILLISECONDS), //interval getSelf(), //target new Messages.GossiperMessages.GossipTick(), //message getContext().dispatcher(), //execution context @@ -211,14 +215,12 @@ public class Gossiper extends UntypedActor { * @param status bucket versions from a remote member */ void receiveGossipStatus(GossipStatus status){ - //Dont want to accept messages from non-members + //Don't accept messages from non-members if (!clusterMembers.contains(status.from())) return; final ActorRef sender = getSender(); - Future futureReply = Patterns.ask(getContext().parent(), new GetBucketVersions(), 1000); - futureReply.map(getMapperToProcessRemoteStatus(sender, status), getContext().dispatcher()); } @@ -231,11 +233,9 @@ public class Gossiper extends UntypedActor { void receiveGossip(GossipEnvelope envelope){ //TODO: Add more validations if (!selfAddress.equals(envelope.to())) { - log.info("Ignoring message intended for someone else. From [{}] to [{}]", envelope.from(), envelope.to()); + log.debug("Ignoring message intended for someone else. From [{}] to [{}]", envelope.from(), envelope.to()); return; } - if (envelope.getBuckets() == null) - return; //nothing to do updateRemoteBuckets(envelope.getBuckets()); @@ -248,11 +248,7 @@ public class Gossiper extends UntypedActor { */ void updateRemoteBuckets(Map buckets) { - if (buckets == null || buckets.isEmpty()) - return; //nothing to merge - UpdateRemoteBuckets updateRemoteBuckets = new UpdateRemoteBuckets(buckets); - getContext().parent().tell(updateRemoteBuckets, getSelf()); } @@ -265,9 +261,7 @@ public class Gossiper extends UntypedActor { void sendGossipTo(final ActorRef remote, final Set
addresses){ Future futureReply = Patterns.ask(getContext().parent(), new GetBucketsByMembers(addresses), 1000); - futureReply.map(getMapperToSendGossip(remote), getContext().dispatcher()); - } /** @@ -279,7 +273,6 @@ public class Gossiper extends UntypedActor { //Get local status from bucket store and send to remote Future futureReply = Patterns.ask(getContext().parent(), new GetBucketVersions(), 1000); - ActorSelection remoteRef = getContext().system().actorSelection( remoteActorSystemAddress.toString() + getSelf().path().toStringWithoutAddress()); @@ -328,14 +321,16 @@ public class Gossiper extends UntypedActor { } /** - * Process bucket versions received from {@link org.opendaylight.controller.remote.rpc.registry.gossip.BucketStore}. + * Process bucket versions received from + * {@link org.opendaylight.controller.remote.rpc.registry.gossip.BucketStore}. * Then this method compares remote bucket versions with local bucket versions. *
    *
  • The buckets that are newer locally, send - * {@link org.opendaylight.controller.remote.rpc.registry.gossip.Messages.GossiperMessages.GossipEnvelope} to remote + * {@link org.opendaylight.controller.remote.rpc.registry.gossip.Messages.GossiperMessages.GossipEnvelope} + * to remote *
  • The buckets that are older locally, send - * {@link org.opendaylight.controller.remote.rpc.registry.gossip.Messages.GossiperMessages.GossipStatus} to remote so that - * remote sends GossipEnvelop. + * {@link org.opendaylight.controller.remote.rpc.registry.gossip.Messages.GossiperMessages.GossipStatus} + * to remote so that remote sends GossipEnvelop. *
* * @param sender the remote member @@ -390,9 +385,10 @@ public class Gossiper extends UntypedActor { } /** - * Processes the message from {@link org.opendaylight.controller.remote.rpc.registry.gossip.BucketStore} that contains - * {@link org.opendaylight.controller.remote.rpc.registry.gossip.Bucket}. These buckets are sent to a remote member encapsulated - * in {@link org.opendaylight.controller.remote.rpc.registry.gossip.Messages.GossiperMessages.GossipEnvelope} + * Processes the message from {@link org.opendaylight.controller.remote.rpc.registry.gossip.BucketStore} + * that contains {@link org.opendaylight.controller.remote.rpc.registry.gossip.Bucket}. + * These buckets are sent to a remote member encapsulated in + * {@link org.opendaylight.controller.remote.rpc.registry.gossip.Messages.GossiperMessages.GossipEnvelope} * * @param sender the remote member that sent * {@link org.opendaylight.controller.remote.rpc.registry.gossip.Messages.GossiperMessages.GossipStatus} @@ -407,7 +403,7 @@ public class Gossiper extends UntypedActor { public Void apply(Object msg) { if (msg instanceof GetBucketsByMembersReply) { Map buckets = ((GetBucketsByMembersReply) msg).getBuckets(); - log.info("Buckets to send from {}: {}", selfAddress, buckets); + log.debug("Buckets to send from {}: {}", selfAddress, buckets); GossipEnvelope envelope = new GossipEnvelope(selfAddress, sender.path().address(), buckets); sender.tell(envelope, getSelf()); } diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/Messages.java b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/Messages.java index 9a247d97c7..bf8b20213b 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/Messages.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/Messages.java @@ -17,6 +17,10 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; +import static org.opendaylight.controller.remote.rpc.registry.gossip.Messages.BucketStoreMessages.ContainsBucketVersions; +import static org.opendaylight.controller.remote.rpc.registry.gossip.Messages.BucketStoreMessages.ContainsBuckets; + + /** * These messages are used by {@link org.opendaylight.controller.remote.rpc.registry.gossip.BucketStore} and * {@link org.opendaylight.controller.remote.rpc.registry.gossip.Gossiper} actors. @@ -107,7 +111,8 @@ public class Messages { Map versions; public ContainsBucketVersions(Map versions) { - Preconditions.checkArgument(versions != null, "versions can not be null"); + Preconditions.checkArgument(versions != null, "versions can not be null or empty"); + this.versions = versions; } @@ -135,7 +140,7 @@ public class Messages { public static final class GossipTick extends Tick {} - public static final class GossipStatus extends BucketStoreMessages.ContainsBucketVersions implements Serializable{ + public static final class GossipStatus extends ContainsBucketVersions implements Serializable{ private Address from; public GossipStatus(Address from, Map versions) { @@ -148,12 +153,13 @@ public class Messages { } } - public static final class GossipEnvelope extends BucketStoreMessages.ContainsBuckets implements Serializable { + public static final class GossipEnvelope extends ContainsBuckets implements Serializable { private final Address from; private final Address to; public GossipEnvelope(Address from, Address to, Map buckets) { super(buckets); + Preconditions.checkArgument(to != null, "Recipient of message must not be null"); this.to = to; this.from = from; } diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistryTest.java b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistryTest.java index ab609413dd..284789cc57 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistryTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistryTest.java @@ -24,10 +24,11 @@ import scala.concurrent.duration.FiniteDuration; import java.net.URI; import java.net.URISyntaxException; +import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; -import static org.opendaylight.controller.remote.rpc.registry.RpcRegistry.Messages.AddOrUpdateRoute; +import static org.opendaylight.controller.remote.rpc.registry.RpcRegistry.Messages.AddOrUpdateRoutes; import static org.opendaylight.controller.remote.rpc.registry.RpcRegistry.Messages.FindRouters; import static org.opendaylight.controller.remote.rpc.registry.RpcRegistry.Messages.FindRoutersReply; import static org.opendaylight.controller.remote.rpc.registry.RpcRegistry.Messages.SetLocalRouter; @@ -237,8 +238,15 @@ public class RpcRegistryTest { return resolved; } - private AddOrUpdateRoute getAddRouteMessage() throws URISyntaxException { - return new AddOrUpdateRoute(createRouteId()); + private AddOrUpdateRoutes getAddRouteMessage() throws URISyntaxException { + return new AddOrUpdateRoutes(createRouteIds()); + } + + private List> createRouteIds() throws URISyntaxException { + QName type = new QName(new URI("/mockrpc"), "mockrpc"); + List> routeIds = new ArrayList<>(); + routeIds.add(new RouteIdentifierImpl(null, type, null)); + return routeIds; } private RpcRouter.RouteIdentifier createRouteId() throws URISyntaxException { diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/gossip/GossiperTest.java b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/gossip/GossiperTest.java index d862dcb8cd..f076c136fe 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/gossip/GossiperTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/gossip/GossiperTest.java @@ -115,17 +115,6 @@ public class GossiperTest { verify(mockGossiper, times(0)).updateRemoteBuckets(anyMap()); } - @Test - public void testUpdateRemoteBuckets_WhenNoBucketShouldIgnore(){ - - mockGossiper.updateRemoteBuckets(null); - verify(mockGossiper, times(0)).getContext(); - - Map empty = Collections.emptyMap(); - mockGossiper.updateRemoteBuckets(empty); - verify(mockGossiper, times(0)).getContext(); - } - /** * Create Gossiper actor and return the underlying instance of Gossiper class. * -- 2.36.6