fuweng11 commented on code in PR #9933:
URL: https://github.com/apache/inlong/pull/9933#discussion_r1554943565
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/AgentServiceImpl.java:
##########
@@ -778,4 +825,53 @@ private List<StreamSourceEntity> fetchTask(TaskRequest
request) {
return taskLists;
}
+ private ConfigResult loadModuleConfigs(ConfigRequest request) {
+ final String clusterName = request.getClusterName();
+ final String ip = request.getLocalIp();
+ LOGGER.debug("begin to load config for installer = {}", request);
+ Preconditions.expectTrue(StringUtils.isNotBlank(clusterName), "cluster
name is blank");
+ InlongClusterEntity clusterEntity =
clusterMapper.selectByNameAndType(clusterName, ClusterType.AGENT);
+ List<InlongClusterNodeEntity> clusterNodeEntityList =
+ clusterNodeMapper.selectByParentIdAndIp(clusterEntity.getId(),
ip);
+ List<ModuleConfig> configs = new ArrayList<>();
+ if (CollectionUtils.isNotEmpty(clusterNodeEntityList)) {
+ AgentClusterNodeDTO dto =
AgentClusterNodeDTO.getFromJson(clusterNodeEntityList.get(0).getExtParams());
+ List<Integer> moduleList = dto.getModuleIdList();
+ if (CollectionUtils.isNotEmpty(moduleList)) {
+ for (Integer mdId : moduleList) {
+ ModuleConfigEntity moduleConfigEntity =
moduleConfigEntityMapper.selectByPrimaryKey(mdId);
+ ModuleConfig moduleConfig =
CommonBeanUtils.copyProperties(moduleConfigEntity, ModuleConfig::new);
+
moduleConfig.setId(moduleNameIdMap.getOrDefault(moduleConfigEntity.getName(),
1));
+ PackageConfigEntity packageConfigEntity =
+
packageConfigEntityMapper.selectByPrimaryKey(moduleConfigEntity.getPackageId());
+ moduleConfig
+
.setPackageConfig(CommonBeanUtils.copyProperties(packageConfigEntity,
PackageConfig::new));
+ ModuleDTO moduleDTO =
JsonUtils.parseObject(moduleConfigEntity.getExtParams(), ModuleDTO.class);
+ moduleConfig = CommonBeanUtils.copyProperties(moduleDTO,
moduleConfig, true);
+ Integer restartTime = 0;
+ if (Objects.equals(moduleConfigEntity.getType(),
ModuleType.AGENT.name())) {
Review Comment:
Because it needs to be decided whether to restart the agent or installer.
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/AgentServiceImpl.java:
##########
@@ -778,4 +825,53 @@ private List<StreamSourceEntity> fetchTask(TaskRequest
request) {
return taskLists;
}
+ private ConfigResult reloadModuleConfigs(ConfigRequest request) {
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]