shoal
  1. shoal
  2. SHOAL-7

DistributedStateCacheImpl should not send messages to members individually

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: GMS
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      7

      Description

      DistributedStateCacheImpl currently interprets sendMessage(List<String>, ....)
      as sending to each member in the list one by one. This does not take advantage
      of Group Comm libs that allow messages to be sent to group or a list of members.
      <code>
      private synchronized void sendMessage ( final List<String> members,
      final DSCMessage msg )
      throws GMSException
      {
      if(members != null && !members.isEmpty()){
      for(String member : members)

      { sendMessage(member, msg); }

      }
      }
      </code>

        Activity

        Hide
        shreedharganapathy added a comment -

        ..

        Show
        shreedharganapathy added a comment - ..
        Hide
        shreedhar_ganapathy added a comment -

        User: shreedhar_ganapathy
        Date: 2007/02/01 19:22:31

        Modified:

        shoal/gms/src/java/com/sun/enterprise/ee/cms/impl/jxta/DistributedStateCacheImpl.java

        Log:
        Fix for Issue # 7
        https://shoal.dev.java.net/issues/show_bug.cgi?id=7
        DSC impl now sends it to all members where appropriate.

        File Changes:

        Directory: /shoal/gms/src/java/com/sun/enterprise/ee/cms/impl/jxta/
        ===================================================================

        File [changed]: DistributedStateCacheImpl.java
        Url:
        https://shoal.dev.java.net/source/browse/shoal/gms/src/java/com/sun/enterprise/ee/cms/impl/jxta/DistributedStateCacheImpl.java?r1=1.3&r2=1.4
        Delta lines: +5 -46
        --------------------
        — DistributedStateCacheImpl.java 19 Jan 2007 01:50:12 -0000 1.3
        +++ DistributedStateCacheImpl.java 2 Feb 2007 03:22:28 -0000 1.4
        @@ -72,7 +72,7 @@
        *

        • @author Shreedhar Ganapathy
        • Date: June 20, 2006
        • * @version $Revision: 1.3 $
          + * @version $Revision: 1.4 $
          */
          public class DistributedStateCacheImpl implements DistributedStateCache { private final ConcurrentHashMap<GMSCacheable, Object> cache = @@ -137,23 +137,6 @@ addToRemoteCache(cKey, state); }
        • public void addToCache(final String componentName,
        • final String memberTokenId,
        • final Serializable key,
        • final byte[] state,
        • final List<String> targetReplicantMembers)
        • throws GMSException { - logger.log(Level.FINER, "Adding to DSC by local Member:" + memberTokenId + - ",Component:" + componentName + ",key:" + key + - ",State:" + state + - ", Replicants:" + targetReplicantMembers.toString()); - final GMSCacheable cKey = createCompositeKey(componentName, - memberTokenId, - key); - addToLocalCache(cKey, state); - addToReplicants(cKey, state, targetReplicantMembers); - addToRemoteCache(cKey, targetReplicantMembers); - }

        public void addToLocalCache(
        final String componentName, final String memberTokenId,
        @@ -182,6 +165,7 @@
        final Object state)

        { cKey = getTrueKey(cKey); cache.put(cKey, state); + printDSCContents(); }

        private void printDSCContents () {
        @@ -215,19 +199,8 @@
        throws GMSException

        { final DSCMessage msg = new DSCMessage(cKey, state, DSCMessage.OPERATION.ADD.toString()); - final List<String> members = getGMSContext().getViewWindow().getAllCurrentMembers(); - - sendMessage(members, msg); - }

        -

        • private void addToReplicants(final GMSCacheable cKey,
        • final Object state,
        • final List<String> targetReplicantMembers)
        • throws GMSException { - final DSCMessage msg = new DSCMessage(cKey, state, - DSCMessage.OPERATION.ADD.toString()); - sendMessage(targetReplicantMembers, msg); + sendMessage(null, msg); }

        /*
        @@ -253,8 +226,7 @@
        cKey = getTrueKey(cKey);
        final DSCMessage msg = new DSCMessage(cKey, null,
        DSCMessage.OPERATION.REMOVE.toString());

        • final List<String> members =
          getGMSContext().getViewWindow().getAllCurrentMembers();
        • sendMessage(members, msg);
          + sendMessage(null, msg);
          }

        /*
        @@ -394,10 +366,7 @@
        final DSCMessage msg = new DSCMessage(cache,
        DSCMessage.OPERATION.ADDALLREMOTE.toString(),
        false);

        • final List<String> members = getGMSContext().getViewWindow()
        • .getAllCurrentMembers();
          -
        • sendMessage(members, msg);
          + sendMessage(null, msg);
          }

        /**
        @@ -459,16 +428,6 @@
        final String componentName, final String memberTokenId,
        final Object key)

        { return new GMSCacheable(componentName, memberTokenId, key); - }

        -

        • private synchronized void sendMessage(final List<String> members,
        • final DSCMessage msg)
        • throws GMSException {
        • if (members != null && !members.isEmpty()) {
        • for (String member : members) { - sendMessage(member, msg); - }
        • }
          }

        private synchronized void sendMessage(final String member,

        Show
        shreedhar_ganapathy added a comment - User: shreedhar_ganapathy Date: 2007/02/01 19:22:31 Modified: shoal/gms/src/java/com/sun/enterprise/ee/cms/impl/jxta/DistributedStateCacheImpl.java Log: Fix for Issue # 7 https://shoal.dev.java.net/issues/show_bug.cgi?id=7 DSC impl now sends it to all members where appropriate. File Changes: Directory: /shoal/gms/src/java/com/sun/enterprise/ee/cms/impl/jxta/ =================================================================== File [changed] : DistributedStateCacheImpl.java Url: https://shoal.dev.java.net/source/browse/shoal/gms/src/java/com/sun/enterprise/ee/cms/impl/jxta/DistributedStateCacheImpl.java?r1=1.3&r2=1.4 Delta lines: +5 -46 -------------------- — DistributedStateCacheImpl.java 19 Jan 2007 01:50:12 -0000 1.3 +++ DistributedStateCacheImpl.java 2 Feb 2007 03:22:28 -0000 1.4 @@ -72,7 +72,7 @@ * @author Shreedhar Ganapathy Date: June 20, 2006 * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ */ public class DistributedStateCacheImpl implements DistributedStateCache { private final ConcurrentHashMap<GMSCacheable, Object> cache = @@ -137,23 +137,6 @@ addToRemoteCache(cKey, state); } public void addToCache(final String componentName, final String memberTokenId, final Serializable key, final byte[] state, final List<String> targetReplicantMembers) throws GMSException { - logger.log(Level.FINER, "Adding to DSC by local Member:" + memberTokenId + - ",Component:" + componentName + ",key:" + key + - ",State:" + state + - ", Replicants:" + targetReplicantMembers.toString()); - final GMSCacheable cKey = createCompositeKey(componentName, - memberTokenId, - key); - addToLocalCache(cKey, state); - addToReplicants(cKey, state, targetReplicantMembers); - addToRemoteCache(cKey, targetReplicantMembers); - } public void addToLocalCache( final String componentName, final String memberTokenId, @@ -182,6 +165,7 @@ final Object state) { cKey = getTrueKey(cKey); cache.put(cKey, state); + printDSCContents(); } private void printDSCContents () { @@ -215,19 +199,8 @@ throws GMSException { final DSCMessage msg = new DSCMessage(cKey, state, DSCMessage.OPERATION.ADD.toString()); - final List<String> members = getGMSContext().getViewWindow().getAllCurrentMembers(); - - sendMessage(members, msg); - } - private void addToReplicants(final GMSCacheable cKey, final Object state, final List<String> targetReplicantMembers) throws GMSException { - final DSCMessage msg = new DSCMessage(cKey, state, - DSCMessage.OPERATION.ADD.toString()); - sendMessage(targetReplicantMembers, msg); + sendMessage(null, msg); } /* @@ -253,8 +226,7 @@ cKey = getTrueKey(cKey); final DSCMessage msg = new DSCMessage(cKey, null, DSCMessage.OPERATION.REMOVE.toString()); final List<String> members = getGMSContext().getViewWindow().getAllCurrentMembers(); sendMessage(members, msg); + sendMessage(null, msg); } /* @@ -394,10 +366,7 @@ final DSCMessage msg = new DSCMessage(cache, DSCMessage.OPERATION.ADDALLREMOTE.toString(), false); final List<String> members = getGMSContext().getViewWindow() .getAllCurrentMembers(); - sendMessage(members, msg); + sendMessage(null, msg); } /** @@ -459,16 +428,6 @@ final String componentName, final String memberTokenId, final Object key) { return new GMSCacheable(componentName, memberTokenId, key); - } - private synchronized void sendMessage(final List<String> members, final DSCMessage msg) throws GMSException { if (members != null && !members.isEmpty()) { for (String member : members) { - sendMessage(member, msg); - } } } private synchronized void sendMessage(final String member,

          People

          • Assignee:
            shreedhar_ganapathy
            Reporter:
            shreedharganapathy
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: