Yair Zaslavsky has posted comments on this change.

Change subject: core: Introducing VdsValidator class
......................................................................


Patch Set 1: (3 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsNotRespondingTreatmentCommand.java
Line 50:         setVds(null);
Line 51:         if (getVds() == null) {
Line 52:             setCommandShouldBeLogged(false);
Line 53:             log.infoFormat("Host {0}({1}) not fenced since it doesn't 
exist anymore.", getVdsName(), getVdsId());
Line 54:             return;
I think it will make the code more readable, and should be added.
Line 55:         }
Line 56: 
Line 57:         validator = new VdsValidator(getVds());
Line 58:         if (validator.shouldVdsBeFenced()) {


Line 54:             return;
Line 55:         }
Line 56: 
Line 57:         validator = new VdsValidator(getVds());
Line 58:         if (validator.shouldVdsBeFenced()) {
I agree with Martin.
Line 59:             super.executeCommand();
Line 60:         } else {
Line 61:             setCommandShouldBeLogged(false);
Line 62:             log.infoFormat("Host {0}({1}) not fenced since it's status 
is ok, or it doesn't exist anymore.",


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsValidator.java
Line 4: 
Line 5: /**
Line 6:  * Contains methods used to validate VDS status to execute some 
operation on it
Line 7:  */
Line 8: public class VdsValidator {
Yaniv - see for example StoragePoolValidator and how it cleaned up the code.
You can also see MultipleStorageDomainsValidator.
Yes, maybe now it seems a bit redundant, but I think that all developers who 
write stuff for host lifecycle at engine should start moving validation code to 
VdsValidator.
Line 9:     /**
Line 10:      * Vds instance
Line 11:      */
Line 12:     private VDS vds;


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I6f8d22a148513bdbfa46b195e92bc90d66a962ba
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Peřina <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Martin Peřina <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to