Refine search
private static ClientConfig clientConfigForExternalHazelcast() { ClientConfig cfg = new ClientConfig(); cfg.getNetworkConfig().addAddress("localhost:6701"); cfg.getGroupConfig().setName("dev").setPassword("dev-pass"); return cfg; } }
/** * 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); }
public static String createInstanceName(Config config) { return "_hzInstance_" + FACTORY_ID_GEN.incrementAndGet() + "_" + config.getGroupConfig().getName(); }
/** * Creates a GroupConfig with the given group-name and group-password * * @param name the name of the group * @param password the password of the group * @throws IllegalArgumentException if name or password is {@code null} */ public GroupConfig(final String name, final String password) { setName(name); setPassword(password); }
private static Config defaultHazelcastConfig() { Config config = new Config(); config.getNetworkConfig().getJoin().getMulticastConfig().setMulticastPort(DEFAULT_JET_MULTICAST_PORT); config.getGroupConfig().setName(DEFAULT_GROUP_NAME); config.getGroupConfig().setPassword(DEFAULT_GROUP_PASSWORD); return config; } }
} else { if (serverMode) { Config config = new Config(); config.setProperty("hazelcast.logging.type", "log4j"); config.setInstanceName(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanContext.getName()); if (groupName != null && !groupName.isEmpty()) { config.getGroupConfig().setName(groupName); config.getGroupConfig().setPassword(groupPassword); ClientConfig clientConfig = new ClientConfig(); clientConfig.setProperty("hazelcast.logging.type", "log4j"); if (groupName != null && !groupName.isEmpty()) { clientConfig.getGroupConfig().setName(groupName); clientConfig.getGroupConfig().setPassword(groupPassword); clientConfig.setNetworkConfig(clientConfig.getNetworkConfig().addAddress(addresses.split(",")));
private Config getConfigClusterB() { Config config = new Config(); config.setLicenseKey(ENTERPRISE_LICENSE_KEY); config.getGroupConfig().setName("clusterB").setPassword("clusterB-pass"); config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false); config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(true).addMember("127.0.0.1:5702"); config.setInstanceName("clusterB"); config.getNetworkConfig().setPort(5702); config.setClassLoader(createCacheManagerClassLoader()); return config; }
public HazelcastMember build() { Config config = new Config(); config.getGroupConfig().setName("SonarQube"); NetworkConfig netConfig = config.getNetworkConfig(); netConfig .setPort(port)
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"))); }
Config cfg = new Config(); cfg.setProperty(GroupProperty.LOGGING_TYPE.getName(), "log4j"); cfg.setProperty(GroupProperty.SHUTDOWNHOOK_ENABLED.getName(), "false"); cfg.setProperty(GroupProperty.REST_ENABLED.getName(), "false"); cfg.getGroupConfig().setName(hazelcastName); cfg.getGroupConfig().setPassword(hazelcastName); cfg.getNetworkConfig().setPortAutoIncrement(false); cfg.getNetworkConfig().setPort(hazelcastPort);
public HazelcastCacheManager(KiWiConfiguration configuration) { this.configuration = configuration; hcConfiguration = new Config(); if(configuration.isClustered()) { hcConfiguration.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(true); hcConfiguration.getNetworkConfig().getJoin().getMulticastConfig().setMulticastPort(configuration.getClusterPort()); hcConfiguration.getNetworkConfig().getJoin().getMulticastConfig().setMulticastGroup(configuration.getClusterAddress()); } else { hcConfiguration.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false); } hcConfiguration.getGroupConfig().setName(configuration.getClusterName()); hcConfiguration.setClassLoader(HazelcastCacheManager.class.getClassLoader()); hcConfiguration.setProperty("hazelcast.logging.type", "slf4j"); setupSerializers(); setupCaches(); hazelcast = Hazelcast.newHazelcastInstance(hcConfiguration); if(!configuration.isClustered()) { log.info("initialised Hazelcast local cache manager"); } else { log.info("initialised Hazelcast distributed cache manager (cluster name: {})", configuration.getClusterName()); if(configuration.getCacheMode() != CacheMode.DISTRIBUTED) { log.warn("Hazelcast only supports distributed cache mode (mode configuration was {})", configuration.getCacheMode()); } } }
@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; }
protected static Config newProgrammaticConfig() { Config config = new Config(); config.setProperty("hazelcast.merge.first.run.delay.seconds", "5"); config.setProperty("hazelcast.merge.next.run.delay.seconds", "3"); config.getGroupConfig().setName(generateRandomString(10)); return config; }
private HazelcastInstance getHazelcastClientByGroupName(final String groupName) { final GroupConfig groupConfig = new GroupConfig(); groupConfig.setName(groupName); groupConfig.setPassword("dev-pass"); final ClientConfig cfg = new ClientConfig(); cfg.setGroupConfig(groupConfig); cfg.getNetworkConfig().addAddress("127.0.0.1:5701"); return HazelcastClient.newHazelcastClient(cfg); }
final Config cfg = new Config(); cfg.setInstanceName(hcInstanceName); cfg.setGroupConfig(new GroupConfig(HC_GROUP_NAME, HC_GROUP_PASSWORD));
config.getGroupConfig().setName(schema); config.getGroupConfig().setPassword(password); String[] members = address.split(","); config.getNetworkConfig().setAddresses(Arrays.asList(members)); if (smart != null) { config.getNetworkConfig().setSmartRouting(smart.equalsIgnoreCase("true"));
private void handleGroup(Node node) { for (Node n : childElements(node)) { String value = getTextContent(n).trim(); String nodeName = cleanNodeName(n); if ("name".equals(nodeName)) { clientConfig.getGroupConfig().setName(value); } else if ("password".equals(nodeName)) { clientConfig.getGroupConfig().setPassword(value); } } }
Config config = new Config(username); config.getManagementCenterConfig().setEnabled(true); config.getManagementCenterConfig().setUrl(managerUrl); 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() {
private void handleGroup(Node node) { for (Node n : childElements(node)) { String value = getTextContent(n).trim(); String nodeName = cleanNodeName(n); if ("name".equals(nodeName)) { config.getGroupConfig().setName(value); } else if ("password".equals(nodeName)) { config.getGroupConfig().setPassword(value); } } }
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");