[ 
https://issues.apache.org/jira/browse/GOSSIP-88?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16057741#comment-16057741
 ] 

Edward Capriolo commented on GOSSIP-88:
---------------------------------------

These are our notes from the conversation we had 


Note:
https://github.com/apache/incubator-gossip/blob/master/gossip-base/src/main/java/org/apache/gossip/manager/AbstractActiveGossiper.java#L72

https://github.com/apache/incubator-gossip/blob/master/gossip-base/src/main/java/org/apache/gossip/manager/AbstractActiveGossiper.java#L87

https://github.com/apache/incubator-gossip/blob/master/gossip-base/src/main/java/org/apache/gossip/model/SharedDataMessage.java

A role of the ActiveGossiper is to periodically sweep through data and 
re-transmit it. What we need is an interface that will be a member of 
SharedDataMessage and PerNodeMessage.




public interface Replicatable {
   boolean shouldRepicated(LocalMember me, LocalMember destination, 
SharedDataMessage) 
}

public class NotReplicatable implements Replicatable {
  boolean shouldRepicated(LocalMember me, LocalMember destination,   
SharedDataMessage) {
  return false
  }
}

public class OnlySameDcReplicatable implements Replicatable {
    boolean shouldRepicated(LocalMember me, LocalMember destination,   
SharedDataMessage) {
     return me.getProperties().equals(destination.getProperties())
  }
}


When someone creates a SharedDataMessage this would be set as a required 
property.

So the loop changes to:

for (Entry<String, SharedDataMessage> innerEntry : 
gossipCore.getSharedData().entrySet()){

  if (!innerEntry.getReplication.shouldReplicate(me, other, innerEntry){
    continue;
  }


[~mirage20] what do you think of this design?

> Data Replication Control
> ------------------------
>
>                 Key: GOSSIP-88
>                 URL: https://issues.apache.org/jira/browse/GOSSIP-88
>             Project: Gossip
>          Issue Type: New Feature
>            Reporter: Mirage Abeysekara
>            Assignee: Mirage Abeysekara
>              Labels: gsoc2017
>
> Currently shared data and per node data get replicated on all nodes. It is 
> better to have data replication control with following requirements
> * Data should never get replicated
> * Data should only get replicated on given set of nodes
> * Data should only replicated on its Datacenter
> In implementation the AbstractActiveGossiper is currently sending its shared 
> data and per node data to a randomly selected live member. To control this 
> replication we add a new property to the message (eg: SharedDataMessage  has 
> a property which says whether this datum need to be replicated or not with a 
> given member.) and use that property in the AbstractActiveGossiper when 
> sending data to a member.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to