2015-02-17 5:20 GMT+03:00 <kfuj...@apache.org>: > Author: kfujino > Date: Tue Feb 17 02:20:11 2015 > New Revision: 1660266 > > URL: http://svn.apache.org/r1660266 > Log: > Make sure that add to the backup node of the map entry when map member has > been added to ReplicatedMap.
It is hard to read the above phrase. I guess that it means the following: "When a map member has been added to ReplicatedMap, make sure to add it to backup nodes list of all other members." > Modified: > > tomcat/tc8.0.x/trunk/java/org/apache/catalina/tribes/tipis/ReplicatedMap.java > tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml > > Modified: > tomcat/tc8.0.x/trunk/java/org/apache/catalina/tribes/tipis/ReplicatedMap.java > URL: > http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/tribes/tipis/ReplicatedMap.java?rev=1660266&r1=1660265&r2=1660266&view=diff > ============================================================================== > --- > tomcat/tc8.0.x/trunk/java/org/apache/catalina/tribes/tipis/ReplicatedMap.java > (original) > +++ > tomcat/tc8.0.x/trunk/java/org/apache/catalina/tribes/tipis/ReplicatedMap.java > Tue Feb 17 02:20:11 2015 > @@ -203,4 +203,29 @@ public class ReplicatedMap<K,V> extends > long complete = System.currentTimeMillis() - start; > if (log.isInfoEnabled()) log.info("Relocation of map entries was > complete in " + complete + " ms."); > } > + @Override > + public void mapMemberAdded(Member member) { This overrides the same method in AbstractReplicatedMap - AbstractReplicatedMap.mapMemberAdded(). The AbstractReplicatedMap.mapMemberAdded() method calls "publishEntryInfo(entry.getKey(), entry.getValue());". The publishEntryInfo() method sends a message to other nodes of the cluster. The new code in ReplicatedMap.mapMemberAdded() does not call "publishEntryInfo" and does not send that message. Is it intended? > + if ( member.equals(getChannel().getLocalMember(false)) ) return; > + boolean memberAdded = false; > + synchronized (mapMembers) { > + if (!mapMembers.containsKey(member) ) { > + mapMembers.put(member, new Long(System.currentTimeMillis())); > + memberAdded = true; > + } > + } > + if ( memberAdded ) { > + synchronized (stateMutex) { > + Member[] backup = getMapMembers(); > + Iterator<Map.Entry<K,MapEntry<K,V>>> i = > innerMap.entrySet().iterator(); > + while (i.hasNext()) { > + Map.Entry<K,MapEntry<K,V>> e = i.next(); > + MapEntry<K,V> entry = innerMap.get(e.getKey()); > + if ( entry == null ) continue; > + if (entry.isPrimary() && > !inSet(member,entry.getBackupNodes())) { > + entry.setBackupNodes(backup); > + } > + } > + } > + } > + } > } > \ No newline at end of file > > Modified: tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml > URL: > http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml?rev=1660266&r1=1660265&r2=1660266&view=diff > ============================================================================== > --- tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml (original) > +++ tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml Tue Feb 17 02:20:11 2015 > @@ -55,6 +55,14 @@ > </fix> > </changelog> > </subsection> > + <subsection name="Tribes"> > + <changelog> > + <fix> > + Make sure that add to the backup node of the map entry when map > member > + has been added to <code>ReplicatedMap</code>. (kfujino) > + </fix> > + </changelog> > + </subsection> > </section> > <section name="Tomcat 8.0.20 (markt)" rtext="voting in progress"> > <subsection name="Coyote"> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org