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

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

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

QuorumConfig.getName介绍

暂无

代码示例

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

/**
 * Adds the split-brain protection configuration.
 * The configuration is saved under the config name defined by
 * {@link QuorumConfig#getName()}.
 *
 * @param quorumConfig split-brain protection config to add
 * @return this config instance
 */
public Config addQuorumConfig(QuorumConfig quorumConfig) {
  quorumConfigs.put(quorumConfig.getName(), quorumConfig);
  return this;
}

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

/**
 * Adds the split-brain protection configuration.
 * The configuration is saved under the config name defined by
 * {@link QuorumConfig#getName()}.
 *
 * @param quorumConfig split-brain protection config to add
 * @return this config instance
 */
public Config addQuorumConfig(QuorumConfig quorumConfig) {
  quorumConfigs.put(quorumConfig.getName(), quorumConfig);
  return this;
}

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

private Map<String, QuorumImpl> initializeQuorums() {
  Map<String, QuorumImpl> quorums = new HashMap<String, QuorumImpl>();
  for (QuorumConfig quorumConfig : nodeEngine.getConfig().getQuorumConfigs().values()) {
    validateQuorumConfig(quorumConfig);
    QuorumImpl quorum = new QuorumImpl(quorumConfig, nodeEngine);
    quorums.put(quorumConfig.getName(), quorum);
  }
  return quorums;
}

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

private Map<String, QuorumImpl> initializeQuorums() {
  Map<String, QuorumImpl> quorums = new HashMap<String, QuorumImpl>();
  for (QuorumConfig quorumConfig : nodeEngine.getConfig().getQuorumConfigs().values()) {
    validateQuorumConfig(quorumConfig);
    QuorumImpl quorum = new QuorumImpl(quorumConfig, nodeEngine);
    quorums.put(quorumConfig.getName(), quorum);
  }
  return quorums;
}

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

QuorumImpl(QuorumConfig config, NodeEngineImpl nodeEngine) {
  this.nodeEngine = nodeEngine;
  this.eventService = nodeEngine.getEventService();
  this.config = config;
  this.quorumName = config.getName();
  this.size = config.getSize();
  this.quorumFunction = initializeQuorumFunction();
  this.heartbeatAwareQuorumFunction = (quorumFunction instanceof HeartbeatAware);
  this.membershipListenerQuorumFunction = (quorumFunction instanceof MembershipListener);
  this.pingAwareQuorumFunction = (quorumFunction instanceof PingAware);
}

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

QuorumImpl(QuorumConfig config, NodeEngineImpl nodeEngine) {
  this.nodeEngine = nodeEngine;
  this.eventService = nodeEngine.getEventService();
  this.config = config;
  this.quorumName = config.getName();
  this.size = config.getSize();
  this.quorumFunction = initializeQuorumFunction();
  this.heartbeatAwareQuorumFunction = (quorumFunction instanceof HeartbeatAware);
  this.membershipListenerQuorumFunction = (quorumFunction instanceof MembershipListener);
  this.pingAwareQuorumFunction = (quorumFunction instanceof PingAware);
}

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

private void validateQuorumConfig(QuorumConfig quorumConfig) {
  if (quorumConfig.getQuorumFunctionImplementation() == null) {
    return;
  }
  QuorumFunction quorumFunction = quorumConfig.getQuorumFunctionImplementation();
  if (quorumFunction instanceof ProbabilisticQuorumFunction) {
    validateQuorumParameters(quorumConfig.getName(),
        ((ProbabilisticQuorumFunction) quorumFunction).getAcceptableHeartbeatPauseMillis(),
        "acceptable heartbeat pause");
  } else if (quorumFunction instanceof RecentlyActiveQuorumFunction) {
    validateQuorumParameters(quorumConfig.getName(),
        ((RecentlyActiveQuorumFunction) quorumFunction).getHeartbeatToleranceMillis(),
        "heartbeat tolerance");
  }
}

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

private void validateQuorumConfig(QuorumConfig quorumConfig) {
  if (quorumConfig.getQuorumFunctionImplementation() == null) {
    return;
  }
  QuorumFunction quorumFunction = quorumConfig.getQuorumFunctionImplementation();
  if (quorumFunction instanceof ProbabilisticQuorumFunction) {
    validateQuorumParameters(quorumConfig.getName(),
        ((ProbabilisticQuorumFunction) quorumFunction).getAcceptableHeartbeatPauseMillis(),
        "acceptable heartbeat pause");
  } else if (quorumFunction instanceof RecentlyActiveQuorumFunction) {
    validateQuorumParameters(quorumConfig.getName(),
        ((RecentlyActiveQuorumFunction) quorumFunction).getHeartbeatToleranceMillis(),
        "heartbeat tolerance");
  }
}

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

private static void quorumXmlGenerator(XmlGenerator gen, Config config) {
  for (QuorumConfig quorumConfig : config.getQuorumConfigs().values()) {
    gen.open("quorum", "name", quorumConfig.getName(),
        "enabled", quorumConfig.isEnabled())
        .node("quorum-size", quorumConfig.getSize())
        .node("quorum-type", quorumConfig.getType());
    if (!quorumConfig.getListenerConfigs().isEmpty()) {
      gen.open("quorum-listeners");
      for (QuorumListenerConfig listenerConfig : quorumConfig.getListenerConfigs()) {
        gen.node("quorum-listener", classNameOrImplClass(listenerConfig.getClassName(),
            listenerConfig.getImplementation()));
      }
      gen.close();
    }
    handleQuorumFunction(gen, quorumConfig);
    gen.close();
  }
}

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

private static void quorumXmlGenerator(XmlGenerator gen, Config config) {
  for (QuorumConfig quorumConfig : config.getQuorumConfigs().values()) {
    gen.open("quorum", "name", quorumConfig.getName(),
        "enabled", quorumConfig.isEnabled())
        .node("quorum-size", quorumConfig.getSize())
        .node("quorum-type", quorumConfig.getType());
    if (!quorumConfig.getListenerConfigs().isEmpty()) {
      gen.open("quorum-listeners");
      for (QuorumListenerConfig listenerConfig : quorumConfig.getListenerConfigs()) {
        gen.node("quorum-listener", classNameOrImplClass(listenerConfig.getClassName(),
            listenerConfig.getImplementation()));
      }
      gen.close();
    }
    handleQuorumFunction(gen, quorumConfig);
    gen.close();
  }
}

相关文章