com.hazelcast.config.QuorumConfig.setName()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(73)

本文整理了Java中com.hazelcast.config.QuorumConfig.setName方法的一些代码示例,展示了QuorumConfig.setName的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QuorumConfig.setName方法的具体详情如下:
包路径:com.hazelcast.config.QuorumConfig
类名称:QuorumConfig
方法名:setName

QuorumConfig.setName介绍

暂无

代码示例

代码示例来源:origin: hazelcast/hazelcast-jet

/**
 * Sets the map of split-brain protection configurations, mapped by config
 * name. The config name may be a pattern with which the configuration
 * will be obtained in the future.
 *
 * @param quorumConfigs the split-brain protection configuration map to set
 * @return this config instance
 */
public Config setQuorumConfigs(Map<String, QuorumConfig> quorumConfigs) {
  this.quorumConfigs.clear();
  this.quorumConfigs.putAll(quorumConfigs);
  for (final Entry<String, QuorumConfig> entry : this.quorumConfigs.entrySet()) {
    entry.getValue().setName(entry.getKey());
  }
  return this;
}

代码示例来源:origin: com.hazelcast/hazelcast-all

/**
 * Sets the map of split-brain protection configurations, mapped by config
 * name. The config name may be a pattern with which the configuration
 * will be obtained in the future.
 *
 * @param quorumConfigs the split-brain protection configuration map to set
 * @return this config instance
 */
public Config setQuorumConfigs(Map<String, QuorumConfig> quorumConfigs) {
  this.quorumConfigs.clear();
  this.quorumConfigs.putAll(quorumConfigs);
  for (final Entry<String, QuorumConfig> entry : this.quorumConfigs.entrySet()) {
    entry.getValue().setName(entry.getKey());
  }
  return this;
}

代码示例来源:origin: hazelcast/hazelcast-code-samples

private static QuorumConfig memberCountQuorumConfig() {
  QuorumConfig quorumConfig = new QuorumConfig();
  quorumConfig.setName(NAME).setEnabled(true).setSize(2);
  return quorumConfig;
}

代码示例来源:origin: hazelcast/hazelcast-jet

public QuorumConfig build() {
    ProbabilisticQuorumFunction quorumFunction = new ProbabilisticQuorumFunction(size, heartbeatIntervalMillis,
        acceptableHeartbeatPauseMillis, maxSampleSize, minStdDeviationMillis, phiThreshold);

    QuorumConfig config = new QuorumConfig();
    config.setName(name);
    config.setEnabled(enabled);
    config.setSize(size);
    config.setQuorumFunctionImplementation(quorumFunction);
    return config;
  }
}

代码示例来源:origin: com.hazelcast/hazelcast-all

public QuorumConfig build() {
    ProbabilisticQuorumFunction quorumFunction = new ProbabilisticQuorumFunction(size, heartbeatIntervalMillis,
        acceptableHeartbeatPauseMillis, maxSampleSize, minStdDeviationMillis, phiThreshold);

    QuorumConfig config = new QuorumConfig();
    config.setName(name);
    config.setEnabled(enabled);
    config.setSize(size);
    config.setQuorumFunctionImplementation(quorumFunction);
    return config;
  }
}

代码示例来源:origin: hazelcast/hazelcast-code-samples

public static void main(String[] args) throws Exception {
  QuorumConfig quorumConfig = new QuorumConfig();
  quorumConfig.setName(NAME)
        .setEnabled(true)
        .setSize(2)

代码示例来源:origin: hazelcast/hazelcast-jet

private void handleQuorum(Node node) {
  QuorumConfig quorumConfig = new QuorumConfig();
  String name = getAttribute(node, "name");
  quorumConfig.setName(name);
  Node attrEnabled = node.getAttributes().getNamedItem("enabled");
  boolean enabled = attrEnabled != null && getBooleanValue(getTextContent(attrEnabled));

代码示例来源:origin: com.hazelcast/hazelcast-all

private void handleQuorum(Node node) {
  QuorumConfig quorumConfig = new QuorumConfig();
  String name = getAttribute(node, "name");
  quorumConfig.setName(name);
  Node attrEnabled = node.getAttributes().getNamedItem("enabled");
  boolean enabled = attrEnabled != null && getBooleanValue(getTextContent(attrEnabled));

相关文章