public final class ConfigValidator extends Object
Modifier and Type | Method and Description |
---|---|
static void |
checkBasicConfig(AbstractBasicConfig basicConfig)
Validates the given
AbstractBasicConfig . |
static void |
checkCacheConfig(CacheSimpleConfig cacheSimpleConfig)
Validates the given
CacheSimpleConfig . |
static void |
checkCacheConfig(InMemoryFormat inMemoryFormat,
EvictionConfig evictionConfig,
boolean isStatisticsEnabled,
String mergePolicy)
Validates the given parameters in the context of a
ICache config. |
static void |
checkCollectionConfig(CollectionConfig collectionConfig)
Validates the given
CollectionConfig . |
static void |
checkEvictionConfig(EvictionConfig evictionConfig,
boolean isNearCache)
Checks if a
EvictionConfig is valid in its context. |
static void |
checkEvictionConfig(EvictionPolicy evictionPolicy,
String comparatorClassName,
Object comparator,
boolean isNearCache)
Checks if parameters for an
EvictionConfig are valid in their context. |
static void |
checkLocalUpdatePolicy(String mapName,
NearCacheConfig.LocalUpdatePolicy localUpdatePolicy)
Checks IMaps' supported Near Cache local update policy configuration.
|
static void |
checkMapConfig(MapConfig mapConfig)
Checks preconditions to create a map proxy.
|
static void |
checkMergePolicy(boolean isStatisticsEnabled,
String mergePolicy)
Throws
IllegalArgumentException if the supplied merge policy needs statistics to be enabled. |
static boolean |
checkMergePolicySupportsInMemoryFormat(String name,
String mergePolicy,
InMemoryFormat inMemoryFormat,
Version clusterVersion,
boolean failFast,
ILogger logger)
Returns
true if supplied inMemoryFormat can be merged
with the supplied mergePolicy , otherwise returns false . |
static void |
checkMultiMapConfig(MultiMapConfig multiMapConfig)
Validates the given
MultiMapConfig . |
static void |
checkNearCacheConfig(String mapName,
NearCacheConfig nearCacheConfig,
NativeMemoryConfig nativeMemoryConfig,
boolean isClient)
Checks preconditions to create a map proxy with Near Cache.
|
static void |
checkQueueConfig(QueueConfig queueConfig)
Validates the given
QueueConfig . |
static void |
checkReplicatedMapConfig(ReplicatedMapConfig replicatedMapConfig)
Validates the given
ReplicatedMapConfig . |
static void |
checkRingbufferConfig(RingbufferConfig ringbufferConfig)
Validates the given
RingbufferConfig . |
static void |
checkScheduledExecutorConfig(ScheduledExecutorConfig scheduledExecutorConfig)
Validates the given
ScheduledExecutorConfig . |
public static void checkMapConfig(MapConfig mapConfig)
mapConfig
- the MapConfig
public static void checkNearCacheConfig(String mapName, NearCacheConfig nearCacheConfig, NativeMemoryConfig nativeMemoryConfig, boolean isClient)
mapName
- name of the map that Near Cache will be created fornearCacheConfig
- the NearCacheConfig
to be checkedisClient
- true
if the config is for a Hazelcast client, false
otherwisepublic static void checkLocalUpdatePolicy(String mapName, NearCacheConfig.LocalUpdatePolicy localUpdatePolicy)
mapName
- name of the map that Near Cache will be created forlocalUpdatePolicy
- local update policypublic static void checkEvictionConfig(EvictionConfig evictionConfig, boolean isNearCache)
EvictionConfig
is valid in its context.evictionConfig
- the EvictionConfig
isNearCache
- true
if the config is for a Near Cache, false
otherwisepublic static void checkEvictionConfig(EvictionPolicy evictionPolicy, String comparatorClassName, Object comparator, boolean isNearCache)
EvictionConfig
are valid in their context.evictionPolicy
- the EvictionPolicy
for the EvictionConfig
comparatorClassName
- the comparator class name for the EvictionConfig
comparator
- the comparator implementation for the EvictionConfig
isNearCache
- true
if the config is for a Near Cache, false
otherwisepublic static void checkCacheConfig(CacheSimpleConfig cacheSimpleConfig)
CacheSimpleConfig
.cacheSimpleConfig
- the CacheSimpleConfig
to checkpublic static void checkCacheConfig(InMemoryFormat inMemoryFormat, EvictionConfig evictionConfig, boolean isStatisticsEnabled, String mergePolicy)
ICache
config.inMemoryFormat
- the in-memory format the Cache
is configured withevictionConfig
- eviction configuration of Cache
isStatisticsEnabled
- true
if statistics are enabled, false
otherwisemergePolicy
- the configured merge policypublic static boolean checkMergePolicySupportsInMemoryFormat(String name, String mergePolicy, InMemoryFormat inMemoryFormat, Version clusterVersion, boolean failFast, ILogger logger)
true
if supplied inMemoryFormat
can be merged
with the supplied mergePolicy
, otherwise returns false
.
When there is a wrong policy detected, it does one of two things: if
fail-fast option is true
and cluster version is 3.10 or later,
it throws IllegalArgumentException
otherwise prints a warning
log.
public static void checkReplicatedMapConfig(ReplicatedMapConfig replicatedMapConfig)
ReplicatedMapConfig
.replicatedMapConfig
- the ReplicatedMapConfig
to checkpublic static void checkMultiMapConfig(MultiMapConfig multiMapConfig)
MultiMapConfig
.multiMapConfig
- the MultiMapConfig
to checkpublic static void checkQueueConfig(QueueConfig queueConfig)
QueueConfig
.queueConfig
- the QueueConfig
to checkpublic static void checkCollectionConfig(CollectionConfig collectionConfig)
CollectionConfig
.collectionConfig
- the CollectionConfig
to checkpublic static void checkRingbufferConfig(RingbufferConfig ringbufferConfig)
RingbufferConfig
.ringbufferConfig
- the RingbufferConfig
to checkpublic static void checkBasicConfig(AbstractBasicConfig basicConfig)
AbstractBasicConfig
.basicConfig
- the AbstractBasicConfig
to checkpublic static void checkScheduledExecutorConfig(ScheduledExecutorConfig scheduledExecutorConfig)
ScheduledExecutorConfig
.scheduledExecutorConfig
- the ScheduledExecutorConfig
to checkpublic static void checkMergePolicy(boolean isStatisticsEnabled, String mergePolicy)
IllegalArgumentException
if the supplied merge policy needs statistics to be enabled.isStatisticsEnabled
- true
if statistics are enabled, false
otherwisemergePolicy
- the configured merge policyCopyright © 2018 Hazelcast, Inc.. All Rights Reserved.