本文整理了Java中com.hazelcast.config.Config.getWanReplicationConfig()
方法的一些代码示例,展示了Config.getWanReplicationConfig()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Config.getWanReplicationConfig()
方法的具体详情如下:
包路径:com.hazelcast.config.Config
类名称:Config
方法名:getWanReplicationConfig
[英]Returns the WAN replication configuration with the given name.
[中]返回具有给定名称的WAN复制配置。
代码示例来源:origin: com.hazelcast/hazelcast-all
@Override
public WanReplicationConfig getWanReplicationConfig(String name) {
return staticConfig.getWanReplicationConfig(name);
}
代码示例来源:origin: hazelcast/hazelcast-jet
@Override
public WanReplicationConfig getWanReplicationConfig(String name) {
return staticConfig.getWanReplicationConfig(name);
}
代码示例来源:origin: com.hazelcast/hazelcast-all
@Override
public WanReplicationPublisherDelegate createNew(String name) {
final WanReplicationConfig wanReplicationConfig = node.getConfig().getWanReplicationConfig(name);
if (wanReplicationConfig == null) {
return null;
}
final List<WanPublisherConfig> publisherConfigs = wanReplicationConfig.getWanPublisherConfigs();
return new WanReplicationPublisherDelegate(name, createPublishers(wanReplicationConfig, publisherConfigs));
}
};
代码示例来源:origin: hazelcast/hazelcast-jet
@Override
public WanReplicationPublisherDelegate createNew(String name) {
final WanReplicationConfig wanReplicationConfig = node.getConfig().getWanReplicationConfig(name);
if (wanReplicationConfig == null) {
return null;
}
final List<WanPublisherConfig> publisherConfigs = wanReplicationConfig.getWanPublisherConfigs();
return new WanReplicationPublisherDelegate(name, createPublishers(wanReplicationConfig, publisherConfigs));
}
};
代码示例来源:origin: hazelcast/hazelcast-jet
private boolean canPersistWanReplicatedData(CacheConfig cacheConfig, NodeEngine nodeEngine) {
boolean persistWanReplicatedData = false;
WanReplicationRef wanReplicationRef = cacheConfig.getWanReplicationRef();
if (wanReplicationRef != null) {
String wanReplicationRefName = wanReplicationRef.getName();
Config config = nodeEngine.getConfig();
WanReplicationConfig wanReplicationConfig = config.getWanReplicationConfig(wanReplicationRefName);
if (wanReplicationConfig != null) {
WanConsumerConfig wanConsumerConfig = wanReplicationConfig.getWanConsumerConfig();
if (wanConsumerConfig != null) {
persistWanReplicatedData = wanConsumerConfig.isPersistWanReplicatedData();
}
}
}
return persistWanReplicatedData;
}
代码示例来源:origin: com.hazelcast/hazelcast-all
private boolean canPersistWanReplicatedData(CacheConfig cacheConfig, NodeEngine nodeEngine) {
boolean persistWanReplicatedData = false;
WanReplicationRef wanReplicationRef = cacheConfig.getWanReplicationRef();
if (wanReplicationRef != null) {
String wanReplicationRefName = wanReplicationRef.getName();
Config config = nodeEngine.getConfig();
WanReplicationConfig wanReplicationConfig = config.getWanReplicationConfig(wanReplicationRefName);
if (wanReplicationConfig != null) {
WanConsumerConfig wanConsumerConfig = wanReplicationConfig.getWanConsumerConfig();
if (wanConsumerConfig != null) {
persistWanReplicatedData = wanConsumerConfig.isPersistWanReplicatedData();
}
}
}
return persistWanReplicatedData;
}
代码示例来源:origin: com.hazelcast/hazelcast-all
/**
* Returns {@code true} if at least one of the WAN publishers has
* Merkle tree consistency check configured for the given WAN
* replication configuration
*
* @param config configuration
* @param wanReplicationRefName The name of the WAN replication
* @return {@code true} if there is at least one publisher has Merkle
* tree configured
*/
private boolean hasPublisherWithMerkleTreeSync(Config config, String wanReplicationRefName) {
WanReplicationConfig replicationConfig = config.getWanReplicationConfig(wanReplicationRefName);
if (replicationConfig != null) {
for (WanPublisherConfig publisherConfig : replicationConfig.getWanPublisherConfigs()) {
if (publisherConfig.getWanSyncConfig() != null
&& ConsistencyCheckStrategy.MERKLE_TREES.equals(publisherConfig.getWanSyncConfig()
.getConsistencyCheckStrategy())) {
return true;
}
}
}
return false;
}
代码示例来源:origin: hazelcast/hazelcast-jet
/**
* Returns {@code true} if at least one of the WAN publishers has
* Merkle tree consistency check configured for the given WAN
* replication configuration
*
* @param config configuration
* @param wanReplicationRefName The name of the WAN replication
* @return {@code true} if there is at least one publisher has Merkle
* tree configured
*/
private boolean hasPublisherWithMerkleTreeSync(Config config, String wanReplicationRefName) {
WanReplicationConfig replicationConfig = config.getWanReplicationConfig(wanReplicationRefName);
if (replicationConfig != null) {
for (WanPublisherConfig publisherConfig : replicationConfig.getWanPublisherConfigs()) {
if (publisherConfig.getWanSyncConfig() != null
&& ConsistencyCheckStrategy.MERKLE_TREES.equals(publisherConfig.getWanSyncConfig()
.getConsistencyCheckStrategy())) {
return true;
}
}
}
return false;
}
代码示例来源:origin: com.hazelcast/hazelcast-all
public void initWanReplication(NodeEngine nodeEngine) {
WanReplicationRef wanReplicationRef = mapConfig.getWanReplicationRef();
if (wanReplicationRef == null) {
return;
}
String wanReplicationRefName = wanReplicationRef.getName();
Config config = nodeEngine.getConfig();
if (!config.findMapMerkleTreeConfig(name).isEnabled()
&& 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();
wanReplicationPublisher = wanReplicationService.getWanReplicationPublisher(wanReplicationRefName);
wanMergePolicy = mapServiceContext.getMergePolicyProvider().getMergePolicy(wanReplicationRef.getMergePolicy());
WanReplicationConfig wanReplicationConfig = config.getWanReplicationConfig(wanReplicationRefName);
if (wanReplicationConfig != null) {
WanConsumerConfig wanConsumerConfig = wanReplicationConfig.getWanConsumerConfig();
if (wanConsumerConfig != null) {
persistWanReplicatedData = wanConsumerConfig.isPersistWanReplicatedData();
}
}
}
代码示例来源:origin: hazelcast/hazelcast-jet
public void initWanReplication(NodeEngine nodeEngine) {
WanReplicationRef wanReplicationRef = mapConfig.getWanReplicationRef();
if (wanReplicationRef == null) {
return;
}
String wanReplicationRefName = wanReplicationRef.getName();
Config config = nodeEngine.getConfig();
if (!config.findMapMerkleTreeConfig(name).isEnabled()
&& 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();
wanReplicationPublisher = wanReplicationService.getWanReplicationPublisher(wanReplicationRefName);
wanMergePolicy = mapServiceContext.getMergePolicyProvider().getMergePolicy(wanReplicationRef.getMergePolicy());
WanReplicationConfig wanReplicationConfig = config.getWanReplicationConfig(wanReplicationRefName);
if (wanReplicationConfig != null) {
WanConsumerConfig wanConsumerConfig = wanReplicationConfig.getWanConsumerConfig();
if (wanConsumerConfig != null) {
persistWanReplicatedData = wanConsumerConfig.isPersistWanReplicatedData();
}
}
}
内容来源于网络,如有侵权,请联系作者删除!