We have two releases to announce:
first of all is 9.2.2.Final which introduces a second-level cache
provider for the upcoming Hibernate ORM 5.3 as well as numerous
bugfixes. [1]
Next is 9.3.0.Alpha1 which is the first iteration of our next release.
The main item here, aside from bugfixes and preparation work for
upcoming features, is the upgrade of our server component to WildFly 12.
Go and get them on our download page [3]
Showing posts with label hibernate. Show all posts
Showing posts with label hibernate. Show all posts
Wednesday, 2 May 2018
Thursday, 1 October 2015
Hibernate Second Level Cache improvements
Infinispan has been implementing Hibernate Second Level Cache for a long time, replacing the previous JBoss Cache implementation with very similar logic. The main aim of the implementation has always been to have very fast reads, keeping the overhead of cache during reads on minimum. This was achieved using local reads in invalidation-mode cache and Infinispan's putForExternalRead operation, where the request to cache never blocks.
Recently we've looked on the implementation again to see whether we can speed it up even more. For a long time you could use only transactional caches to keep the cache in sync with database. However transactions come at some cost so we thought about a way to get around it. And we have found it, through custom interceptors we have managed to do two-phase updates to the cache and now the non-transactional caches are the default configuration. So, if you're using Hibernate with your own configuration, don't forget to update that when migrating to Hibernate ORM 5!
With transactions gone, our task was not over. So far entity/collection caching has been implemented for invalidation mode caches, but it's tempting to consider replication mode, too. For replicated caches, we got rid of a special cache for pending puts (this local cache detects out-of-date reads, keeping the entity cache consistent). Instead, we used different technique where a logical removal from the cache is substituted by replace with a token called tombstone, and updates pre-invalidate the cache in a similar way. This change opened the possibility for non-transactional replicated and distributed caches (transactional mode is not supported). We were pleased to see the results of some benchmark where the high hit ratio in replicated caches has dramatically speeded up all operations.
There is one downside of the current implementation - in replication mode, you should not use eviction, as eviction cannot tell regular entity (which can be evicted) from the tombstone. If tombstone was evicted, there's a risk of inconsistent reads. So when using replicated caches, you should rely on expiration to keep your cache slender. We hope that eventually we'll remove this limitation.
All modes described above give us cache without any stale reads. That comes at a cost - each modification (insert, update or removal) requires 2 accesses to the cache (though, sometimes the second access can be asynchronous). Some applications do not require such strict consistency - and that's where nonstrict-read-write comes to the scene. Here we guarantee that the cache will provide the same result as DB after the modifying transaction commits - between DB commit and transaction commit a stale value can be provided. If you use asynchronous cache, this may be delayed even more but unless the operation fails (e.g. due to locking timeout) the cache will eventually get into a state consistent with DB. This allows us to limit modifications to single cache access per modification.
Note that nonstrict-read-write mode is supported only for versioned entities/collections (that way we can find out which entity is actually newer). Also, you cannot use eviction in nonstrict-read-write mode, for the same reason as in tombstone-based modes. Invalidation cache mode is not supported neither.
If you'll try out the most recent Hibernate ORM, you'll find out that Infinispan 7.2.x is used there. This is because ORM 5.0.0.Final was released before Infinispan 8.0.0.Final went out and we can't change the major version of dependency in micro-release. However, we try to keep Infinispan 8.0.x binary compatible (in parts used by Hibernate), and therefore you can just replace the dependencies on classpath and use the most recent Infinispan, if you prefer to do so.
To sum things up, here is the table of supported configurations:
There's also the read-only mode - this can be used instead of both transactional or read-write modes, but at this point it does not offer any further performance gains, since we have to make sure that you don't see a removed value. Actually, it also does not matter whether you specify transactional or read-write mode; the proper strategy will be picked according to your cache configuration (transactional vs. non-transactional).
We hope that you'll try these new modes and many consistency fixes included along (you should use Hibernate ORM 5.0.2.Final or later), and tell us about your experience.
Happy caching!
Recently we've looked on the implementation again to see whether we can speed it up even more. For a long time you could use only transactional caches to keep the cache in sync with database. However transactions come at some cost so we thought about a way to get around it. And we have found it, through custom interceptors we have managed to do two-phase updates to the cache and now the non-transactional caches are the default configuration. So, if you're using Hibernate with your own configuration, don't forget to update that when migrating to Hibernate ORM 5!
With transactions gone, our task was not over. So far entity/collection caching has been implemented for invalidation mode caches, but it's tempting to consider replication mode, too. For replicated caches, we got rid of a special cache for pending puts (this local cache detects out-of-date reads, keeping the entity cache consistent). Instead, we used different technique where a logical removal from the cache is substituted by replace with a token called tombstone, and updates pre-invalidate the cache in a similar way. This change opened the possibility for non-transactional replicated and distributed caches (transactional mode is not supported). We were pleased to see the results of some benchmark where the high hit ratio in replicated caches has dramatically speeded up all operations.
There is one downside of the current implementation - in replication mode, you should not use eviction, as eviction cannot tell regular entity (which can be evicted) from the tombstone. If tombstone was evicted, there's a risk of inconsistent reads. So when using replicated caches, you should rely on expiration to keep your cache slender. We hope that eventually we'll remove this limitation.
All modes described above give us cache without any stale reads. That comes at a cost - each modification (insert, update or removal) requires 2 accesses to the cache (though, sometimes the second access can be asynchronous). Some applications do not require such strict consistency - and that's where nonstrict-read-write comes to the scene. Here we guarantee that the cache will provide the same result as DB after the modifying transaction commits - between DB commit and transaction commit a stale value can be provided. If you use asynchronous cache, this may be delayed even more but unless the operation fails (e.g. due to locking timeout) the cache will eventually get into a state consistent with DB. This allows us to limit modifications to single cache access per modification.
Note that nonstrict-read-write mode is supported only for versioned entities/collections (that way we can find out which entity is actually newer). Also, you cannot use eviction in nonstrict-read-write mode, for the same reason as in tombstone-based modes. Invalidation cache mode is not supported neither.
If you'll try out the most recent Hibernate ORM, you'll find out that Infinispan 7.2.x is used there. This is because ORM 5.0.0.Final was released before Infinispan 8.0.0.Final went out and we can't change the major version of dependency in micro-release. However, we try to keep Infinispan 8.0.x binary compatible (in parts used by Hibernate), and therefore you can just replace the dependencies on classpath and use the most recent Infinispan, if you prefer to do so.
To sum things up, here is the table of supported configurations:
Concurrency strategy | Cache transactions | Cache mode | Implementation | Eviction |
---|---|---|---|---|
transactional | transactional | invalidation | pending puts | yes |
read-write | non-transactional | |||
non-transactional | replicated/distributed | tombstones | no | |
nonstrict-read-write | versioned entries |
There's also the read-only mode - this can be used instead of both transactional or read-write modes, but at this point it does not offer any further performance gains, since we have to make sure that you don't see a removed value. Actually, it also does not matter whether you specify transactional or read-write mode; the proper strategy will be picked according to your cache configuration (transactional vs. non-transactional).
We hope that you'll try these new modes and many consistency fixes included along (you should use Hibernate ORM 5.0.2.Final or later), and tell us about your experience.
Happy caching!
Labels:
hibernate,
jpa,
second level cache provider
Thursday, 30 May 2013
Introducing JPA Cache Store
Good news everyone - Infinispan 5.3.0 will be introducing a long awaited JPA cache store. This cache store will allow you to store cache entries in the database using proper schema - so that other applications can read the persisted data as well.
In normal use cases, it's recommended to leverage Infinispan as JPA second level cache and/or query cache. However, if you'd like to use only Infinispan API and you want Infinispan to read from database, or to persist the data into a database with well defined schema, then JPA cache store could be right for you.
Prior to JPA cache store, those who wants to use Infinispan in front of a database to read/write database records would need to write their own cache store implementation. Now, with JPA cache store, users can use Infinispan in front of a database (write-through or write-behind) with ease by using standard JPA mapping and configurations.
To use the cache store is simple - create the standard JPA configuration (persistence.xml) and entity class, and then configure the cache store:
Please see documentations for detailed sample usage and configuration.
Hope you enjoy this new addition!
Ray
In normal use cases, it's recommended to leverage Infinispan as JPA second level cache and/or query cache. However, if you'd like to use only Infinispan API and you want Infinispan to read from database, or to persist the data into a database with well defined schema, then JPA cache store could be right for you.
Prior to JPA cache store, those who wants to use Infinispan in front of a database to read/write database records would need to write their own cache store implementation. Now, with JPA cache store, users can use Infinispan in front of a database (write-through or write-behind) with ease by using standard JPA mapping and configurations.
To use the cache store is simple - create the standard JPA configuration (persistence.xml) and entity class, and then configure the cache store:
Please see documentations for detailed sample usage and configuration.
Hope you enjoy this new addition!
Ray
Labels:
5.3,
cache store,
hibernate,
infinispan,
jpa
Friday, 3 May 2013
The first JUDCon Brazil experience
The first ever JUDCon Brazil was held a couple of weeks back and it was a real blast! Firstly, it offered a great opportunity to meet some members of the JBoss community which have been helping us push JBoss projects forward in this region of the world, such as Hanneli Tavante, Roberto dos Santos Wagner, ...etc. It was great sharing ideas, experiences...etc with them and coming up with new ideas!
As mentioned before in the post before the conference, I had two new presentations to deliver, one on JSR-107 specification on JCache API and Infinispan's implementation, and the other on Hibernate Second Level Cache with Infinispan. The JCache presentation went really well and all the live coding worked as expected.
The second presentation was the busier of the two, with a full room packed with Hibernate/JPA users waiting to hear how to scale up their applications. I got excellent feedback from both presentations and looking forward to giving these presentations in more user groups or conferences.
The presentations are not up yet, but I expect them to be posted online in the next few weeks. In the mean time, here are a couple of temporary links to the PDFs of my presentations:
The big news of the conference was for sure the announcement of JBoss Application Servers' new name: WildFly. We're actively working with them to make the most out of Infinispan :)
Cheers,
Galder
As mentioned before in the post before the conference, I had two new presentations to deliver, one on JSR-107 specification on JCache API and Infinispan's implementation, and the other on Hibernate Second Level Cache with Infinispan. The JCache presentation went really well and all the live coding worked as expected.
The second presentation was the busier of the two, with a full room packed with Hibernate/JPA users waiting to hear how to scale up their applications. I got excellent feedback from both presentations and looking forward to giving these presentations in more user groups or conferences.
The presentations are not up yet, but I expect them to be posted online in the next few weeks. In the mean time, here are a couple of temporary links to the PDFs of my presentations:
Cheers,
Galder
Labels:
conference,
event,
hibernate,
jsr 107,
judcon,
presentations,
second level cache provider
Thursday, 18 April 2013
Infinispan coming to Brazil's JUDCon!!
Infinispan team is coming to São Paulo (Brazil) to present on multiple topics around caching, data grids and NoSQL in Brazil's first ever JBoss Users & Developers Conference (JUDCon). The event is being held over two days, on 19th and 20th of April.
On the 19th, Manik Surtani and Pete Muir will present on how to supercharge web applications using JBoss Data Grid. Expect a very lively presentation from these very seasoned presenters :)
Another presentation where you'll be able to see Infinispan in action is in Shekhar Gulati's "Closed PaaS to Open PaaS : Migrate GAE Applications to OpenShift Using CapeDwarf" and Randall Hauch's "Elastic Consistent NoSQL Data Storage with ModeShape 3" talk, both on the 19th of April, where Shekhar and Randal will demonstrate JBoss projects using Infinispan heavily.
On 20th of April, I'll be speaking about scaling up Hibernate/JPA applications with Infinispan second-level cache. Even if the Infinispan caching provider was created almost 4 years ago, this is the first time I'm presenting about it. Really looking forward to that.
Finally, I'll also give the first ever presentation on Infinispan JCache (JSR-107) API implementation, which will be mostly a live coding session showing different bits about JCache API and the extra capabilities JCache users get from using Infinispan implementation.
Cheers,
Galder
On the 19th, Manik Surtani and Pete Muir will present on how to supercharge web applications using JBoss Data Grid. Expect a very lively presentation from these very seasoned presenters :)
Another presentation where you'll be able to see Infinispan in action is in Shekhar Gulati's "Closed PaaS to Open PaaS : Migrate GAE Applications to OpenShift Using CapeDwarf" and Randall Hauch's "Elastic Consistent NoSQL Data Storage with ModeShape 3" talk, both on the 19th of April, where Shekhar and Randal will demonstrate JBoss projects using Infinispan heavily.
On 20th of April, I'll be speaking about scaling up Hibernate/JPA applications with Infinispan second-level cache. Even if the Infinispan caching provider was created almost 4 years ago, this is the first time I'm presenting about it. Really looking forward to that.
Finally, I'll also give the first ever presentation on Infinispan JCache (JSR-107) API implementation, which will be mostly a live coding session showing different bits about JCache API and the extra capabilities JCache users get from using Infinispan implementation.
Cheers,
Galder
Labels:
conference,
data grids,
event,
hibernate,
judcon
Friday, 17 June 2011
So you want JPA-like access to Infinispan?
Back in the early days of Infinispan (since our first public announcement, in fact) we always had it in mind to expose a JPA-like layer to Infinispan. Initially this was as a replacement to the fine-grained replication that JBoss Cache's POJO Cache variant offered, but it grew beyond just a technique to do fine-grained replication on complex object graphs. The fact that it offered a familiar data storage API to Java developers was big. Huge, in fact.
So we realised JPA-on-Infinispan was firmly on the roadmap. The original plan was to implement the entire set of JPA APIs from scratch, but this was a daunting and Herculean task. After much discussion with core Hibernate architects and Infinispan contributors Emmanuel Bernard and Sanne Grinovero, we came to a decision that rather than implementing all this from scratch, it served both Infinispan and the community better to fork Hibernate's core ORM engine, and replace the relational database mappings with key/value store mappings. And we get to reuse the mature codebase of Hibernate's session and transaction management, object graph dehydration code, proxies, etc.
And Hibernate OGM (Object-Grid Mapping) was born. After initial experiments and even a large-scale public demo at the JBoss World 2011 Keynote, Emmanuel has officially blogged about the launch of Hibernate OGM. Very exciting times, Infinispan now has a JPA-like layer. :-)
To reiterate a key point from Emmanuel's blog, Hibernate OGM is still in its infancy. It needs community participation to help it grow up and mature. This is where the Infinispan community should step in; consider Hibernate OGM as Infinispan's JPA-like layer and get involved. For more details, please read Emmanuel's announcement.
Enjoy!
Manik
So we realised JPA-on-Infinispan was firmly on the roadmap. The original plan was to implement the entire set of JPA APIs from scratch, but this was a daunting and Herculean task. After much discussion with core Hibernate architects and Infinispan contributors Emmanuel Bernard and Sanne Grinovero, we came to a decision that rather than implementing all this from scratch, it served both Infinispan and the community better to fork Hibernate's core ORM engine, and replace the relational database mappings with key/value store mappings. And we get to reuse the mature codebase of Hibernate's session and transaction management, object graph dehydration code, proxies, etc.
And Hibernate OGM (Object-Grid Mapping) was born. After initial experiments and even a large-scale public demo at the JBoss World 2011 Keynote, Emmanuel has officially blogged about the launch of Hibernate OGM. Very exciting times, Infinispan now has a JPA-like layer. :-)
To reiterate a key point from Emmanuel's blog, Hibernate OGM is still in its infancy. It needs community participation to help it grow up and mature. This is where the Infinispan community should step in; consider Hibernate OGM as Infinispan's JPA-like layer and get involved. For more details, please read Emmanuel's announcement.
Enjoy!
Manik
Labels:
API,
hibernate,
hibernate ogm,
jpa
Tuesday, 7 June 2011
Faster Infinispan-based Second Level Cache coming to a JPA app near you!
Starting with Hibernate 4.0.0.Beta1, Infinispan second level cache interacts with the transaction manager as a JTA Synchronization instead of an XA resource. Based on some testing we've done in JBoss AS 7, this has resulted in a huge performance increase thanks to the optimisations the transaction manager can apply to Synchronizations, which work very well when Infinispan is used as a cache rather than as a authoritative data store.
From an Infinispan configuration perspective, nothing needs changing. The Infinispan provider still uses the same base configuration by default. Transactional configuration happens within the cache provider itself and it's here where the Infinispan is configured with Hibernate's transaction manager and where Infinispan is configured to participate as a JTA synchronization. This is the default configuration, so from an user perspective, there's nothing you have to do to take advantage of this new change.
However, you can always switch back to previous behaviour where Infinispan interacted as an XA resource via a dedicated Hibernate property called hibernate.cache.infinispan.use_synchronization
By default this property is set to true. If you set it false, Infinispan will interact with the transaction manager as an XA resource.
For more detailed information, check the "Using Infinispan As JPA Hibernate Second Level Cache Provider" wiki.
Cheers,
Galder
Wednesday, 1 December 2010
Infinispan and JBoss AS 5.x
A lot of people have asked about being able to use Infinispan as a second level cache for Hibernate within JBoss AS 5.x (and its EAP 5.x cousins).
While Infinispan can be used as a Hibernate second level cache with Hibernate 3.5 onwards, Bill deCoste has written a guide to getting Infinispan to work in older versions of Hibernate, specifically with JBoss AS 5.x. Hope you find this useful!
Cheers
Manik
While Infinispan can be used as a Hibernate second level cache with Hibernate 3.5 onwards, Bill deCoste has written a guide to getting Infinispan to work in older versions of Hibernate, specifically with JBoss AS 5.x. Hope you find this useful!
Cheers
Manik
Labels:
as5,
hibernate,
jboss as 5,
second level cache provider
Tuesday, 2 February 2010
Infinispan as a LOCAL cache
While Infinispan has got the distributed, in-memory data grid market firmly it in its sight, there is also another aspect of Infinispan which I feel people would find interesting.
At its heart Infinispan is a highly concurrent, extremely performant data structure than can be distributed, or could be used in a standalone, local mode - as a cache. But why would people use Infinispan over, say, a ConcurrentHashMap? Here are some reasons.
Feature-rich
- Eviction. Built-in eviction ensures you don't run out of memory.
- Write-through and write-behind caching. Going beyond memory and onto disk (or any other pluggable CacheStore) means that your state survives restarts, and preloaded hot caches can be configured.
- JTA support and XA compliance. Participate in ongoing transactions with any JTA-compliant transaction manager.
- MVCC-based concurrency. Highly optimized for fast, non-blocking readers.
- Manageability. Simple JMX or rich GUI management console via JOPR, you have a choice.
- Not just for the JVM. RESTful API, and upcoming client/server modules speaking Memcached and HotRod protocols help non-JVM platforms use Infinispan.
- Cluster-ready. Should the need arise.
Easy to configure, easy to use
The simplest configuration file containing just <infinispan />is enough to get you started, with sensible defaults abound. (More detailed documentation is also available).
All the features above are exposed via an easy-to-use Cache interface, which extends ConcurrentMap and is compatible with many other cache systems. Infinispan even ships with migration tools to help you move off other cache solutions onto Infinispan, whether you need a cache to store data retrieved remotely or simply as a 2nd level cache for Hibernate.
Performance
In the process of testing and tuning Infinispan on very large clusters, we have started to put together a benchmarking framework. As a part of this framework, we have the ability to measure cache performance in standalone, local mode. So in the context of this blog post, I'd
like to share some recent performance numbers of Infinispan - a recent snapshot - compared against the latest JBoss Cache release (3.2.2.GA) and EHCache (1.7.2). Some background on the tests:
- Used a latest snapshot of the CacheBenchFwk
- Run on a RHEL 5 server with 4 Intel Xeon cores, 4GB of RAM
- Sun JDK 1.6.0_18, with -Xms1g -Xmx1g
- Test run on a single node, with 25 concurrent threads, using randomly generated Strings as keys and values and a 1kb payload for each entry, with a 80/20 read/write ratio.
- Performance measured in transactions per second (higher = better).
In summary, what we have here is that when run in local mode, Infinispan is a high-performance standalone caching engine which offers a rich set of features while still being trivially simple to configure and use.
Enjoy,
Manik
Tuesday, 20 October 2009
Infinispan based Hibernate Cache Provider available now!
Update (2009/11/13)! Infinispan 4.0.0.Beta2 based Hibernate second level cache provider now available in Hibernate 3.5 Beta2. However, neither Infinispan 4.0.0.Beta2 nor the Infinispan Cache Provider jar are available in the zip distribution. Instead, please download Infinispan 4.0.0.Beta2 from our download site and the Infinispan Cache Provider from our Maven repository.
I've just finished the development of an Infinispan 4.0 based Hibernate second level cache provider. This will be included from next Hibernate 3.5 release onwards but if you cannot wait and wanna play with it in the mean time, just checkout Hibernate trunk from our SVN repository and run 'mvn install'.
I've also written a wiki called "Using Infinispan as JPA/Hibernate Second Level Cache Provider" that should help users understand how to configure the Infinispan cache provider and how to make the most of it!
So, what's good about it? Why should I use it? First of all, since the cache provider is based on Infinispan, you benefit from all the improvements we've done to Infinispan in terms of performance and memory consumption so far and there are more to come!
On top of that, starting with this cache provider, we're aiming to reduce the number of files needed to modify in order to define the most commonly tweaked parameters. So, for example, by enabling eviction/expiration configuration on a per generic Hibernate data type or particular entity/collection type via hibernate.cfg.xml or persistence.xml, users don't have to touch to Infinispan's cache configuration file any more. You can find detailed information on how to do this in the "Using Infinispan as JPA/Hibernate Second Level Cache Provider" wiki
Please direct any feedback to the Infinispan user forum.
Galder
I've just finished the development of an Infinispan 4.0 based Hibernate second level cache provider. This will be included from next Hibernate 3.5 release onwards but if you cannot wait and wanna play with it in the mean time, just checkout Hibernate trunk from our SVN repository and run 'mvn install'.
I've also written a wiki called "Using Infinispan as JPA/Hibernate Second Level Cache Provider" that should help users understand how to configure the Infinispan cache provider and how to make the most of it!
So, what's good about it? Why should I use it? First of all, since the cache provider is based on Infinispan, you benefit from all the improvements we've done to Infinispan in terms of performance and memory consumption so far and there are more to come!
On top of that, starting with this cache provider, we're aiming to reduce the number of files needed to modify in order to define the most commonly tweaked parameters. So, for example, by enabling eviction/expiration configuration on a per generic Hibernate data type or particular entity/collection type via hibernate.cfg.xml or persistence.xml, users don't have to touch to Infinispan's cache configuration file any more. You can find detailed information on how to do this in the "Using Infinispan as JPA/Hibernate Second Level Cache Provider" wiki
Please direct any feedback to the Infinispan user forum.
Galder
Labels:
eviction,
hibernate,
second level cache provider
Wednesday, 23 September 2009
Infinispan Query breaks into 4.0.0.CR1
Hello all,
Querying is an important feature for Infinispan, so we've decided to include a technology preview of this for 4.0.0.CR1 and 4.0.0.GA, even though it is only really scheduled for Infinispan 4.1.0.
Browse to this wiki page to see how the new API works for querying, along with usage examples.
Origins
Some of the API has come from JBoss Cache Searchable but has been enhanced and runs slicker. A lot more work is being done under the hood so it makes it easier for users. For example, the API method on the QueryFactory.getBasicQuery() just needs two Strings and builds a basic Lucene Query instance, as opposed to forcing the user to create a Lucene query manually. This is still possible however, should a user want to create a more complex query.
The indexing for Lucene is now done through interceptors as opposed to listeners, and hence more tightly integrated into Infinispan's core.
You can also choose how indexes are maintained. If indexes are shared (perhaps stored on a network mounted drive), then you only want nodes to index changes made locally. On the other hand, if each node maintains its own indexes (either in-memory on on a local filesystem) then you want each node to index changes made, regardless of where the changes are made. This behaviour is controlled by a system property - -Dinfinispan.query.indexLocalOnly=true. However, this is system property temporary and will be replaced with a proper configuration property once the feature is out of technology preview.
What's coming up?
Future releases of Hibernate Search and Infinispan will have improvements that will change the way that querying works. The QueryHelper class - as documented in the wiki - is temporary so that will eventually be removed, as you will not need to provide the class definitions of the types you wish to index upfront. We will be able to detect this on the fly (see HSEARCH-397)
There will be a better system for running distributed queries. And the system properties will disappear in favour of proper configuration attributes.
Querying is an important feature for Infinispan, so we've decided to include a technology preview of this for 4.0.0.CR1 and 4.0.0.GA, even though it is only really scheduled for Infinispan 4.1.0.
Browse to this wiki page to see how the new API works for querying, along with usage examples.
Origins
Some of the API has come from JBoss Cache Searchable but has been enhanced and runs slicker. A lot more work is being done under the hood so it makes it easier for users. For example, the API method on the QueryFactory.getBasicQuery() just needs two Strings and builds a basic Lucene Query instance, as opposed to forcing the user to create a Lucene query manually. This is still possible however, should a user want to create a more complex query.
The indexing for Lucene is now done through interceptors as opposed to listeners, and hence more tightly integrated into Infinispan's core.
You can also choose how indexes are maintained. If indexes are shared (perhaps stored on a network mounted drive), then you only want nodes to index changes made locally. On the other hand, if each node maintains its own indexes (either in-memory on on a local filesystem) then you want each node to index changes made, regardless of where the changes are made. This behaviour is controlled by a system property - -Dinfinispan.query.indexLocalOnly=true. However, this is system property temporary and will be replaced with a proper configuration property once the feature is out of technology preview.
What's coming up?
Future releases of Hibernate Search and Infinispan will have improvements that will change the way that querying works. The QueryHelper class - as documented in the wiki - is temporary so that will eventually be removed, as you will not need to provide the class definitions of the types you wish to index upfront. We will be able to detect this on the fly (see HSEARCH-397)
There will be a better system for running distributed queries. And the system properties will disappear in favour of proper configuration attributes.
And also, GSoC student Lukasz Moren's work involving an Infinispan-based Lucene Directory implementation will allow indexes to be shared cluster-wide by using Infinispan itself to distribute these indexes. All very clever stuff.
Thanks for reading!
Navin.
Navin.
Labels:
hibernate,
hibernate search,
index,
infinispan,
jboss cache,
lucene,
query
Subscribe to:
Posts (Atom)