Last active
September 2, 2020 14:03
-
-
Save Swarnim-singhal/5cd354492dd643ac6d267b37bebb0aa4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GossipDigestSynVerbHandler extends GossipVerbHandler<GossipDigestSyn> { | |
public static final GossipDigestSynVerbHandler instance = new GossipDigestSynVerbHandler(); | |
public void doVerb(Message<GossipDigestSyn> message) { | |
InetAddressAndPort from = message.from(); | |
GossipDigestSyn gDigestMessage = message.payload; | |
List<GossipDigest> gDigestList = gDigestMessage.getGossipDigests(); | |
List<GossipDigest> deltaGossipDigestList = new ArrayList<GossipDigest>(); | |
Map<InetAddressAndPort, EndpointState> deltaEpStateMap = new HashMap<InetAddressAndPort, EndpointState>(); | |
Gossiper.instance.examineGossiper(gDigestList, deltaGossipDigestList, deltaEpStateMap); | |
// construct and send the GOSSIP_DIGEST_ACK msg | |
Message<GossipDigestAck> gDigestAckMessage = Message.out(GOSSIP_DIGEST_ACK, new GossipDigestAck(deltaGossipDigestList, deltaEpStateMap)); | |
MessagingService.instance().send(gDigestAckMessage, from); | |
super.doVerb(message); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment