Package io.micronaut.microstream.cache
Class MicroStreamCacheConfigurationProperties<K,V>
java.lang.Object
io.micronaut.microstream.cache.MicroStreamCacheConfigurationProperties<K,V>
- Type Parameters:
K
- Key TypeV
- Value Type
- All Implemented Interfaces:
io.micronaut.core.naming.Named
,io.micronaut.core.util.Toggleable
,MicroStreamCacheConfiguration<K,
V>
@EachProperty("microstream.cache")
public class MicroStreamCacheConfigurationProperties<K,V>
extends Object
implements MicroStreamCacheConfiguration<K,V>
- Since:
- 1.0.0
- Author:
- Sergio del Amo
-
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
Whether this cache is enabled by default.static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NonNull String
getName()
@Nullable String
boolean
@Nullable Boolean
Whether management is enabled on this cache.@Nullable Boolean
When in "read-through" mode, cache misses that occur due to cache entries not existing as a result of performing a "get" will appropriately cause the configured CacheLoader to be invoked.@Nullable Boolean
Whether statistics collection is enabled in this cache.@Nullable Boolean
When a cache is storeByValue, any mutation to the key or value does not affect the key of value stored in the cache.@Nullable Boolean
When in "write-through" mode, cache updates that occur as a result of performing "put" operations will appropriately cause the configured CacheWriter to be invoked.void
setEnabled
(boolean enabled) Whether this cache is enabled.void
setKeyType
(@Nullable Class<K> keyType) void
setManagementEnabled
(Boolean managementEnabled) Whether management is enabled on this cache.void
setReadThrough
(Boolean readThrough) When in "read-through" mode, cache misses that occur due to cache entries not existing as a result of performing a "get" will appropriately cause the configured CacheLoader to be invoked.void
setStatisticsEnabled
(Boolean statisticsEnabled) Whether statistics collection is enabled in this cache.void
setStorage
(@Nullable String storage) void
setStoreByValue
(Boolean storeByValue) When a cache is storeByValue, any mutation to the key or value does not affect the key of value stored in the cache.void
setValueType
(@Nullable Class<V> valueType) void
setWriteThrough
(Boolean writeThrough) When in "write-through" mode, cache updates that occur as a result of performing "put" operations will appropriately cause the configured CacheWriter to be invoked.When you set a Storage Manager, "write-through" mode is activated.
-
Field Details
-
PREFIX
- See Also:
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLEDWhether this cache is enabled by default.- See Also:
-
-
Constructor Details
-
MicroStreamCacheConfigurationProperties
-
-
Method Details
-
getKeyType
- Specified by:
getKeyType
in interfaceMicroStreamCacheConfiguration<K,
V> - Returns:
- The required type of keys for the Cache.
-
getValueType
- Specified by:
getValueType
in interfaceMicroStreamCacheConfiguration<K,
V> - Returns:
- Determines type of values for the Cache.
-
getStorage
- Specified by:
getStorage
in interfaceMicroStreamCacheConfiguration<K,
V> - Returns:
- Name qualifier for Storage Manager.
-
isReadThrough
Description copied from interface:MicroStreamCacheConfiguration
When in "read-through" mode, cache misses that occur due to cache entries not existing as a result of performing a "get" will appropriately cause the configured CacheLoader to be invoked.- Specified by:
isReadThrough
in interfaceMicroStreamCacheConfiguration<K,
V> - Returns:
- Whether to use "read-through" mode
-
isWriteThrough
Description copied from interface:MicroStreamCacheConfiguration
When in "write-through" mode, cache updates that occur as a result of performing "put" operations will appropriately cause the configured CacheWriter to be invoked.- Specified by:
isWriteThrough
in interfaceMicroStreamCacheConfiguration<K,
V> - Returns:
- Whether to use "write-through" mode.
-
isStoreByValue
Description copied from interface:MicroStreamCacheConfiguration
When a cache is storeByValue, any mutation to the key or value does not affect the key of value stored in the cache.- Specified by:
isStoreByValue
in interfaceMicroStreamCacheConfiguration<K,
V> - Returns:
- Whether the cache is Story by value.
-
isStatisticsEnabled
Description copied from interface:MicroStreamCacheConfiguration
Whether statistics collection is enabled in this cache.- Specified by:
isStatisticsEnabled
in interfaceMicroStreamCacheConfiguration<K,
V> - Returns:
- Whether statistics collection is enabled in this cache.
-
isManagementEnabled
Description copied from interface:MicroStreamCacheConfiguration
Whether management is enabled on this cache.- Specified by:
isManagementEnabled
in interfaceMicroStreamCacheConfiguration<K,
V> - Returns:
- Whether management is enabled on this cache.
-
getName
- Specified by:
getName
in interfaceio.micronaut.core.naming.Named
-
setKeyType
- Parameters:
keyType
- The required type of keys for the Cache.
-
setValueType
- Parameters:
valueType
- Determines type of values for the Cache.
-
setStorage
- Parameters:
storage
- Name qualifier for MicroStream Storage Manager
-
setReadThrough
When in "read-through" mode, cache misses that occur due to cache entries not existing as a result of performing a "get" will appropriately cause the configured CacheLoader to be invoked. When you set a Storage Manager, "read-through" mode is activated.- Parameters:
readThrough
- Whether to use "read-through" mode
-
setWriteThrough
When in "write-through" mode, cache updates that occur as a result of performing "put" operations will appropriately cause the configured CacheWriter to be invoked.When you set a Storage Manager, "write-through" mode is activated.- Parameters:
writeThrough
- Whether to use "write-through" mode.
-
setStoreByValue
When a cache is storeByValue, any mutation to the key or value does not affect the key of value stored in the cache.- Parameters:
storeByValue
- When a cache is storeByValue, any mutation to the key or value does not affect the key of value stored in the cache.
-
setStatisticsEnabled
Whether statistics collection is enabled in this cache.- Parameters:
statisticsEnabled
- Whether statistics collection is enabled in this cache.
-
setManagementEnabled
Whether management is enabled on this cache.- Parameters:
managementEnabled
- Whether management is enabled on this cache.
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceio.micronaut.core.util.Toggleable
-
setEnabled
public void setEnabled(boolean enabled) Whether this cache is enabled. Default Value: true- Parameters:
enabled
- Whether this cache is enabled.
-