Alon Bar-Lev has posted comments on this change.

Change subject: engine: Get Gluster Servers query
......................................................................


Patch Set 10: (4 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GetGlusterServersQuery.java
Line 71:                 NodeList listOfPeers = doc.getElementsByTagName(PEER);
Line 72: 
Line 73:                 extractServers(listOfPeers);
Line 74: 
Line 75:                 
getQueryReturnValue().setReturnValue(getServerFingerPrintMap());
I don't understand why we need so many words and variables for such small 
task...

getQueryReturnValue().setReturnValue(
    getGlusterFingerprints(doc.getElementsByTagName(PEER))
)

You do not need the this.hostNamesOrIp, as it is not really a state, you use it 
just to actually pass parameter.

You don't need this.fingerprints from the same reason.

Please try to reduce the size of this code.
Line 76:             } else {
Line 77:                 String errMsg = "Could not get the peer list form the 
host: " + getParameters().getServerName();
Line 78:                 log.error(errMsg);
Line 79:                 throw new RuntimeException(errMsg);


Line 93:             }
Line 94:         }
Line 95:     }
Line 96: 
Line 97:     private void validateFingerprint(SSHClient client) {
Any reason for this as a separate function?
Line 98:         if 
(!getParameters().getFingerprint().equals(getFingerprint(client))) {
Line 99:             String errMsg =
Line 100:                     "SSH Fingerprint of server " + 
getParameters().getServerName()
Line 101:                             + " did not match expected fingerprint " 
+ getParameters().getFingerprint();


Line 103:             throw new RuntimeException(errMsg);
Line 104:         }
Line 105:     }
Line 106: 
Line 107:     protected SSHClient createSSHClient() {
Can you please explain... just for me to understand... what is the benefit in 
such functions?
Line 108:         return new SSHClient();
Line 109:     }
Line 110: 
Line 111:     protected SSHClient connect(String serverName) {


Line 131:         client.setUser("root");
Line 132:         client.setPassword(getParameters().getRootPassword());
Line 133: 
Line 134:         try {
Line 135:             client.authenticate();
This does not belong to "executeCommand()" as you will not be able to execute 
two commands.
Line 136:             client.executeCommand(command, null, out, null);
Line 137:             cliOutput = new String(out.toByteArray(), "UTF-8");
Line 138:         } catch (Exception e) {
Line 139:             String m =


--
To view, visit http://gerrit.ovirt.org/7584
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic69a9a48bf227c8fa805c8aa9c4f08fa36ea9425
Gerrit-PatchSet: 10
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Dhandapani Gopal <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Dhandapani Gopal <[email protected]>
Gerrit-Reviewer: Kanagaraj M <[email protected]>
Gerrit-Reviewer: Michael Kublin <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Selvasundaram <[email protected]>
Gerrit-Reviewer: Shireesh Anjal <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to