X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-remoterpc-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fremote%2Frpc%2Fregistry%2Fgossip%2FGossiper.java;h=f6ce5e55f3ee63602fc92529e92d6e93d0ff9bb3;hb=e71922c94cec22e9f37648a2d04bf2eb3274cf2f;hp=a8bc25c40ba14b2ecf8c45926f7871f189dbdafa;hpb=45d3c4d975980774190bf8d640ebc0ca40de0abe;p=controller.git 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 a8bc25c40b..f6ce5e55f3 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 @@ -21,6 +21,7 @@ import akka.dispatch.Mapper; import akka.event.Logging; import akka.event.LoggingAdapter; import akka.pattern.Patterns; +import org.opendaylight.controller.remote.rpc.utils.ActorUtil; import scala.concurrent.Future; import scala.concurrent.duration.FiniteDuration; @@ -105,7 +106,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 + ActorUtil.GOSSIP_TICK_INTERVAL, //interval getSelf(), //target new Messages.GossiperMessages.GossipTick(), //message getContext().dispatcher(), //execution context @@ -227,7 +228,9 @@ public class Gossiper extends UntypedActor { return; final ActorRef sender = getSender(); - Future futureReply = Patterns.ask(getContext().parent(), new GetBucketVersions(), 1000); + Future futureReply = + Patterns.ask(getContext().parent(), new GetBucketVersions(), ActorUtil.ASK_DURATION.toMillis()); + futureReply.map(getMapperToProcessRemoteStatus(sender, status), getContext().dispatcher()); } @@ -267,7 +270,8 @@ public class Gossiper extends UntypedActor { */ void sendGossipTo(final ActorRef remote, final Set
addresses){ - Future futureReply = Patterns.ask(getContext().parent(), new GetBucketsByMembers(addresses), 1000); + Future futureReply = + Patterns.ask(getContext().parent(), new GetBucketsByMembers(addresses), ActorUtil.ASK_DURATION.toMillis()); futureReply.map(getMapperToSendGossip(remote), getContext().dispatcher()); } @@ -279,7 +283,10 @@ public class Gossiper extends UntypedActor { void getLocalStatusAndSendTo(Address remoteActorSystemAddress){ //Get local status from bucket store and send to remote - Future futureReply = Patterns.ask(getContext().parent(), new GetBucketVersions(), 1000); + Future futureReply = + Patterns.ask(getContext().parent(), new GetBucketVersions(), ActorUtil.ASK_DURATION.toMillis()); + + //Find gossiper on remote system ActorSelection remoteRef = getContext().system().actorSelection( remoteActorSystemAddress.toString() + getSelf().path().toStringWithoutAddress());