vernedeng commented on code in PR #9933:
URL: https://github.com/apache/inlong/pull/9933#discussion_r1555440768
##########
inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/cluster/agent/AgentClusterNodeDTO.java:
##########
@@ -42,16 +51,48 @@
@ApiModel("Agent cluster node info")
public class AgentClusterNodeDTO {
+ private static final Logger LOGGER =
LoggerFactory.getLogger(AgentClusterNodeDTO.class);
+
@ApiModelProperty(value = "Agent group name")
private String agentGroup;
+ @ApiModelProperty(value = "Module id list")
+ @Default
+ private List<Integer> moduleIdList = new ArrayList<>();
+
+ @ApiModelProperty(value = "Agent restart time")
+ private Integer agentRestartTime = 0;
+
+ @ApiModelProperty(value = "Install restart time")
+ private Integer installRestartTime = 0;
+
+ @ApiModelProperty("History list of module")
+ @Default
+ private List<ModuleHistory> moduleHistoryList = new ArrayList<>();
+
/**
* Get the dto instance from the request
*/
public static AgentClusterNodeDTO getFromRequest(AgentClusterNodeRequest
request, String extParams) {
- AgentClusterNodeDTO dto = StringUtils.isNotBlank(extParams)
- ? AgentClusterNodeDTO.getFromJson(extParams)
- : new AgentClusterNodeDTO();
+ AgentClusterNodeDTO dto;
+ if (!StringUtils.isNotBlank(extParams)) {
+ return CommonBeanUtils.copyProperties(request,
AgentClusterNodeDTO::new, true);
+ }
+ dto = AgentClusterNodeDTO.getFromJson(extParams);
+ if (!CollectionUtils.isEqualCollection(request.getModuleIdList(),
dto.getModuleIdList())) {
+ request.setModuleHistoryList(dto.getModuleHistoryList());
+ List<ModuleHistory> moduleHistoryList =
request.getModuleHistoryList();
+ if (moduleHistoryList.size() > 10) {
+ moduleHistoryList.remove(moduleHistoryList.size() - 1);
Review Comment:
why remove the last module when the size bigger than 10
--
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]