123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- package com.ggits.etlp.server.config;
- import lombok.Data;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.boot.context.properties.ConfigurationProperties;
- import org.springframework.stereotype.Component;
- import javax.annotation.PostConstruct;
- @Slf4j
- @Data
- @Component
- @ConfigurationProperties(prefix = "application")
- public class ApplicationConfig {
- private String processId = "81010";
- private String ggitsServerIp = "192.168.24.22";
- private int dbmsWorkers = 0;
- private int dbmsQueueSize = 0;
- private boolean loggingHist = true;
- private int pageCount = 50000;
- @PostConstruct
- private void init() {
- if (this.dbmsWorkers == 0) {
- this.dbmsWorkers = Runtime.getRuntime().availableProcessors();
- if (this.dbmsWorkers == 0) this.dbmsWorkers = 1;
- }
- if (this.dbmsQueueSize <= 0) {
- this.dbmsQueueSize = 1000;
- }
- if (this.pageCount == 0) {
- this.pageCount = 10000;
- }
- if (this.pageCount < 1000) {
- this.pageCount = 1000;
- }
- this.pageCount = Math.min(100000, this.pageCount);
- log.info("[{}] -------------------------", this.getClass().getSimpleName());
- log.info("[{}] dbmsWorkers: {}", this.getClass().getSimpleName(), this.dbmsWorkers);
- log.info("[{}] dbmsQueueSize: {}", this.getClass().getSimpleName(), this.dbmsQueueSize);
- log.info("{}", super.toString());
- }
- }
|