|
@@ -9,6 +9,7 @@ import com.ggits.comm.server.dto.IntStatusDto;
|
|
import com.ggits.comm.server.dto.RegionCenter;
|
|
import com.ggits.comm.server.dto.RegionCenter;
|
|
import com.ggits.comm.server.entity.TbProcessState;
|
|
import com.ggits.comm.server.entity.TbProcessState;
|
|
import com.ggits.comm.server.entity.TbRegionCenterComm;
|
|
import com.ggits.comm.server.entity.TbRegionCenterComm;
|
|
|
|
+import com.ggits.comm.server.kafka.KafkaProducerService;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -23,21 +24,17 @@ import java.util.concurrent.ThreadPoolExecutor;
|
|
@Service
|
|
@Service
|
|
public class DbmsDataProcess {
|
|
public class DbmsDataProcess {
|
|
|
|
|
|
- private final LinkedBlockingQueue<DbmsData> dbmsDataBlockingQueue = new LinkedBlockingQueue<>(1000);
|
|
|
|
|
|
+ private final LinkedBlockingQueue<DbmsData> dbmsDataBlockingQueue = new LinkedBlockingQueue<>(2000);
|
|
private final ThreadPoolExecutor taskExecutor = (ThreadPoolExecutor) Executors.newFixedThreadPool(1);
|
|
private final ThreadPoolExecutor taskExecutor = (ThreadPoolExecutor) Executors.newFixedThreadPool(1);
|
|
|
|
|
|
private final DbmsDataAsyncTask asyncTask;
|
|
private final DbmsDataAsyncTask asyncTask;
|
|
|
|
+ private final KafkaProducerService kafkaProducer;
|
|
private final ProcessMapper processMapper;
|
|
private final ProcessMapper processMapper;
|
|
private final RegionCenterMapper centerMapper;
|
|
private final RegionCenterMapper centerMapper;
|
|
private final SigIntDao sigIntDao;
|
|
private final SigIntDao sigIntDao;
|
|
|
|
|
|
- private int maxCore = Runtime.getRuntime().availableProcessors();
|
|
|
|
-
|
|
|
|
public void run() {
|
|
public void run() {
|
|
log.info("DbmsDataProcess.run: Start.");
|
|
log.info("DbmsDataProcess.run: Start.");
|
|
- if (this.maxCore < 8) {
|
|
|
|
- this.maxCore = 8;
|
|
|
|
- }
|
|
|
|
ThreadPoolInitializer poolInitializer = SpringUtils.getBean(ThreadPoolInitializer.class);
|
|
ThreadPoolInitializer poolInitializer = SpringUtils.getBean(ThreadPoolInitializer.class);
|
|
int executePool = poolInitializer.getDbms();
|
|
int executePool = poolInitializer.getDbms();
|
|
for (int ii = 0; ii < executePool; ii++) {
|
|
for (int ii = 0; ii < executePool; ii++) {
|
|
@@ -94,6 +91,13 @@ public class DbmsDataProcess {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
List<IntStatusDto> intStatusLists = (List<IntStatusDto>)data.getData();
|
|
List<IntStatusDto> intStatusLists = (List<IntStatusDto>)data.getData();
|
|
|
|
+ intStatusLists.forEach(status -> {
|
|
|
|
+ if (status.getNodeId() > 1000000000) {
|
|
|
|
+ this.kafkaProducer.sendNode(Long.toString(status.getNodeId()), status.getKafkaData());
|
|
|
|
+ this.kafkaProducer.sendSig(Long.toString(status.getNodeId()), status.getKafkaData());
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
cnt = this.sigIntDao.updateStatus(intStatusLists);
|
|
cnt = this.sigIntDao.updateStatus(intStatusLists);
|
|
// log.info("INT_STATUS_UPDATE: [{}, {}], {}",
|
|
// log.info("INT_STATUS_UPDATE: [{}, {}], {}",
|
|
// data.getRegionCd(), data.getRegionId(),
|
|
// data.getRegionCd(), data.getRegionId(),
|