Tag Archives: Infinispan

Amanuensis

I have just published Amanuensis on GitHub:

https://github.com/tristantarrant/amanuensis

Amanuensis is a clustered IndexWriter for Infinispan which leverages JGroups’ channel multiplexing to stream index changes from slave nodes to a master node.

To use Amanuensis, add the appropriate dependency to your pom.xml:

<dependencies>
	<dependency>
		<groupId>net.dataforte.infinispan</groupId>
		<artifactId>amanuensis</artifactId>
		<version>0.0.2</version>
	</dependency>
</dependencies>
<repositories>
	<repository>
		<id>dataforte</id>
		<url>http://www.dataforte.net/listing/maven/releases</url>
		<snapshots><enabled>false</enabled></snapshots>
	</repository>
</repositories>

You also need to tell Infinispan to use Amanuensis’ JGroups channel lookup which enables muxed transport of messages.

<global>
		<transport clusterName="cluster">
			<properties>
				<property name="channelLookup" value="net.dataforte.infinispan.amanuensis.backend.jgroups.MuxChannelLookup" />
			</properties>
		</transport>
	</global>

In your code you need to initialize an instance of AmanuensisManager and obtain an InfinispanIndexWriter for each InfinispanDirectory you want to write to as follows:

import net.dataforte.infinispan.amanuensis.AmanuensisManager;
import net.dataforte.infinispan.amanuensis.IndexerException;
import net.dataforte.infinispan.amanuensis.InfinispanIndexWriter;

AmanuensisManager amanuensisManager = new AmanuensisManager(cacheManager);
amanuensisManager.setAnalyzer(analyzer);
InfinispanIndexWriter indexWriter = amanuensisManager.getIndexWriter(directory);

You then invoke methods on the InfinispanIndexWriter from any node and it will send changes to the Infinispan’s coordinator which will apply them to the directory. Index operations can also be batched together:

indexWriter.startBatch();
indexWriter.deleteDocuments(query);
indexWriter.addDocument(doc);
indexWriter.endBatch();

InfinispanIndexWriter is thread safe in that multiple threads can send batches individually.

The project’s site (together with JavaDocs) is available at: http://www.dataforte.net/software/amanuensis/index.html

Share

Cassandra CacheStore now in Infinispan trunk

Since I have been accepted as an Infinispan contributor, I have committed my first complete implementation of the Cassandra CacheStore to Infinispan’s trunk. This means that it will be included in Infinispan 5.0 whenever that will be released.

In the meantime I have migrated all the code into my repository and have released a 0.0.2 version which can be used with the current Infinispan 4.1.x and 4.2.x. The Maven dependency (if you use my repository) is:

<dependency>
        <groupId>net.dataforte.infinispan</groupId>
	<artifactId>infinispan-cachestore-cassandra</artifactId>
	<version>0.0.2</version>
</dependency>

I would be very grateful if you could test it in your environment.

I am also working on adding multiple host addresses and automatic ring discovery to my Cassandra Connection Pool.

Share

Infinispan Cassandra CacheStore

Since my previous post about the Cassandra Connection Pool, I have been progressing on another project: a Cassandra CacheStore for Infinispan.
I have published on my personal SVN repository the initial source for this CacheStore, get it at:

http://dataforte.dyndns.org/svn/dataforte/infinispan-cachestore-cassandra/trunk/

If you use Maven, add my repository to your settings.xml or to your repository manager (Nexus, Artifactory, etc):

http://www.dataforte.net/listing/maven/releases/

which contains all required dependencies.

See the tests available under src/test for examples on how to setup an Infinispan cache backed up to a Cassandra database and how a Lucene InfinispanDirectory can take advantage of both systems.

I am working on rearranging things for potential inclusion in the main Infinispan package, so some things may change (package names). Also key expiration is not as efficient as I would like, but release early, release often is good practice, so there 🙂

Share