Ejemplo n.º 1
0
 private Config newConfig(String mergePolicy, String mapName) {
   Config config = new Config();
   setCommonProperties(config);
   config.setProperty(GroupProperty.MERGE_FIRST_RUN_DELAY_SECONDS.getName(), "5");
   config.setProperty(GroupProperty.MERGE_NEXT_RUN_DELAY_SECONDS.getName(), "3");
   MapConfig mapConfig = config.getMapConfig(mapName);
   mapConfig.setMergePolicy(mergePolicy);
   mapConfig.setBackupCount(1);
   mapConfig.setReadBackupData(true);
   mapConfig.setStatisticsEnabled(true);
   mapConfig.setMaxIdleSeconds(0);
   mapConfig.setTimeToLiveSeconds(0);
   mapConfig.addMapIndexConfig(new MapIndexConfig("id", false));
   config.setNetworkConfig(this.getLocalhostTcpIpNetworkConfig(6701));
   config.getGroupConfig().setName(mapName);
   config.getGroupConfig().setPassword(mapName);
   return config;
 }
 private Config newConfig() {
   Config config = new Config();
   config.setProperty(GroupProperty.MERGE_FIRST_RUN_DELAY_SECONDS.getName(), "3");
   config.setProperty(GroupProperty.MERGE_NEXT_RUN_DELAY_SECONDS.getName(), "1");
   return config;
 }