#638 - ENH: Add Apache Ignite as L2 cache option

This commit is contained in:
Robin Bygrave committed 2016-04-08 02:03:02 +12:00
1 parent 524be4ce55
commit da90eccc12
4 files changed
+31 -1

No files matched your search

@@ -2030,6 +2030,16 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
return beanDescriptorManager.getBeanDescriptorByClassName(beanClassName);
}
@Override
public boolean initQueryCache(String key) {
BeanDescriptor<?> desc = getBeanDescriptorById(key);
if (desc != null) {
desc.queryCacheInit();
return true;
}
return false;
}
/**
* Another server in the cluster sent this event so that we can inform local
* BeanListeners of inserts updates and deletes that occurred remotely (on
@@ -1075,6 +1075,10 @@ public class BeanDescriptor<T> implements MetaBeanInfo, BeanType<T> {
return cacheHelp.isCacheNotify();
}
public void queryCacheInit() {
cacheHelp.queryCacheInit();
}
/**
* Clear the query cache.
*/
@@ -59,7 +59,7 @@ public final class BeanDescriptorCacheHelp<T> {
private ServerCache beanCache;
private ServerCache naturalKeyCache;
private ServerCache queryCache;
private volatile ServerCache queryCache;
public BeanDescriptorCacheHelp(BeanDescriptor<T> desc, ServerCacheManager cacheManager, CacheOptions cacheOptions,
boolean cacheSharableBeans, BeanPropertyAssocOne<?>[] propertiesOneImported) {
@@ -148,6 +148,17 @@ public final class BeanDescriptorCacheHelp<T> {
return cacheOptions;
}
/**
* Initialise the query cache if required
* (as some node in the cluster already has it).
*/
public void queryCacheInit() {
if (queryCache == null) {
queryLog.debug(" init {}", cacheName);
queryCache = cacheManager.getQueryCache(beanType);
}
}
/**
* Clear the query cache.
*/