imdg settings: imdg.hazelcast.instance-name/imdg.hazelcast.db-sync-seconds/imdg.database.min-pool-size/imdg.database.max-pool-size
This commit is contained in:
parent
2a400e1a8a
commit
5ad1b0d569
6 changed files with 47 additions and 6 deletions
|
|
@ -41,9 +41,9 @@ public class DbConnectionConfig {
|
||||||
cpds.setJdbcUrl(dbPath);
|
cpds.setJdbcUrl(dbPath);
|
||||||
cpds.setUser(login);
|
cpds.setUser(login);
|
||||||
cpds.setPassword(password);
|
cpds.setPassword(password);
|
||||||
cpds.setInitialPoolSize(10);
|
cpds.setInitialPoolSize(settings.getMinPoolSize());
|
||||||
cpds.setMinPoolSize(10);
|
cpds.setMinPoolSize(settings.getMinPoolSize());
|
||||||
cpds.setMaxPoolSize(30);
|
cpds.setMaxPoolSize(settings.getMaxPoolSize());
|
||||||
int numHelperThreads = Runtime.getRuntime().availableProcessors() * 2;
|
int numHelperThreads = Runtime.getRuntime().availableProcessors() * 2;
|
||||||
cpds.setNumHelperThreads(numHelperThreads);
|
cpds.setNumHelperThreads(numHelperThreads);
|
||||||
cpds.setCheckoutTimeout(timeoutSec * 1000);
|
cpds.setCheckoutTimeout(timeoutSec * 1000);
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,12 @@ public class HazelcastConfiguration {
|
||||||
@Bean
|
@Bean
|
||||||
public Config hazelCastConfig() {
|
public Config hazelCastConfig() {
|
||||||
Config config = new Config();
|
Config config = new Config();
|
||||||
config.setInstanceName("instance");
|
config.setInstanceName(hzSettings.getInstanceName());
|
||||||
config.setGroupConfig(new GroupConfig()
|
config.setGroupConfig(new GroupConfig()
|
||||||
.setName(hzSettings.getLogin())
|
.setName(hzSettings.getLogin())
|
||||||
.setPassword(hzSettings.getPassword())
|
.setPassword(hzSettings.getPassword())
|
||||||
);
|
);
|
||||||
|
config.setManagementCenterConfig(new ManagementCenterConfig().setEnabled(false));
|
||||||
config.setProperty("hazelcast.shutdownhook.enabled", "true");
|
config.setProperty("hazelcast.shutdownhook.enabled", "true");
|
||||||
config.setProperty("hazelcast.logging.type", "slf4j");
|
config.setProperty("hazelcast.logging.type", "slf4j");
|
||||||
config.setProperty("hazelcast.operation.call.timeout.millis", "600000");
|
config.setProperty("hazelcast.operation.call.timeout.millis", "600000");
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ public class PoolMapConfigs implements InitializingBean {
|
||||||
private MapStoreConfig makeDefaultMapStoreConfig(MapLoader<Long, ?> mapBean) {
|
private MapStoreConfig makeDefaultMapStoreConfig(MapLoader<Long, ?> mapBean) {
|
||||||
return new MapStoreConfig()
|
return new MapStoreConfig()
|
||||||
.setImplementation(mapBean)
|
.setImplementation(mapBean)
|
||||||
;//todo config: .setWriteDelaySeconds(configRoot.getIMDG().getDbSyncSeconds());
|
.setWriteDelaySeconds(settings.getHazelcast().getDbSyncSeconds());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ScheduledExecutorConfig makeDefaultScheduledExecutorConfig(String name) {
|
public ScheduledExecutorConfig makeDefaultScheduledExecutorConfig(String name) {
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ public class DatabaseSettings {
|
||||||
private String login;
|
private String login;
|
||||||
private String password;
|
private String password;
|
||||||
private String url;
|
private String url;
|
||||||
|
private int minPoolSize = 10;
|
||||||
|
private int maxPoolSize = 30;
|
||||||
|
|
||||||
public String getLogin() {
|
public String getLogin() {
|
||||||
return login;
|
return login;
|
||||||
|
|
@ -28,4 +30,20 @@ public class DatabaseSettings {
|
||||||
public void setUrl(String url) {
|
public void setUrl(String url) {
|
||||||
this.url = url;
|
this.url = url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getMaxPoolSize() {
|
||||||
|
return maxPoolSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxPoolSize(int maxPoolSize) {
|
||||||
|
this.maxPoolSize = maxPoolSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMinPoolSize() {
|
||||||
|
return minPoolSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMinPoolSize(int minPoolSize) {
|
||||||
|
this.minPoolSize = minPoolSize;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ public class HazelcastServerSettings {
|
||||||
private String password;
|
private String password;
|
||||||
private List<String> clusterMembers;
|
private List<String> clusterMembers;
|
||||||
private Integer backupCount;
|
private Integer backupCount;
|
||||||
|
private String instanceName = "instance";
|
||||||
|
private Integer dbSyncSeconds = 10;
|
||||||
|
|
||||||
public int getListenPort() {
|
public int getListenPort() {
|
||||||
return listenPort;
|
return listenPort;
|
||||||
|
|
@ -49,4 +51,20 @@ public class HazelcastServerSettings {
|
||||||
public void setBackupCount(Integer backupCount) {
|
public void setBackupCount(Integer backupCount) {
|
||||||
this.backupCount = backupCount;
|
this.backupCount = backupCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getInstanceName() {
|
||||||
|
return instanceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInstanceName(String instanceName) {
|
||||||
|
this.instanceName = instanceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getDbSyncSeconds() {
|
||||||
|
return dbSyncSeconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDbSyncSeconds(Integer dbSyncSeconds) {
|
||||||
|
this.dbSyncSeconds = dbSyncSeconds;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,11 @@ imdg.hazelcast.login=dev
|
||||||
imdg.hazelcast.password=dev-pass
|
imdg.hazelcast.password=dev-pass
|
||||||
imdg.hazelcast.cluster-members[0]=127.0.0.1
|
imdg.hazelcast.cluster-members[0]=127.0.0.1
|
||||||
imdg.hazelcast.backup-count=3
|
imdg.hazelcast.backup-count=3
|
||||||
|
imdg.hazelcast.instance-name=instance
|
||||||
|
imdg.hazelcast.db-sync-seconds=10;
|
||||||
imdg.database.login=clearing
|
imdg.database.login=clearing
|
||||||
imdg.database.password=Aa111111
|
imdg.database.password=Aa111111
|
||||||
imdg.database.url=jdbc:postgresql://10.200.200.133:5432/clearing?currentSchema=clearing_prod
|
imdg.database.url=jdbc:postgresql://10.200.200.133:5432/clearing?currentSchema=clearing_prod
|
||||||
#imdg.database.url=jdbc:postgresql://10.200.200.133:5432/postgres?currentSchema=clearing_tester
|
#imdg.database.url=jdbc:postgresql://10.200.200.133:5432/postgres?currentSchema=clearing_tester
|
||||||
|
imdg.database.min-pool-size=10
|
||||||
|
imdg.database.max-pool-size=30
|
||||||
Loading…
Add table
Reference in a new issue