Re: svn commit: r1660266 - in /tomcat/tc8.0.x/trunk: java/org/apache/catalina/tribes/tipis/ReplicatedMap.java webapps/docs/changelog.xml

2015-02-17 Thread Keiichi Fujino
2015-02-17 20:30 GMT+09:00 Konstantin Kolinko knst.koli...@gmail.com:

 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.



Thanks. I will rewrite changelog.



  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=1660266r1=1660265r2=1660266view=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 ReplicatedMapK,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?


Yes, I intended it.

The most general case which this method is invoked is when starting the
ReplicatedMap.
transferState() method has been already invoked before
ReplicatedMap.mapMemberAdded(Member) is invoked.
Because the newly added nodes have received COPY messages, they have the
entry information.
Therefore, it does not need to send a message in mapMemberAdded.

Although this method is also a possibility that will be invoked by
AbstractReplicatedMap.ping, I did it in the same way as the more general
case.



 -
 To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: dev-h...@tomcat.apache.org

 --
 Keiichi.Fujino
  dev-h...@tomcat.apache.org
  dev-h...@tomcat.apache.org



Re: svn commit: r1660266 - in /tomcat/tc8.0.x/trunk: java/org/apache/catalina/tribes/tipis/ReplicatedMap.java webapps/docs/changelog.xml

2015-02-17 Thread Konstantin Kolinko
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=1660266r1=1660265r2=1660266view=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 ReplicatedMapK,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();
 +IteratorMap.EntryK,MapEntryK,V i = 
 innerMap.entrySet().iterator();
 +while (i.hasNext()) {
 +Map.EntryK,MapEntryK,V e = i.next();
 +MapEntryK,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=1660266r1=1660265r2=1660266view=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 codeReplicatedMap/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



svn commit: r1660266 - in /tomcat/tc8.0.x/trunk: java/org/apache/catalina/tribes/tipis/ReplicatedMap.java webapps/docs/changelog.xml

2015-02-16 Thread kfujino
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.

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=1660266r1=1660265r2=1660266view=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 ReplicatedMapK,V extends
 long complete = System.currentTimeMillis() - start;
 if (log.isInfoEnabled()) log.info(Relocation of map entries was 
complete in  + complete +  ms.);
 }
+
+public void mapMemberAdded(Member member) {
+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();
+IteratorMap.EntryK,MapEntryK,V i = 
innerMap.entrySet().iterator();
+while (i.hasNext()) {
+Map.EntryK,MapEntryK,V e = i.next();
+MapEntryK,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=1660266r1=1660265r2=1660266view=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 codeReplicatedMap/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