use of com.dtp.common.config.ThreadPoolProperties in project dynamic-tp by dromara.
the class DtpRegistry method run.
@Override
public void run(ApplicationArguments args) {
Set<String> remoteExecutors = Collections.emptySet();
if (CollUtil.isNotEmpty(dtpProperties.getExecutors())) {
remoteExecutors = dtpProperties.getExecutors().stream().map(ThreadPoolProperties::getThreadPoolName).collect(Collectors.toSet());
}
val registeredDtpExecutors = Sets.newHashSet(DTP_REGISTRY.keySet());
val localDtpExecutors = CollUtil.subtract(registeredDtpExecutors, remoteExecutors);
val localCommonExecutors = COMMON_REGISTRY.keySet();
log.info("DtpRegistry initialization end, remote dtpExecutors: {}, local dtpExecutors: {}," + " local commonExecutors: {}", remoteExecutors, localDtpExecutors, localCommonExecutors);
if (CollUtil.isEmpty(dtpProperties.getPlatforms())) {
log.warn("DtpRegistry initialization end, no notify platforms configured.");
DTP_REGISTRY.forEach((k, v) -> v.setNotifyItems(Collections.emptyList()));
return;
}
DTP_REGISTRY.forEach((k, v) -> {
NotifyHelper.fillPlatforms(dtpProperties.getPlatforms(), v.getNotifyItems());
v.getNotifyItems().forEach(x -> {
AlarmLimiter.initAlarmLimiter(k, x);
AlarmCounter.init(k, x.getType());
});
});
}
Aggregations