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

x33g5p2x  于2022-01-18 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(201)

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

Config.setGroupConfig介绍

[英]Sets the configuration for hazelcast groups. Members of a cluster must share the same group configuration. Other instances that are reachable but don't have the same group configuration will form independent clusters.
[中]设置hazelcast组的配置。群集成员必须共享相同的组配置。其他可访问但不具有相同组配置的实例将形成独立的集群。

代码示例

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

@Override
public Config setGroupConfig(GroupConfig groupConfig) {
  return staticConfig.setGroupConfig(groupConfig);
}

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

@Override
public Config setGroupConfig(GroupConfig groupConfig) {
  return staticConfig.setGroupConfig(groupConfig);
}

代码示例来源:origin: com.sitewhere/sitewhere-core

/**
 * Set up group name and password.
 * 
 * @param config
 * @param groupName
 * @param groupPassword
 */
public static void performGroupOverrides(Config config, String groupName, String groupPassword) {
GroupConfig group = config.getGroupConfig();
if (group == null) {
  group = new GroupConfig();
  config.setGroupConfig(group);
}
LOGGER.info("Hazelcast group/cluster name is '" + groupName + "'.");
group.setName(groupName);
LOGGER.info("Hazelcast group/cluster password is '" + groupPassword + "'.");
group.setPassword(groupPassword);
}

代码示例来源:origin: kloiasoft/eventapis

@Bean
public Config config() {
  Config config = new Config();
  GroupConfig groupConfig = config.getGroupConfig();
  groupConfig.setName(hazelcastGrid);
  groupConfig.setPassword(hazelcastPassword);
  config.setGroupConfig(groupConfig);
  config.setInstanceName(artifactId);
  for (HazelcastConfigurer hazelcastConfigurer : hazelcastConfigurers) {
    config = hazelcastConfigurer.configure(config);
  }
  return config;
}

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

public static void main(String[] args) {
  Config config = new Config();
  config.setGroupConfig(new GroupConfig(PagingPredicateQuery.class.getName()));
  HazelcastInstance hz = Hazelcast.newHazelcastInstance(config);
  IMap<Integer, Student> map = hz.getMap("map");

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

private Config getConfig(Config config) {
  if (config == null) {
    config = new XmlConfigBuilder().build();
  }
  GroupConfig groupConfig = config.getGroupConfig();
  if (shouldSetGroupName(groupConfig)) {
    String groupName = id;
    if (groupConfig == null) {
      config.setGroupConfig(new GroupConfig(groupName));
    } else {
      groupConfig.setName(groupName);
    }
  }
  return config;
}

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

private Config getConfig(Config config) {
  if (config == null) {
    config = new XmlConfigBuilder().build();
  }
  GroupConfig groupConfig = config.getGroupConfig();
  if (shouldSetGroupName(groupConfig)) {
    String groupName = id;
    if (groupConfig == null) {
      config.setGroupConfig(new GroupConfig(groupName));
    } else {
      groupConfig.setName(groupName);
    }
  }
  return config;
}

代码示例来源:origin: io.vertx/vertx-hazelcast

private Config createConfig() {
 return new Config()
  .setProperty("hazelcast.wait.seconds.before.join", "0")
  .setProperty("hazelcast.local.localAddress", "127.0.0.1")
  .setGroupConfig(new GroupConfig()
   .setName(System.getProperty("vertx.hazelcast.test.group.name"))
   .setPassword(System.getProperty("vertx.hazelcast.test.group.password")));
}

代码示例来源:origin: orientechnologies/spring-data-orientdb

cfg.setInstanceName(hcInstanceName);
cfg.setGroupConfig(new GroupConfig(HC_GROUP_NAME, HC_GROUP_PASSWORD));

代码示例来源:origin: rancher/cattle

groupConfig.setName(name);
groupConfig.setPassword(password);
config.setGroupConfig(groupConfig);

代码示例来源:origin: wu191287278/spring-boot-starter-dubbo

config.getManagementCenterConfig().setUpdateInterval(url.getParameter("updateInterval", 5));
config.setGroupConfig(new GroupConfig(url.getUsername() == null ? username : url.getUsername(), url.getPassword() == null ? "dubbo" : url.getPassword()));
this.hazelcastInstance = HazelcastInstanceFactory.getOrCreateHazelcastInstance(config);
this.hazelcastInstance.getCluster().addMembershipListener(new MembershipListener() {

相关文章

Config类方法