[infinispan-dev] CassandraCacheStore
Tristan Tarrant
tristan.tarrant at gmail.com
Wed Sep 8 06:03:39 EDT 2010
Dear all,
I am new here and I (would like to) bring gifts :)
First of all thanks for the great work you have been doing on Infinispan. I
was introduced to Infinispan by Sanne, with whom I have collaborated in the
past (hi Sanne!).
Over the last few days I have been writing a CacheStore implementation for
Apache Cassandra, but I have a few unanswered questions I would like to
submit to you before I proceed.
I have written my code by taking inspiration from other CacheStore
providers, namely the JDBM and Hibernate stores.
I hash the key of an entry to produce an appropriate key for Cassandra. I
then store the marshalled value in a Column named "entry" within a
ColumnFamily named "Infinispan". If the entry has an expiration I create
another Column within the "Infinispan" ColumnFamily using the following
pattern: "expiration"+"0paddedtimestamp" containg a placeholder value.
When purgeInternal is invoked I delete all rows which have a column in the
range "Infinispan:expiration0000000000000000" to
"Infinispan:expiration0paddednowtimestamp".
I have noticed that the JDBM CacheStore keeps expiration entries in an
internal LinkedHashMap: is that just for performance reasons ?
Also, Cassandra doesn't support transactional operations, but merely batched
operations: within the applyModifications() method I just send all
operations in one batch invocation. Is this ok ? I guess that Infinispan
manages the transactional side of things.
I am currently developing in my own private Subversion repository and using
my own package name and Junit+mockito in place of testng+easymock. Would
such an object be worthy of potential inclusion within Infinispan itself
(and so should I refactor everything around the org.infinispan package and
integrate nicely with the rest of the tree?). Should I submit a patch to the
current Infinispan trunk ?
Thanks in advance
Tristan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/infinispan-dev/attachments/20100908/6dbabf31/attachment.html
More information about the infinispan-dev
mailing list