[
https://issues.apache.org/jira/browse/GOSSIP-41?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16137783#comment-16137783
]
ASF GitHub Bot commented on GOSSIP-41:
--------------------------------------
Github user edwardcapriolo commented on a diff in the pull request:
https://github.com/apache/incubator-gossip/pull/68#discussion_r134644941
--- Diff:
gossip-base/src/main/java/org/apache/gossip/manager/AbstractActiveGossiper.java
---
@@ -84,22 +84,33 @@ public final void sendSharedData(LocalMember me,
LocalMember member){
return;
}
long startTime = System.currentTimeMillis();
+
+ UdpSharedDataMessage udpMessage = new UdpSharedDataMessage();
+ udpMessage.setUuid(UUID.randomUUID().toString());
+ udpMessage.setUriFrom(me.getId());
+
for (Entry<String, SharedDataMessage> innerEntry :
gossipCore.getSharedData().entrySet()){
if (innerEntry.getValue().getReplicable() != null &&
!innerEntry.getValue().getReplicable()
.shouldReplicate(me, member, innerEntry.getValue())) {
continue;
}
- UdpSharedDataMessage message = new UdpSharedDataMessage();
- message.setUuid(UUID.randomUUID().toString());
- message.setUriFrom(me.getId());
+ SharedDataMessage message = new SharedDataMessage();
message.setExpireAt(innerEntry.getValue().getExpireAt());
message.setKey(innerEntry.getValue().getKey());
message.setNodeId(innerEntry.getValue().getNodeId());
message.setTimestamp(innerEntry.getValue().getTimestamp());
message.setPayload(innerEntry.getValue().getPayload());
message.setReplicable(innerEntry.getValue().getReplicable());
- gossipCore.sendOneWay(message, member.getUri());
+ udpMessage.addMessage(message);
+ if (udpMessage.getMessages().size() == 100) {
--- End diff --
Use the same variable to control this.
> Transfer gossip data in bulk
> ----------------------------
>
> Key: GOSSIP-41
> URL: https://issues.apache.org/jira/browse/GOSSIP-41
> Project: Gossip
> Issue Type: Improvement
> Reporter: Edward Capriolo
> Assignee: Pooya Salehi
>
> Currently the process that transfers shared data and per node data iterates a
> map transmitting a single datum at a time using one way communication. We
> could transmit more key values at once by simply saying if keys < 100
> transfer all at once, or by collecting keys and sending in groups of 100.
> This would greatly lower chatter communicating data.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)