users@shoal.java.net

Re: Using the DSC

From: Shreedhar Ganapathy <shreedhar.ganapathy_at_oracle.com>
Date: Thu, 10 Feb 2011 13:57:46 -0800

Hi Thomas
Joe can probably comment further on the problem you are still
experiencing but going back to your original email you'd mentioned
> I'm new to shoal and I would like to use it for sharing state across
> computers in different networks.

I somehow missed reading that last part of the sentence.
My question to you (pending resolution of the single machine use case
with DSC) is, how far are these different networks and are these
networks supportive of multicast traffic between group members for such
things as heartbeats, member discovery etc.
If not, Shoal would probably not address your cross network requirements
at all at this time (we are looking into a non-multicast based
implementation for the next version). Just wanted to get this across
before you spend too much time on a problem that even if solved may not
help you with your ultimate goals.

hth
Shreedhar



On 2/10/11 1:48 PM, Thomas Karolski wrote:
> Looking at the examples, I do it differently.
> First of all, I get the DSC using a call to GMSFactory.getGMSModule
> from a separate thread. On this GMS instance I then retrieve the
> current (and only) Group Handle by calling getGroupHandle - and
> finally on the group handle I directly access the DSC (using
> getDistributedStateCache) and manipulate it (using addToCache).
> I selected arbitrary values for the "componentName" and "memberToken"
> parameters of the addToCache (in my case I used "defaultCache" and
> "defaultMember") - could this be the problem?
>
> Adding ShoalLogger.level = FINER did not seem to produce any useful
> output. See A.log and B.log. The warning about not being able to send
> a message is still there.
>
> On 2/9/11 6:08 PM, Thomas Karolski wrote:
>
> AANLkTi=Zx_XagKDQWOv6i98qoxnzCHWSKsco=bksJXWL_at_mail.gmail.com
> <mailto:bksJXWL_at_mail.gmail.com>" type="cite">
> Hello Joe,
>
>
>
> you were right - using getFromCacheForPattern works.
> Unfortunately I could not get the additional logging (FINER)
> to work. I've tried to add the following to the
> logging.properties file (I've copied over the default
> logging.properties from my lib directory and modified that):
>
>
>
> ShoalLogger = FINER
>
>
> My mistake.
>
> It is ShoalLogger.level=FINER.
>
> AANLkTi=Zx_XagKDQWOv6i98qoxnzCHWSKsco=bksJXWL_at_mail.gmail.com
> <mailto:bksJXWL_at_mail.gmail.com>" type="cite">
>
>
> but that did not seem to change the logging level. Note also,
> that setting the DSC value *after* the group is up, does not
> work either (this is what I have been doing all along).
>
>
> Do I possibly have to state a namespace before the ShoalLogger?
>
>
> Since I am uncertain how you are setting the DSC, it is easiest to
> point you at a working example usage of setting a
> DistributedStateCache value.
>
> Look at method ApplicationServer.addMemberDetails() in Java test
> file
> <workspace>/gms/tests/com/sun/enterprise/ee/cms/tests/ApplicationServer.java.
> This method sets the DSC values.
>
> For extracting the DSC values, see the method
> extractMemberDetails() in GMSClientService.java.
> It only demonstrates getting the member details for the instance
> relating to the notification.
> Here is the getter method from Shoal GMS code that is being called
> to get info from the DSC.
>
> /**
> * returns the details of the member who caused this Signal to
> be generated
> * returns a Map containing key-value pairs constituting data
> pertaining to
> * the member's details
> * @return Map - <Serializable, Serializable>
> */
> public Map<Serializable, Serializable> getMemberDetails ( ) {
> return ctx.getDistributedStateCache()
> .getFromCacheForPattern("MEMBER_DETAILS",
> failedMember );
> }
>
> To run the above test sample yourself, see description on how
> to build and run shoal gms developer tests at following link.
> http://shoal.java.net/HowToBuildSource.html
>
> To set logging to FINER for these tests, edit variable in
> runsimulatecluster.sh
> from
> SHOALGMS_LOG_LEVEL=CONFIG
> to
> SHOALGMS_LOG_LEVEL=FINER
>
> -Joe
>