use of com.hazelcast.config.InvalidConfigurationException in project hazelcast by hazelcast.
the class MapContainer method initWanReplication.
public void initWanReplication(NodeEngine nodeEngine) {
WanReplicationRef wanReplicationRef = mapConfig.getWanReplicationRef();
if (wanReplicationRef == null) {
return;
}
String wanReplicationRefName = wanReplicationRef.getName();
Config config = nodeEngine.getConfig();
if (!TRUE.equals(mapConfig.getMerkleTreeConfig().getEnabled()) && hasPublisherWithMerkleTreeSync(config, wanReplicationRefName)) {
throw new InvalidConfigurationException("Map " + name + " has disabled merkle trees but the WAN replication scheme " + wanReplicationRefName + " has publishers that use merkle trees." + " Please enable merkle trees for the map.");
}
WanReplicationService wanReplicationService = nodeEngine.getWanReplicationService();
wanReplicationDelegate = wanReplicationService.getWanReplicationPublishers(wanReplicationRefName);
SplitBrainMergePolicyProvider mergePolicyProvider = nodeEngine.getSplitBrainMergePolicyProvider();
wanMergePolicy = mergePolicyProvider.getMergePolicy(wanReplicationRef.getMergePolicyClassName());
checkMapMergePolicy(mapConfig, wanReplicationRef.getMergePolicyClassName(), mergePolicyProvider);
WanReplicationConfig wanReplicationConfig = config.getWanReplicationConfig(wanReplicationRefName);
if (wanReplicationConfig != null) {
WanConsumerConfig wanConsumerConfig = wanReplicationConfig.getConsumerConfig();
if (wanConsumerConfig != null) {
persistWanReplicatedData = wanConsumerConfig.isPersistWanReplicatedData();
}
}
}
use of com.hazelcast.config.InvalidConfigurationException in project hazelcast by hazelcast.
the class RegionValidatorTest method validateInvalidRegion.
@Test
public void validateInvalidRegion() {
// given
String region = "us-wrong-1";
String expectedMessage = String.format("The provided region %s is not a valid AWS region.", region);
// when
Runnable validateRegion = () -> RegionValidator.validateRegion(region);
// then
InvalidConfigurationException thrownEx = assertThrows(InvalidConfigurationException.class, validateRegion);
assertEquals(expectedMessage, thrownEx.getMessage());
}
use of com.hazelcast.config.InvalidConfigurationException in project hazelcast by hazelcast.
the class RegionValidatorTest method validateInvalidGovRegion.
@Test
public void validateInvalidGovRegion() {
// given
String region = "us-gov-wrong-1";
String expectedMessage = String.format("The provided region %s is not a valid AWS region.", region);
// when
Runnable validateRegion = () -> RegionValidator.validateRegion(region);
// then
InvalidConfigurationException thrownEx = assertThrows(InvalidConfigurationException.class, validateRegion);
assertEquals(expectedMessage, thrownEx.getMessage());
}
Aggregations