本文整理了Java中com.hazelcast.config.Config.addWanReplicationConfig()
方法的一些代码示例,展示了Config.addWanReplicationConfig()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Config.addWanReplicationConfig()
方法的具体详情如下:
包路径:com.hazelcast.config.Config
类名称:Config
方法名:addWanReplicationConfig
[英]Adds the WAN replication config under the name defined by WanReplicationConfig#getName().
[中]在WanReplicationConfig#getName()定义的名称下添加WAN复制配置。
代码示例来源:origin: hazelcast/hazelcast-jet
@Override
public Config addWanReplicationConfig(WanReplicationConfig wanReplicationConfig) {
return staticConfig.addWanReplicationConfig(wanReplicationConfig);
}
代码示例来源:origin: com.hazelcast/hazelcast-all
@Override
public Config addWanReplicationConfig(WanReplicationConfig wanReplicationConfig) {
return staticConfig.addWanReplicationConfig(wanReplicationConfig);
}
代码示例来源:origin: hazelcast/hazelcast-jet
@Override
public Config addWanReplicationConfig(WanReplicationConfig wanReplicationConfig) {
return super.addWanReplicationConfig(wanReplicationConfig);
}
代码示例来源:origin: com.hazelcast/hazelcast-all
@Override
public Config addWanReplicationConfig(WanReplicationConfig wanReplicationConfig) {
return super.addWanReplicationConfig(wanReplicationConfig);
}
代码示例来源:origin: hazelcast/hazelcast-jet
private void handleWanReplication(Node node) {
Node attName = node.getAttributes().getNamedItem("name");
String name = getTextContent(attName);
WanReplicationConfig wanReplicationConfig = new WanReplicationConfig();
wanReplicationConfig.setName(name);
for (Node nodeTarget : childElements(node)) {
String nodeName = cleanNodeName(nodeTarget);
if ("wan-publisher".equals(nodeName)) {
WanPublisherConfig publisherConfig = new WanPublisherConfig();
publisherConfig.setGroupName(getAttribute(nodeTarget, "group-name"));
publisherConfig.setPublisherId(getAttribute(nodeTarget, "publisher-id"));
for (Node targetChild : childElements(nodeTarget)) {
handleWanPublisherConfig(publisherConfig, targetChild);
}
wanReplicationConfig.addWanPublisherConfig(publisherConfig);
} else if ("wan-consumer".equals(nodeName)) {
WanConsumerConfig consumerConfig = new WanConsumerConfig();
for (Node targetChild : childElements(nodeTarget)) {
handleWanConsumerConfig(consumerConfig, targetChild);
}
wanReplicationConfig.setWanConsumerConfig(consumerConfig);
}
}
config.addWanReplicationConfig(wanReplicationConfig);
}
代码示例来源:origin: com.hazelcast/hazelcast-all
private void handleWanReplication(Node node) {
Node attName = node.getAttributes().getNamedItem("name");
String name = getTextContent(attName);
WanReplicationConfig wanReplicationConfig = new WanReplicationConfig();
wanReplicationConfig.setName(name);
for (Node nodeTarget : childElements(node)) {
String nodeName = cleanNodeName(nodeTarget);
if ("wan-publisher".equals(nodeName)) {
WanPublisherConfig publisherConfig = new WanPublisherConfig();
publisherConfig.setGroupName(getAttribute(nodeTarget, "group-name"));
publisherConfig.setPublisherId(getAttribute(nodeTarget, "publisher-id"));
for (Node targetChild : childElements(nodeTarget)) {
handleWanPublisherConfig(publisherConfig, targetChild);
}
wanReplicationConfig.addWanPublisherConfig(publisherConfig);
} else if ("wan-consumer".equals(nodeName)) {
WanConsumerConfig consumerConfig = new WanConsumerConfig();
for (Node targetChild : childElements(nodeTarget)) {
handleWanConsumerConfig(consumerConfig, targetChild);
}
wanReplicationConfig.setWanConsumerConfig(consumerConfig);
}
}
config.addWanReplicationConfig(wanReplicationConfig);
}
代码示例来源:origin: hazelcast/hazelcast-code-samples
private Config getConfigClusterA() {
Config config = new Config();
config.setLicenseKey(ENTERPRISE_LICENSE_KEY);
config.getGroupConfig().setName("clusterA").setPassword("clusterA-pass");
config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(true).addMember("127.0.0.1:5701");
config.setInstanceName("clusterA");
config.getNetworkConfig().setPort(5701);
config.setClassLoader(createCacheManagerClassLoader());
WanReplicationConfig wanReplicationConfig = new WanReplicationConfig();
wanReplicationConfig.setName("AtoB");
WanPublisherConfig publisherConfigClusterB = new WanPublisherConfig();
publisherConfigClusterB.setClassName(WanBatchReplication.class.getName());
publisherConfigClusterB.setGroupName("clusterB");
Map<String, Comparable> props = publisherConfigClusterB.getProperties();
props.put(WanReplicationProperties.ENDPOINTS.key(), "127.0.0.1:5702");
props.put(WanReplicationProperties.GROUP_PASSWORD.key(), "clusterB-pass");
// setting acknowledge type is optional, defaults to ACK_ON_OPERATION_COMPLETE
props.put(WanReplicationProperties.ACK_TYPE.key(), WanAcknowledgeType.ACK_ON_OPERATION_COMPLETE.name());
wanReplicationConfig.addWanPublisherConfig(publisherConfigClusterB);
config.addWanReplicationConfig(wanReplicationConfig);
WanReplicationRef wanReplicationRef = new WanReplicationRef();
wanReplicationRef.setName("AtoB");
config.setLicenseKey(ENTERPRISE_LICENSE_KEY);
wanReplicationRef.setMergePolicy(HigherHitsCacheMergePolicy.class.getName());
wanReplicationRef.addFilter(SampleCacheWanEventFilter.class.getName());
config.getCacheConfig("default").setWanReplicationRef(wanReplicationRef);
return config;
}
内容来源于网络,如有侵权,请联系作者删除!