infinispan/infinispan — pull request #2005 by galderz (2013-08-13 14:23:51+00:00)
Title: ISPN-3318 Automated upgradable path for file store consumers

http://issues.jboss.org/browse/ISPN-3318

Note: Some debatable code here, particularly around the delegate file cache store. Needs a bit of love from @ttarrant and @mmarkus to see what we can do to improve configuration. I'm fully aware this code is bound to change with @mmarkus' cache store changes, but it was good to verify that the automated upgrade path is available.

Commit comments:

* Remove SingleFileCacheStore and related files and ported the code over to FileCacheStore.
* Old FileCacheStore logic moved to BucketFileCacheStore which is package private in order to avoid instantiation.
* FileCacheStore can now detect old bucket-based data structure and it can upgrade it, providing a backup for the old data.
* Backup is still accessible, by enabling the deprecatedBucketFormat configuration attribute, in which case the old bucket-based FileCacheStore is used.
* In order to avoid having to replicate the configuration hierarchy for the old, bucket-based cache store, created a delegate cache store which delegates to the correct cache file cache store (new, or bucket based), depending on whether the deprecatedBucketFormat flag was enabled or not.
* This is not ideal and in fact I suggest some alternative solution as comment in the code.