本文整理了Java中com.hazelcast.config.Config.getHotRestartPersistenceConfig()
方法的一些代码示例,展示了Config.getHotRestartPersistenceConfig()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Config.getHotRestartPersistenceConfig()
方法的具体详情如下:
包路径:com.hazelcast.config.Config
类名称:Config
方法名:getHotRestartPersistenceConfig
[英]Returns the Hot Restart configuration for this hazelcast instance
[中]返回此hazelcast实例的热重启配置
代码示例来源:origin: hazelcast/hazelcast-jet
@Override
public HotRestartPersistenceConfig getHotRestartPersistenceConfig() {
return staticConfig.getHotRestartPersistenceConfig();
}
代码示例来源:origin: com.hazelcast/hazelcast-all
@Override
public HotRestartPersistenceConfig getHotRestartPersistenceConfig() {
return staticConfig.getHotRestartPersistenceConfig();
}
代码示例来源:origin: hazelcast/hazelcast-code-samples
private static HazelcastInstance newHazelcastInstance(int port) {
Config config = new Config();
config.setLicenseKey(ENTERPRISE_LICENSE_KEY);
config.getNetworkConfig().setPort(port).setPortAutoIncrement(false);
JoinConfig join = config.getNetworkConfig().getJoin();
join.getMulticastConfig().setEnabled(false);
join.getTcpIpConfig().setEnabled(true).clear()
.addMember("127.0.0.1:5701")
.addMember("127.0.0.1:5702");
HotRestartPersistenceConfig hotRestartConfig = config.getHotRestartPersistenceConfig();
hotRestartConfig.setEnabled(true).setBaseDir(new File(HOT_RESTART_ROOT_DIR + port));
return Hazelcast.newHazelcastInstance(config);
}
代码示例来源:origin: hazelcast/hazelcast-code-samples
private static HazelcastInstance newHazelcastInstance(int port) {
Config config = new Config();
config.setLicenseKey(ENTERPRISE_LICENSE_KEY);
config.getNetworkConfig().setPort(port).setPortAutoIncrement(false);
JoinConfig join = config.getNetworkConfig().getJoin();
join.getMulticastConfig().setEnabled(false);
join.getTcpIpConfig().setEnabled(true).clear()
.addMember("127.0.0.1:5701")
.addMember("127.0.0.1:5702");
HotRestartPersistenceConfig hotRestartConfig = config.getHotRestartPersistenceConfig();
hotRestartConfig.setEnabled(true).setBaseDir(new File(HOT_RESTART_ROOT_DIR + port));
return Hazelcast.newHazelcastInstance(config);
}
代码示例来源:origin: hazelcast/hazelcast-code-samples
public static void main(String[] args) {
IOUtil.delete(new File(HOT_RESTART_ROOT_DIR));
Config config = new Config();
config.setLicenseKey(ENTERPRISE_LICENSE_KEY);
config.getNetworkConfig().setPort(5701).setPortAutoIncrement(false);
JoinConfig join = config.getNetworkConfig().getJoin();
join.getMulticastConfig().setEnabled(false);
join.getTcpIpConfig().setEnabled(true).clear().addMember("127.0.0.1");
HotRestartPersistenceConfig hotRestartConfig = config.getHotRestartPersistenceConfig();
hotRestartConfig.setEnabled(true).setBaseDir(new File(HOT_RESTART_ROOT_DIR));
HazelcastInstance instance = Hazelcast.newHazelcastInstance(config);
Cache<Integer, String> cache = createCache(instance);
for (int i = 0; i < 10; i++) {
cache.put(i, "value" + i);
}
instance.shutdown();
instance = Hazelcast.newHazelcastInstance(config);
cache = createCache(instance);
for (int i = 0; i < 10; i++) {
System.out.println("cache.get(" + i + ") = " + cache.get(i));
}
Hazelcast.shutdownAll();
}
代码示例来源:origin: com.hazelcast/hazelcast-all
private static void hotRestartXmlGenerator(XmlGenerator gen, Config config) {
HotRestartPersistenceConfig hrCfg = config.getHotRestartPersistenceConfig();
if (hrCfg == null) {
gen.node("hot-restart-persistence", "enabled", "false");
return;
}
gen.open("hot-restart-persistence", "enabled", hrCfg.isEnabled())
.node("base-dir", hrCfg.getBaseDir().getAbsolutePath());
if (hrCfg.getBackupDir() != null) {
gen.node("backup-dir", hrCfg.getBackupDir().getAbsolutePath());
}
gen.node("parallelism", hrCfg.getParallelism())
.node("validation-timeout-seconds", hrCfg.getValidationTimeoutSeconds())
.node("data-load-timeout-seconds", hrCfg.getDataLoadTimeoutSeconds())
.node("cluster-data-recovery-policy", hrCfg.getClusterDataRecoveryPolicy())
.close();
}
代码示例来源:origin: hazelcast/hazelcast-jet
private static void hotRestartXmlGenerator(XmlGenerator gen, Config config) {
HotRestartPersistenceConfig hrCfg = config.getHotRestartPersistenceConfig();
if (hrCfg == null) {
gen.node("hot-restart-persistence", "enabled", "false");
return;
}
gen.open("hot-restart-persistence", "enabled", hrCfg.isEnabled())
.node("base-dir", hrCfg.getBaseDir().getAbsolutePath());
if (hrCfg.getBackupDir() != null) {
gen.node("backup-dir", hrCfg.getBackupDir().getAbsolutePath());
}
gen.node("parallelism", hrCfg.getParallelism())
.node("validation-timeout-seconds", hrCfg.getValidationTimeoutSeconds())
.node("data-load-timeout-seconds", hrCfg.getDataLoadTimeoutSeconds())
.node("cluster-data-recovery-policy", hrCfg.getClusterDataRecoveryPolicy())
.node("auto-remove-stale-data", hrCfg.isAutoRemoveStaleData())
.close();
}
代码示例来源:origin: hazelcast/hazelcast-jet
.setStatisticsEnabled(false);
metadataMapConfig.getMergePolicyConfig().setPolicy(IgnoreMergingEntryMapMergePolicy.class.getName());
boolean enabled = hzConfig.getHotRestartPersistenceConfig().isEnabled();
metadataMapConfig.getHotRestartConfig().setEnabled(enabled);
内容来源于网络,如有侵权,请联系作者删除!