Skip to content

Instantly share code, notes, and snippets.

@Swarnim-singhal
Last active September 2, 2020 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Swarnim-singhal/5cd354492dd643ac6d267b37bebb0aa4 to your computer and use it in GitHub Desktop.
Save Swarnim-singhal/5cd354492dd643ac6d267b37bebb0aa4 to your computer and use it in GitHub Desktop.
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