fuweng11 commented on code in PR #9933:
URL: https://github.com/apache/inlong/pull/9933#discussion_r1555485764


##########
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:
   Because we only want to keep 10 or fewer modification histories to ensure 
that the version can be rolled back after incorrect modifications.



-- 
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]

Reply via email to