Changes are for the Java and Xml Configuration APi for the Automatic Resource Control (ARC) feature. Changes include:
A new SharedResourcePoolsBuilder is used to add one or more 'shareable' ResourcePools to the cache manager. Phase 1 will only support shareable offheap. But I added shareable heap configuration (targeted for Phase 2) to these changes in order to build out and test some of the expected configuration options. However, I stopped short of adding the API hooks for the heapSizeOfEngine support which will be required when supporting ARC for heap in Phase 2.
Like the existing ResourcePoolsBuilder used during cache configuration, the SharedResourcePoolsBuilder accepts instances of SizedResourcePools. But when added to the cache manager's sharedResources, the SizedResourcePools are configured with shared=true.
When a cache wishes to inform the cache manager that it intends to use a shared resource, defined on the the cache manager, the cache adds a SizedResourcePool to its ResourcePools with shared=true but with size=0. This is the mechanism through which cache configurations can convey to the cache manager that they want to use the shared resource and not have one constructed for its dedicated use.
When undergoing initialization (CacheManagerBuilder.build(true)), the EhcacheManager understands the above relationships and can perform the necessary consistency checking across the cache's declared wishes and what has actually been configured on the cache manager.
As much as possible, supported configurations are handled at the point of configuration by only exposing valid options (e.g. creating a SharedResourcePoolsBuilder instead of re-using the existing ResourcePoolsBuilder when configuring the cache manager's shared resources). When not feasible during configuration, runtime validation is performed.
Changes are for the Java and Xml Configuration APi for the Automatic Resource Control (ARC) feature. Changes include:
SharedResourcePoolsBuilder
is used to add one or more 'shareable'ResourcePool
s to the cache manager. Phase 1 will only support shareable offheap. But I added shareableheap
configuration (targeted for Phase 2) to these changes in order to build out and test some of the expected configuration options. However, I stopped short of adding the API hooks for theheap
SizeOfEngine
support which will be required when supporting ARC for heap in Phase 2.ResourcePoolsBuilder
used during cache configuration, theSharedResourcePoolsBuilder
accepts instances ofSizedResourcePool
s. But when added to the cache manager'ssharedResources
, theSizedResourcePool
s are configured withshared=true
.SizedResourcePool
to itsResourcePools
withshared=true
but withsize=0
. This is the mechanism through which cache configurations can convey to the cache manager that they want to use the shared resource and not have one constructed for its dedicated use.CacheManagerBuilder.build(true)
), theEhcacheManager
understands the above relationships and can perform the necessary consistency checking across the cache's declared wishes and what has actually been configured on the cache manager.SharedResourcePoolsBuilder
instead of re-using the existingResourcePoolsBuilder
when configuring the cache manager's shared resources). When not feasible during configuration, runtime validation is performed.