Pages

Tuesday, April 19, 2011

QMass, An API for Cluster Wide Operations

I have started a new clustering api for Java. You can access the project page at http://code.google.com/p/qmass/. Very first version is ready to be downloaded.
It's first application is an hibernate cache provider implementation. You can start using it by simply defining org.mca.qmass.cache.hibernate.provider.QMassHibernateCacheProvider as the hibernate cache provider.
By default it will try to cluster applications running on localhost in the port range 6661-6670. To configure QMass you need to set the qmass.cluster property through your persistence.xml. An example persistence.xml might look like this :
<persistence>
<persistence-unit name="app">
...
<properties>
<property name="hibernate.cache.use_second_level_cache"
value="true"/>
<property name="hibernate.cache.provider_class"
value="org.mca.qmass.cache.hibernate.provider.QMassHibernateCacheProvider"/>
<property name="qmass.cluster"
value="localhost,6661,6670/"/>
<property name="qmass.name"
value="myproject"/>
...
</properties>
</persistence-unit>
</persistence>
Cluster definition 10.10.10.112,6661,6670/10.10.10.113,6661,6670/ will define a cluster spanning two different machines with in the port range. qmass.name is the name of your cluster. By setting it you might have two or more clusters running together with out messing with each other.

No comments:

Post a Comment