use of com.hazelcast.config.InMemoryFormat in project hazelcast by hazelcast.
the class AbstractMultipleEntryOperation method nullifyOldValueIfNecessary.
/**
* Nullify old value if in memory format is object and operation is not removal
* since old and new value in fired event {@link com.hazelcast.core.EntryEvent}
* may be same due to the object in memory format.
*/
protected Object nullifyOldValueIfNecessary(Object oldValue, EntryEventType eventType) {
final MapConfig mapConfig = mapContainer.getMapConfig();
final InMemoryFormat format = mapConfig.getInMemoryFormat();
if (format == InMemoryFormat.OBJECT && eventType != EntryEventType.REMOVED) {
return null;
} else {
return oldValue;
}
}
use of com.hazelcast.config.InMemoryFormat in project hazelcast by hazelcast.
the class EntryOperation method nullifyOldValueIfNecessary.
/**
* Nullify old value if in memory format is object and operation is not removal
* since old and new value in fired event {@link com.hazelcast.core.EntryEvent}
* may be same due to the object in memory format.
*/
private void nullifyOldValueIfNecessary() {
final MapConfig mapConfig = mapContainer.getMapConfig();
final InMemoryFormat format = mapConfig.getInMemoryFormat();
if (format == InMemoryFormat.OBJECT && eventType != REMOVED) {
oldValue = null;
}
}
use of com.hazelcast.config.InMemoryFormat in project hazelcast by hazelcast.
the class AbstractClientInternalCacheProxy method checkNearCacheConfig.
private static void checkNearCacheConfig(NearCacheConfig nearCacheConfig, NativeMemoryConfig nativeMemoryConfig) {
InMemoryFormat inMemoryFormat = nearCacheConfig.getInMemoryFormat();
if (inMemoryFormat != NATIVE) {
return;
}
checkTrue(nativeMemoryConfig.isEnabled(), "Enable native memory config to use NATIVE in-memory-format for Near Cache");
}
use of com.hazelcast.config.InMemoryFormat in project hazelcast by hazelcast.
the class ConfigValidator method checkOnHeapNearCacheMaxSizePolicy.
private static void checkOnHeapNearCacheMaxSizePolicy(NearCacheConfig nearCacheConfig) {
InMemoryFormat inMemoryFormat = nearCacheConfig.getInMemoryFormat();
if (inMemoryFormat == NATIVE) {
return;
}
MaxSizePolicy maxSizePolicy = nearCacheConfig.getEvictionConfig().getMaxSizePolicy();
if (!NEAR_CACHE_SUPPORTED_ON_HEAP_MAX_SIZE_POLICIES.contains(maxSizePolicy)) {
throw new InvalidConfigurationException(format("Near Cache maximum size policy %s cannot be used with %s storage." + " Supported maximum size policies are: %s", maxSizePolicy, inMemoryFormat, NEAR_CACHE_SUPPORTED_ON_HEAP_MAX_SIZE_POLICIES));
}
}
use of com.hazelcast.config.InMemoryFormat in project hazelcast by hazelcast.
the class AbstractCacheMessageTask method getOperationProvider.
protected CacheOperationProvider getOperationProvider(String name) {
ICacheService service = getService(CacheService.SERVICE_NAME);
final CacheConfig cacheConfig = service.getCacheConfig(name);
if (cacheConfig == null) {
throw new CacheNotExistsException("Cache " + name + " is already destroyed or not created yet, on " + nodeEngine.getLocalMember());
}
final InMemoryFormat inMemoryFormat = cacheConfig.getInMemoryFormat();
return service.getCacheOperationProvider(name, inMemoryFormat);
}
Aggregations