Found

The document has moved here.

Installing a new JDK in Debian/Ubuntu

I like (need) to have several JDKs installed on my system and I use Debian’s alternatives mechanism to switch easily between them. It’s just a clever use of symlinks. A nice aspect of the alternatives system is the possibility to connect “slaves”: links to other files which should be changed when their master changes. Since the JDK is made up of quite a few commands, here is what I use when I add a new version to my system:

sudo update-alternatives --install /usr/bin/java java $1/bin/java 200 \
--slave /usr/bin/jar jar $1/bin/jar \
--slave /usr/bin/jarsigner jarsigner $1/bin/jarsigner \
--slave /usr/bin/javac javac $1/bin/javac \
--slave /usr/bin/javadoc javadoc $1/bin/javadoc \
--slave /usr/bin/javah javah $1/bin/javah \
--slave /usr/bin/javap javap $1/bin/javap \
--slave /usr/bin/javaws javaws $1/bin/javaws

Then I just invoke the following command to select the JDK I want to use:

sudo update-alternatives --config java

I get presented with the following

There are 5 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/ibm-java-x86_64-60/bin/java         200       auto mode
  1            /usr/lib/jvm/ibm-java-x86_64-60/bin/java         200       manual mode
  2            /usr/lib/jvm/ibm-java-x86_64-70/bin/java         200       manual mode
  3            /usr/lib/jvm/java-1.7.0-openjdk-amd64/bin/java   200       manual mode
  4            /usr/lib/jvm/jdk1.6.0_31/bin/java                200       manual mode
* 5            /usr/lib/jvm/jdk1.7.0_03/bin/java                200       manual mode

Press enter to keep the current choice[*], or type selection number:

And when you need to dynamically set JAVA_HOME to the appropriate path, use the following command:

export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")
Share

Cassandra Connection Pool 0.7.1

I have released version 0.7.1 of my Cassandra Connection Pool. Versions in the 0.7.x series match Cassandra 0.7.x, and therefore require libthrift 0.5.
This version is also being used in the recently released Infinispan 5.0.0.CR1.
The artifacts are now available in Maven Central so you just need to add the following dependency to your pom.xml without any additional bits and pieces:


	net.dataforte.cassandra
	cassandra-connection-pool
	0.7.1

I also wish to announce that I am currently working on Cassandra Armeria, an abstraction layer for Cassandra’s ever-changing Thrift API, and hope that this will provide the basis for Infinispan’s Cassandra support in the next release cycle (5.1.0).

Share

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 Connection Pool 0.3.5

I have just release version 0.3.5 of my Cassandra Connection Pool.
It contains a couple of bug-fixes when setting configuration properties via the generic set() method and much improved logging: all logs are prefixed with the pool’s name, periodic activity is lowered at trace from debug, and extra logging is done on pool exhaustion.

I recommend upgrading to it.

Get it from my Maven repo.

Share

CoheSiVe

I have just added a new project to my github repo: CoheSiVe

From the silly capitalization you can already guess that it’s a CSV library. It differs from other libraries I’ve seen in that it doesn’t attempt to read the whole file in one go, but is uses an event-driven architecture so that your application can decide what to do with each row as it is parsed.

Docs are here: http://www.dataforte.net/software/cohesive/index.html

Share