Shireesh Anjal has posted comments on this change.

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


Patch Set 2: (4 inline comments)

Thanks Omer for catching a good one! New patch-set to follow.

....................................................
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:         }
Great point :) Though it worked when I tested, I guess I was plain lucky! How 
about, I extract the code inside the run() method of the thread in a separate 
method and override it? Will send a new patch-set with this.
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)) {
Done
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) {
In that case, will the cast not be required in the place where I call this 
method? In any case, I think it will look better with your suggestion, and will 
do so in the next patch-set.
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())) {
Will add a null check.
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