[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-10132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16253130#comment-16253130
 ] 

ASF GitHub Bot commented on CLOUDSTACK-10132:
---------------------------------------------

rhtyd commented on a change in pull request #2309: CLOUDSTACK-10132: Multiple 
Management Servers Support for agents
URL: https://github.com/apache/cloudstack/pull/2309#discussion_r151064321
 
 

 ##########
 File path: agent/src/com/cloud/agent/Agent.java
 ##########
 @@ -699,16 +721,102 @@ public void processResponse(final Response response, 
final Link link) {
         }
     }
 
-    public void processReadyCommand(final Command cmd) {
+    /**
+     * Checks if received list is different to actual management server list 
(in order and size)
+     * @param actual actual list
+     * @param received received list
+     * @return true if list is updated, false if not
+     */
+    private boolean isReceivedListUpdated(List<String> actual, List<String> 
received) {
+        if (actual.size() != received.size()) {
+            return true;
+        }
+        for (int i = 0; i < received.size(); i++) {
+            if (!received.get(i).equals(actual.get(i))) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Persist newly received management servers list
+     * @param msList management servers list
+     */
+    private void persistNewManagementServersList(List<String> msList) {
+        final String newHosts = StringUtils.toCSVList(msList);
+        _shell.setHosts(newHosts);
+        _shell.setPersistentProperty(null, "host", newHosts);
+        s_logger.info("Saved new management servers list: " + msList);
+    }
+
+    /**
+     * Try reconnecting to preferred management server after new list is 
received.
+     * If connection is not performed, host counter is reset
+     */
+    private void attemptReconnectionToPrimaryHost() {
 
 Review comment:
   @nvazquez this method duplicates code and is not necessary, may be removed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Multiple Management Servers Support for agents
> ----------------------------------------------
>
>                 Key: CLOUDSTACK-10132
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10132
>             Project: CloudStack
>          Issue Type: Improvement
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>    Affects Versions: 4.11.0.0
>            Reporter: Nicolas Vazquez
>            Assignee: Nicolas Vazquez
>
> Multiple Management Servers Support for agents



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to