Sahina Bose has posted comments on this change. Change subject: gluster: BLL command for volume snapshot create ......................................................................
Patch Set 11: (5 comments) http://gerrit.ovirt.org/#/c/34928/11/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeSnapshotCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeSnapshotCommand.java: Line 26: public class CreateGlusterVolumeSnapshotCommand extends GlusterVolumeCommandBase<CreateGlusterVolumeSnapshotParameters> { Line 27: Line 28: private GlusterVolumeSnapshotEntity snapshot; Line 29: private boolean force; Line 30: private Guid volumeId; required? You could use getGlusterVolume() once you set the glusterVolumeId in the constructor Line 31: Line 32: public CreateGlusterVolumeSnapshotCommand(CreateGlusterVolumeSnapshotParameters params) { Line 33: super(params); Line 34: this.snapshot = params.getSnapshot(); Line 37: if (this.snapshot != null) { Line 38: setVdsGroupId(this.snapshot.getClusterId()); Line 39: } Line 40: Line 41: volumeId = snapshot.getVolumeId(); call setGlusterVolumeId(snapshot.getVolumeId() - inside the if block Line 42: } Line 43: Line 44: @Override Line 45: protected LockProperties applyLockProperties(LockProperties lockProperties) { Line 53: } Line 54: Line 55: @Override Line 56: protected void executeCommand() { Line 57: GlusterVolumeEntity volume = getGlusterVolumeDao().getById(volumeId); getGlusterVolume() from super class can be used Line 58: VDSReturnValue retVal = Line 59: runVdsCommand(VDSCommandType.CreateGlusterVolumeSnapshot, Line 60: new GlusterVolumeCreateSnapshotVDSParameters(upServer.getId(), Line 61: volume.getName(), Line 67: if (!getSucceeded()) { Line 68: handleVdsError(AuditLogType.GLUSTER_VOLUME_SNAPSHOT_CREATE_FAILED, retVal.getVdsError().getMessage()); Line 69: } else { Line 70: GlusterVolumeSnapshotEntity createdSnapshot = getParameters().getSnapshot(); Line 71: createdSnapshot.setSnapshotId(((GlusterVolumeSnapshotEntity) retVal.getReturnValue()).getSnapshotId()); Why is the VDS retVal GlusterVolumeSnapshotEntity and not Guid? Line 72: createdSnapshot.setCreatedAt(new Date()); Line 73: createdSnapshot.setStatus(GlusterSnapshotStatus.STARTED); Line 74: getDbFacade().getGlusterVolumeSnapshotDao().save(createdSnapshot); Line 75: } Line 91: addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_DOES_NOT_SUPPORT_GLUSTER); Line 92: return false; Line 93: } Line 94: Line 95: GlusterVolumeEntity volume = getGlusterVolumeDao().getById(volumeId); Use getGlusterVolume() Line 96: if (volume != null && volume.getStatus() == GlusterStatus.DOWN) { Line 97: return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_DOWN); Line 98: } Line 99: -- To view, visit http://gerrit.ovirt.org/34928 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2c27f9e73bac8d6de3022b0dd4e70aa0d8b1494b Gerrit-PatchSet: 11 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Shubhendu Tripathi <shtri...@redhat.com> Gerrit-Reviewer: Kanagaraj M <kmayi...@redhat.com> Gerrit-Reviewer: Omer Frenkel <ofren...@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: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches