HHH-5793 - Query and timestamp caches to use cluster cache loader
Make evict put calls skip the cache loader since previous value is not needed.
This commit is contained in:
parent
4fa467a8a4
commit
863864fcce
|
@ -50,12 +50,12 @@ public class CacheHelper {
|
||||||
|
|
||||||
public static void initInternalEvict(CacheAdapter cacheAdapter, AddressAdapter member) {
|
public static void initInternalEvict(CacheAdapter cacheAdapter, AddressAdapter member) {
|
||||||
EvictAll eKey = new EvictAll(member == null ? NoAddress.INSTANCE : member);
|
EvictAll eKey = new EvictAll(member == null ? NoAddress.INSTANCE : member);
|
||||||
cacheAdapter.withFlags(FlagAdapter.CACHE_MODE_LOCAL).put(eKey, Internal.INIT);
|
cacheAdapter.withFlags(FlagAdapter.CACHE_MODE_LOCAL, FlagAdapter.SKIP_CACHE_LOAD).put(eKey, Internal.INIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sendEvictAllNotification(CacheAdapter cacheAdapter, AddressAdapter member) {
|
public static void sendEvictAllNotification(CacheAdapter cacheAdapter, AddressAdapter member) {
|
||||||
EvictAll eKey = new EvictAll(member == null ? NoAddress.INSTANCE : member);
|
EvictAll eKey = new EvictAll(member == null ? NoAddress.INSTANCE : member);
|
||||||
cacheAdapter.put(eKey, Internal.EVICT);
|
cacheAdapter.withFlags(FlagAdapter.SKIP_CACHE_LOAD).put(eKey, Internal.EVICT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isEvictAllNotification(Object key) {
|
public static boolean isEvictAllNotification(Object key) {
|
||||||
|
|
|
@ -36,7 +36,8 @@ public enum FlagAdapter {
|
||||||
CACHE_MODE_LOCAL,
|
CACHE_MODE_LOCAL,
|
||||||
FORCE_ASYNCHRONOUS,
|
FORCE_ASYNCHRONOUS,
|
||||||
FORCE_SYNCHRONOUS,
|
FORCE_SYNCHRONOUS,
|
||||||
SKIP_CACHE_STORE;
|
SKIP_CACHE_STORE,
|
||||||
|
SKIP_CACHE_LOAD;
|
||||||
|
|
||||||
Flag toFlag() {
|
Flag toFlag() {
|
||||||
switch(this) {
|
switch(this) {
|
||||||
|
@ -50,6 +51,8 @@ public enum FlagAdapter {
|
||||||
return Flag.FORCE_SYNCHRONOUS;
|
return Flag.FORCE_SYNCHRONOUS;
|
||||||
case SKIP_CACHE_STORE:
|
case SKIP_CACHE_STORE:
|
||||||
return Flag.SKIP_CACHE_STORE;
|
return Flag.SKIP_CACHE_STORE;
|
||||||
|
case SKIP_CACHE_LOAD:
|
||||||
|
return Flag.SKIP_CACHE_LOAD;
|
||||||
default:
|
default:
|
||||||
throw new CacheException("Unmatched Infinispan flag " + this);
|
throw new CacheException("Unmatched Infinispan flag " + this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue