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:
Galder Zamarreño 2010-12-20 11:00:45 +01:00
parent 4fa467a8a4
commit 863864fcce
2 changed files with 6 additions and 3 deletions

View File

@ -50,12 +50,12 @@ public class CacheHelper {
public static void initInternalEvict(CacheAdapter cacheAdapter, AddressAdapter 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) {
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) {

View File

@ -36,7 +36,8 @@ public enum FlagAdapter {
CACHE_MODE_LOCAL,
FORCE_ASYNCHRONOUS,
FORCE_SYNCHRONOUS,
SKIP_CACHE_STORE;
SKIP_CACHE_STORE,
SKIP_CACHE_LOAD;
Flag toFlag() {
switch(this) {
@ -50,6 +51,8 @@ public enum FlagAdapter {
return Flag.FORCE_SYNCHRONOUS;
case SKIP_CACHE_STORE:
return Flag.SKIP_CACHE_STORE;
case SKIP_CACHE_LOAD:
return Flag.SKIP_CACHE_LOAD;
default:
throw new CacheException("Unmatched Infinispan flag " + this);
}