Hi David

I know you (and have even met you on the phone).
These two blogs are good places to start. Let me know if you need more info!

http://dsoguy.blogspot.com/2010/04/countdown-to-terracotta-toolkit-beta.html

http://dsoguy.blogspot.com/2010/05/couple-minutes-with-terracotta-toolkit.html

We look forward to you getting involved as your time allows.

Cheers,
Steve

On May 18, 2010, at 3:11 PM, David Hooker wrote:

> Is there a page somewhere which describes the Toolkit and what it provides?  
> So far, I haven't had time to pay much attention to what's going on with it, 
> but these slides and examples whet my appetite.  I'm a paying TC FX customer; 
> we use TC to build our transaction processing platform and having a good API 
> to the clustering environment and resources looks like a cleaner approach 
> than the one we have to use right now.
> 
> Once I have time to actually work on it (next month) I'll be glad to provide 
> feedback on what I'd like to see and use.
> 
> On Tue, 2010-05-18 at 09:28 -0700, Steve Harris wrote:
>> 
>> Much more information to come but...
>> 
>> 
>> Slides can be viewed and downloaded:
>> 
>> 
>> http://public.iwork.com/document/?a=p198608280&d=Toolkit_presentation.key
>> 
>> 
>> 
>> 
>> Code from the samples:
>> 
>> 
>> -------
>> import java.util.concurrent.BlockingQueue;
>> 
>> 
>> import org.terracotta.api.ClusteringProvider;
>> import org.terracotta.api.StandaloneClusteringProvider;
>> import org.terracotta.collections.TerracottaMap;
>> import org.terracotta.coordination.Barrier;
>> 
>> 
>> /**
>>  * Simple example of using a blocking queue in a cluster
>>  * 
>>  * @author steve
>>  * 
>>  */
>> public class PlayingWithExpressQueue {
>> public static void main(String[] args) throws Exception {
>> ClusteringProvider clustering = new StandaloneClusteringProvider(
>> "localhost:9510");
>> 
>> 
>> Barrier barrier = clustering.getBarrier("queueBarrier", 2);
>> 
>> 
>> BlockingQueue<String> expressQueue = clustering
>> .getBlockingQueue("myQueue");
>> 
>> 
>> TerracottaMap<String, BlockingQueue> map = clustering.getMap("myMap");
>> boolean putter = map.put("myQueue", expressQueue) == null;
>> System.out.println("waiting");
>> barrier.await();
>> 
>> 
>> BlockingQueue bq = map.get("myQueue");
>> 
>> 
>> if (putter) {
>> bq.put("Hello Steve");
>> }
>> if (!putter) {
>> System.out.println("Got: " + bq.take() + " putter: " + putter);
>> } else {
>> System.out.println("Not the taker");
>> }
>> }
>> }
>> 
>> 
>> 
>> 
>> -----
>> 
>> 
>> import java.util.Set;
>> import java.util.concurrent.TimeUnit;
>> 
>> 
>> import org.terracotta.api.ClusteringProvider;
>> import org.terracotta.api.StandaloneClusteringProvider;
>> import org.terracotta.collections.TerracottaMap;
>> import org.terracotta.coordination.Barrier;
>> import org.terracotta.locking.ReadWriteLock;
>> 
>> 
>> /**
>>  * 
>>  * @author steve
>>  * 
>>  * Simple demonstration of using cyclic barrier and reentrant read-write 
>> locks
>>  * striped over a hashmap
>>  *
>>  */
>> public class PlayingWithExpress {
>> 
>> 
>> public static void main(String[] args) {
>> 
>> 
>> final String barrierName = args[0];
>> final int numberOfParties = Integer.parseInt(args[1]);
>> ClusteringProvider clustering = new StandaloneClusteringProvider(
>> "localhost:9510");
>> TerracottaMap<String, ReadWriteLock> map = clustering.getMap("MyMap");
>> Barrier barrier = clustering.getBarrier(barrierName, numberOfParties);
>> ReadWriteLock l = clustering.getReadWriteLock(clustering
>> .getUniversallyUniqueClientID());
>> map.put(clustering.getUniversallyUniqueClientID(), l);
>> 
>> try {
>> System.out.println("Waiting ...");
>> int index = barrier.await();
>> Set<String> keys = (Set<String>) map.keySet();
>> for (String k : keys) {
>> 
>> 
>> ReadWriteLock mrwl = (ReadWriteLock) map.get(k);
>> 
>> 
>> System.out.println("MAP Locked: " + k + ": "
>> + mrwl.writeLock().tryLock(1, TimeUnit.SECONDS));
>> }
>> barrier.await();
>> System.out.println("... finished " + index);
>> } catch (Exception e) {
>> e.printStackTrace();
>> }
>> }
>> }
>> 
>> 
>> _______________________________________________
>> tc-dev mailing list
>> tc-dev@lists.terracotta.org
>> http://lists.terracotta.org/mailman/listinfo/tc-dev
> _______________________________________________
> tc-dev mailing list
> tc-dev@lists.terracotta.org
> http://lists.terracotta.org/mailman/listinfo/tc-dev

_______________________________________________
tc-dev mailing list
tc-dev@lists.terracotta.org
http://lists.terracotta.org/mailman/listinfo/tc-dev

Reply via email to