anmolbabu has posted comments on this change.

Change subject: webadmin, engine : Error handling in geo-rep create
......................................................................


Patch Set 3:

(4 comments)

https://gerrit.ovirt.org/#/c/42300/3/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java:

Line 2187:     protected VdcReturnValueBase convertToVdcReturnValueBase(final 
VDSReturnValue vdsReturnValue) {
Line 2188:         VdcReturnValueBase returnValue = new VdcReturnValueBase();
Line 2189:         returnValue.setSucceeded(false);
Line 2190:         
returnValue.setActionReturnValue(vdsReturnValue.getReturnValue());
Line 2191:         returnValue.setExecuteFailedMessages(new ArrayList<String>()
> if that list is expected to be unmodifiable you can use Collestions.singlet
Done
Line 2192:                 {{
Line 2193:                     add(vdsReturnValue.getVdsError().getMessage());
Line 2194:                     }}
Line 2195:         );


https://gerrit.ovirt.org/#/c/42300/3/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeGeoRepSessionCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeGeoRepSessionCommand.java:

Line 127:         boolean rootSession = 
getParameters().getUserName().equalsIgnoreCase("root");
Line 128:         boolean succeeded = true;
Line 129:         Set<Guid> remoteServerIds = getServerIds(remoteServersSet);
Line 130:         Guid slaveHostId = getParameters().getSlaveHostId();
Line 131:         if (!rootSession) {
> please use formatter. lines are too long.
Done
Line 132:             VdcReturnValueBase mountBrokerOnSlaveReturnValue = 
setUpMountBrokerOnSlave();
Line 133:             succeeded = 
evaluateReturnValues(AuditLogType.GLUSTER_GEOREP_SETUP_MOUNT_BROKER_FAILED, 
Collections.singletonList(mountBrokerOnSlaveReturnValue));
Line 134:             remoteServerIds.remove(slaveHostId);
Line 135:             if (succeeded) {


Line 281: String
> please use diamond on the right side <> (no need to redeclare the type)
Done


Line 280:         boolean succeeded = true;
Line 281:         List<String> errors = new ArrayList<String>();
Line 282:         for (VdcReturnValueBase currentReturnValue : returnValues) {
Line 283:             boolean currentExecutionStatus = 
currentReturnValue.getSucceeded();
Line 284:             succeeded &= currentExecutionStatus;
> why bitwise operator ?
You are right although both logical and bitwise work same way on booleans, it 
makes sense to use logical so that there is advantage of short-circuit. I'll 
change it in my next patch set.
Line 285:             if (!currentExecutionStatus) {
Line 286:                 
errors.addAll(currentReturnValue.getExecuteFailedMessages());
Line 287:             }
Line 288:         }


-- 
To view, visit https://gerrit.ovirt.org/42300
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3f7beec04869f7417f6f691aa33cd8ba67c72e75
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: anmolbabu <anb...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Ramesh N <rnach...@redhat.com>
Gerrit-Reviewer: Sahina Bose <sab...@redhat.com>
Gerrit-Reviewer: Shubhendu Tripathi <shtri...@redhat.com>
Gerrit-Reviewer: anmolbabu <anb...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to