use of com.hazelcast.config.GroupConfig in project hazelcast by hazelcast.
the class XmlClientConfigBuilderTest method testGroupConfig.
@Test
public void testGroupConfig() {
final GroupConfig groupConfig = clientConfig.getGroupConfig();
assertEquals("dev", groupConfig.getName());
assertEquals("dev-pass", groupConfig.getPassword());
}
use of com.hazelcast.config.GroupConfig in project hazelcast by hazelcast.
the class ProxyEqualityTest method setup.
@Before
public void setup() throws Exception {
Config config = new Config();
String groupAName = "GroupA";
config.getGroupConfig().setName(groupAName);
hazelcastFactoryGroupA.newHazelcastInstance(config);
ClientConfig clientConfig = new ClientConfig();
clientConfig.setGroupConfig(new GroupConfig(config.getGroupConfig().getName()));
client1GroupA = hazelcastFactoryGroupA.newHazelcastClient(clientConfig);
client2GroupA = hazelcastFactoryGroupA.newHazelcastClient(clientConfig);
//setup Group B
config = new Config();
String groupBName = "GroupB";
config.getGroupConfig().setName(groupBName);
hazelcastFactoryGroupB.newHazelcastInstance(config);
clientConfig = new ClientConfig();
clientConfig.setGroupConfig(new GroupConfig(config.getGroupConfig().getName()));
client1GroupB = hazelcastFactoryGroupB.newHazelcastClient(clientConfig);
}
use of com.hazelcast.config.GroupConfig in project tutorials by eugenp.
the class NativeClient method main.
public static void main(String[] args) throws InterruptedException {
ClientConfig config = new ClientConfig();
GroupConfig groupConfig = config.getGroupConfig();
groupConfig.setName("dev");
groupConfig.setPassword("dev-pass");
HazelcastInstance hazelcastInstanceClient = HazelcastClient.newHazelcastClient(config);
IMap<Long, String> map = hazelcastInstanceClient.getMap("data");
for (Entry<Long, String> entry : map.entrySet()) {
System.out.println(String.format("Key: %d, Value: %s", entry.getKey(), entry.getValue()));
}
}
use of com.hazelcast.config.GroupConfig in project eventapis by kloiasoft.
the class InMemoryComponents method config.
@Bean
public Config config() {
Config config = new Config();
List<MapIndexConfig> indexes = Arrays.asList(new MapIndexConfig("startTime", true), new MapIndexConfig("operationState", true));
config.addMapConfig(new MapConfig().setTimeToLiveSeconds(OPERATIONS_MAX_TTL_INSEC).setMapIndexConfigs(indexes).setName(OPERATIONS_MAP_NAME));
config.addMapConfig(new MapConfig().setMapIndexConfigs(indexes).setMaxSizeConfig(new MaxSizeConfig(evictFreePercentage, MaxSizeConfig.MaxSizePolicy.FREE_HEAP_PERCENTAGE)).setEvictionPolicy(EvictionPolicy.LRU).setName(OPERATIONS_MAP_HISTORY_NAME));
config.addMapConfig(new MapConfig().setName(TOPICS_MAP_NAME));
/*
config.setExecutorConfigs(Collections.singletonMap("default",new ExecutorConfig("default",2)));
config.setProperty("hazelcast.event.thread.count","2");
config.setProperty("hazelcast.operation.generic.thread.count","2");
config.setProperty("hazelcast.operation.thread.count","2");
config.setProperty("hazelcast.io.thread.count","1");
config.setProperty("hazelcast.logging.type", "slf4j");
*/
GroupConfig groupConfig = config.getGroupConfig();
groupConfig.setName(hazelcastGrid);
groupConfig.setPassword(hazelcastPassword);
if (inMemoryConfig != null) {
config.getNetworkConfig().getJoin().setMulticastConfig(inMemoryConfig);
}
if (inMemoryInterfacesConfig != null) {
config.getNetworkConfig().setInterfaces(inMemoryInterfacesConfig);
}
if (inMemoryUserCodeDeploymentConfig != null)
config.setUserCodeDeploymentConfig(inMemoryUserCodeDeploymentConfig);
config.setGroupConfig(groupConfig);
config.setInstanceName(artifactId);
return config;
}
Aggregations