Omer Frenkel has posted comments on this change.

Change subject: gluster: GlusterMultipleActionRunner
......................................................................


Patch Set 2: (4 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GlusterMultipleActionsRunner.java
Line 23:             super.RunCanDoActionAsyncroniousely(returnValues, 
currentCanDoActionId, totalSize, latch);
Line 24:         } finally {
Line 25:             // free the lock so that canDoActionOnly() on next command 
doesn't block
Line 26:             getCommands().get(currentCanDoActionId).freeLock();
Line 27:         }
not sure if this works, super.RunCanDoActionAsyncroniousely is called in a loop 
and starts a thread, the line here (freeLock) may be called before the 
canDoAction even started or during its execution.. no?
Line 28:     }
Line 29: 
Line 30:     @Override
Line 31:     protected void executeValidatedCommands(CommandBase<?> command) {


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MultipleActionsRunnersFactory.java
Line 53:             break;
Line 54:         }
Line 55: 
Line 56:         case RemoveVds: {
Line 57:             if(containsGlusterServer(parameters)) {
please use formatter on the patch
Line 58:                 runner = new GlusterMultipleActionsRunner(actionType, 
parameters, isInternal);
Line 59:             } else {
Line 60:                 runner = new MultipleActionsRunner(actionType, 
parameters, isInternal);
Line 61:             }


Line 70:         }
Line 71:         return runner;
Line 72:     }
Line 73: 
Line 74:     private static boolean 
containsGlusterServer(ArrayList<VdcActionParametersBase> parameters) {
better to use (ArrayList<? extends VdsActionParameters> parameters)
so cast will not be needed
Line 75:         Set<Guid> processed = new HashSet<Guid>();
Line 76:         for(VdcActionParametersBase param : parameters) {
Line 77:             VDS vds = 
DbFacade.getInstance().getVdsDao().get(((RemoveVdsParameters) 
param).getVdsId());
Line 78:             if (!processed.contains(vds.getvds_group_id())) {


Line 74:     private static boolean 
containsGlusterServer(ArrayList<VdcActionParametersBase> parameters) {
Line 75:         Set<Guid> processed = new HashSet<Guid>();
Line 76:         for(VdcActionParametersBase param : parameters) {
Line 77:             VDS vds = 
DbFacade.getInstance().getVdsDao().get(((RemoveVdsParameters) 
param).getVdsId());
Line 78:             if (!processed.contains(vds.getvds_group_id())) {
vds may be null here
Line 79:                 VDSGroup cluster = 
DbFacade.getInstance().getVdsGroupDao().get(vds.getvds_group_id());
Line 80:                 if (cluster.supportsGlusterService()) {
Line 81:                     return true;
Line 82:                 }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0e3dc1fa0b21ab6e0fcaff518bf9696f6c9796ca
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shireesh Anjal <san...@redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com>
Gerrit-Reviewer: Shireesh Anjal <san...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to