[hibernate-dev] Infinispan DirectoryProvider for Hibernate Search

Sanne Grinovero sanne.grinovero at gmail.com
Thu Sep 16 12:52:28 EDT 2010


Hi all,
this was planned long time ago and is now being requested often,
especially on the Infinispan forum and irc.

As Search might have to manage several indexes, these can all be
stored in the same cache, or in different caches;
In both cases the cache or CacheManager should be reused, and so the
different DirectoryProvider implementations should
be able to get a reference to the CacheManager.
In case this is stored in JNDI, this should be trivial, but when it's
not we might need to manage the CacheManager lifecycle and
have a global configuration file for it.

The Infinispan Directory was designed to work with Search, so it's all
about dependencies and configuration; these are the steps needed:

1) create a module
  - needed to introduce the Infinispan dependency and Java6.
  - it could be loaded using the FQN for the moment, and later on we
could think about a SPI to plugin "short names"

2) define how a single Infinispan CacheManager's lifecycle should be
handled when JNDI is not used
 [as noticed here: http://community.jboss.org/thread/155875]
 - The initialize(..) method of the DirectoryProvider should pass a
reference to a started CacheManager,
  I see we have now a BuildContext passed in, could we use this to
pass a reference to a loosely coupled CacheManager?
 - the SearchFactory should start a cacheManager before the DirectoryProviders
 - it should stop the cachemanager
 - we should enable a configuration property to name the Infinispan
configuration file

3) In case JNDI is used, provide needed configuration for it (name?)

This provides a usable distributed index, but then other components
should be integrated:
* Share the cachemanager used for the index with the one eventually
setup as second level cache
* Share Infinispan's JGroups channel with the JGroups backend of
Hibernate Search to setup master/slave configurations
* Share Hibernate's database as a cachestore for the index

I'm in need of ideas about how to integrate the lifecycle of the
CacheManager, if someone could help on that I could assemble some of
the other pieces.

Cheers,
Sanne



More information about the hibernate-dev mailing list