[infinispan-dev] Comments on tutorials etc.

Galder Zamarreño galder at redhat.com
Tue Jan 25 08:03:27 EST 2011


On Jan 25, 2011, at 12:33 PM, Pete Muir wrote:

> 
> On 25 Jan 2011, at 11:09, Galder Zamarreño wrote:
> 
>> Rather than sleeping which is a bit rudimentary and might hide problems (even after 10 seconds the cluster might not be formed due to env issues), you could wait until the view contains 2 nodes. IIRC, code that this can be found in the testsuite and radargun too. I think radargun might be a better example since different cache managers run in diff processes, whereas in the testsuite they run in same process. So, the methods, IIRC, are a bit different.
> 
> Ok, I will look at that.
> 
>> Btw, interesting concept the one of using dependency:copy-dependencies, I hadn't realised of its potential. What do you use -DstripVersion for? To remove version from dependencies being copied?
> 
> Yes, it means you just end up with e.g. target/dependency/infinispan-core.jar -- actually probably not really needed in this case, originally I was building the classpath from jar files, and not with a wildcard.

That's what I thought :) - with the wildcard you don't care whether version numbers are there.

> 
>> 
>> On Jan 24, 2011, at 8:29 PM, Pete Muir wrote:
>> 
>>> Galder and I have applied all these changes. I added http://community.jboss.org/wiki/SettingupanInfinispanCluster#43_A_complete_example to handle (15). Would appreciate review by a more experienced person to make sure I have got it right!
>>> 
>>> Pete
>>> 
>>> On 18 Jan 2011, at 17:51, Manik Surtani wrote:
>>> 
>>>> Great feedback, Pete.  +1 to all suggestions here, I've added a few more notes inline with some of the points below.  Feel like making the changes you've suggested?
>>>> 
>>>> Galder, could you pls help with the Scala-related points?
>>>> 
>>>> Cheers
>>>> Manik
>>>> 
>>>> 
>>>> On 18 Jan 2011, at 16:17, Pete Muir wrote:
>>>> 
>>>>> As part of getting up to speed with infinispan, I've been running through the docs and tutorials. Some thoughts
>>>>> 
>>>>> 1) http://www.jboss.org/infinispan/downloads.html
>>>> 
>>>> +1, along with links to the Infinispan Maven wiki pages for more detailed info.  But definitely +1 for a quick-access copy-and-paste snippet.
>>>> 
>>>>> 2) http://www.jboss.org/infinispan/downloads.html
>>>>> 
>>>>> Suggest adding two code snippet for the dependency too:
>>>> 
>>>> +1 again.  This info is already up there, but +1 for easy to copy snippets.
>>>> 
>>>>> 3) http://community.jboss.org/wiki/5minutetutorialonInfinispan
>>>>> 
>>>>> Cache cache = manager.getCache();
>>>> 
>>>> There were issues with angle brackets on the wiki system, this may have been fixed now.  
>>>>> 
>>>>> 4) http://community.jboss.org/wiki/5minutetutorialonInfinispan
>>>>> 
>>>>> To make this totally fool proof, might want to indicate how people can run this, e.g. in a main method on a class. This also really highlights how "lightweight" this stuff is (no need for a big server etc.)
>>>> 
>>>>> 5) http://community.jboss.org/wiki/5minutetutorialonInfinispan
>>>>> 
>>>>> For the expiration, might want to adjust the values a bit. 60s is a long time to wait, and also setting the expiration to 60s, and the thread sleep to 60s is risking the assertion failing (it did for me). I would suggest something more like 5s expiration, 10s sleep.
>>>>> 
>>>>> 6) http://community.jboss.org/wiki/InstallingInfinispantutorialenvironment
>>>>> 
>>>>> This information is really useful, and I would suggest splitting out the groovy bit and then adding a link from the 5 min tutoiral
>>>>> 
>>>>> 7) http://community.jboss.org/wiki/InstallingInfinispantutorialenvironment
>>>>> 
>>>>> Some of the instructions on this page could be clearer if they all built as code blocks. For example, following the groovy ones, I struggled reading the first paragraph, it would have been helpful to split this up and provide code snippets to use like:
>>>>> 
>>>>> $> cp $INFINISPAN_HOME/infinispan-core.jar ~/.groovy/lib/
>>>>> 
>>>>> etc.
>>>>> 
>>>>> 8) http://community.jboss.org/wiki/InstallingInfinispantutorialenvironment
>>>>> 
>>>>> The location of infinispan-core jars and dependencies has changed from $INFNISPAN_HOME/modules/core to $INIFINISPAN_HOME, the tutorial needs updating
>>>>> 
>>>>> 9) http://community.jboss.org/wiki/Infinispaninteractivetutorial
>>>>> 
>>>>> When doing the below line, I get an error:
>>>>> 
>>>>> And now, create a cache manager indicating the file with the cache definitions.
>>>>> groovy:000> manager = new DefaultCacheManager("sample-configurations.xml"
>>>>> )
>>>>> ===> org.infinispan.manager.DefaultCacheManager at 19cc1b@Address:
>>>>> null
>>>>> 
>>>>> oovy:000> manager = new DefaultCacheManager("/Users/pmuir/Downloads/sample-configurations.xml")
>>>>> ERROR java.io.IOException:
>>>>> null
>>>>>     at org.infinispan.config.InfinispanConfiguration.newInfinispanConfiguration (InfinispanConfiguration.java:264)
>>>>>     at org.infinispan.config.InfinispanConfiguration.newInfinispanConfiguration (InfinispanConfiguration.java:282)
>>>>>     at org.infinispan.config.InfinispanConfiguration.newInfinispanConfiguration (InfinispanConfiguration.java:136)
>>>>>     at org.infinispan.manager.DefaultCacheManager.<init> (DefaultCacheManager.java:243)
>>>>>     at org.infinispan.manager.DefaultCacheManager.<init> (DefaultCacheManager.java:229)
>>>>>     at groovysh_evaluate.run (groovysh_evaluate:4)
>>>>> 
>>>>> and I don't know how to get past it, so I stopped this tutorial here.
>>>> 
>>>> Hmm, could be a missing schema?  Did you enable log4j TRACE level logging to see what was going on?
>>>> 
>>>>> 10) http://community.jboss.org/wiki/InfinispanInteractiveTutorialwithScala
>>>>> 
>>>>> Could do with some comments explaining what each line is doing, some of the code isn't self describing
>>>>> 
>>>>> e.g.
>>>>> 
>>>>> what does me entering val defaultCache = manager.getCache[String, String]() actually achieve?
>>>>> 
>>>> 
>>>> Galder, care to look into this one?
>>>> 
>>>>> 11) http://community.jboss.org/wiki/InfinispanInteractiveTutorialwithScala
>>>>> 
>>>>> It might be neat to split up input and output e.g. into different snippets - make it easier to read
>>>>> 
>>>>> 12) http://community.jboss.org/wiki/InfinispanInteractiveTutorialwithScala
>>>>> 
>>>>> For "Cache with Transaction Management" I was not seeing TX semantics being obeyed, I saw the size increment as a added key-value pairs
>>>> 
>>>> Galder, this as well?
>>>> 
>>>>> 13) http://community.jboss.org/wiki/SettingupanInfinispanCluster
>>>>> 
>>>>> When I do gc.setTransportClass(JGroupsTransport.class.getName()); and import JGroupsTransport I get two options, one from Infinispan and one from JGroups, tutorial should saw which to import.
>>>> 
>>>> It should be the Infinispan one - the fully qualified classname can be seen in the next XML snippet.  Maybe the Java snippet should use the fqcn as well.
>>>> 
>>>> 
>>>>> 14) http://community.jboss.org/wiki/SettingupanInfinispanCluster
>>>>> 
>>>>> The CacheManager is deprecated, I guess these needs updating to 4.2 API?
>>>> 
>>>> Yes.
>>>> 
>>>>> 
>>>>> 15) http://community.jboss.org/wiki/SettingupanInfinispanCluster
>>>>> 
>>>>> I would suggest adding some instructions about how to do a simple test to see the cluster working, atm the tutorial seems to end in middle of something. There are hints in the comment, but nothing concrete
>>>> 
>>>> Perhaps starting 2 nodes using main() methods, in different terminals, and reverting back to the 5-min tutorial trying stuff on alternate instances?
>>>> 
>>>> Cheers
>>>> Manik
>>>> --
>>>> Manik Surtani
>>>> manik at jboss.org
>>>> twitter.com/maniksurtani
>>>> 
>>>> Lead, Infinispan
>>>> http://www.infinispan.org
>>>> 
>>>> 
>>>> 
>>>> _______________________________________________
>>>> infinispan-dev mailing list
>>>> infinispan-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>>> 
>>> 
>>> _______________________________________________
>>> infinispan-dev mailing list
>>> infinispan-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>> 
>> --
>> Galder Zamarreño
>> Sr. Software Engineer
>> Infinispan, JBoss Cache
>> 
>> 
>> _______________________________________________
>> infinispan-dev mailing list
>> infinispan-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
> 
> 
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache




More information about the infinispan-dev mailing list