Gilad Chaplik has posted comments on this change.

Change subject: engine: Manage Gluster hooks support
......................................................................


Patch Set 20: (10 inline comments)

....................................................
File backend/manager/dbscripts/gluster_hooks_sp.sql
Line 27: 
Line 28: 
Line 29: 
Line 30: Create or replace FUNCTION GetGlusterHookById(v_id UUID,
Line 31:                                               v_returnAll 
BOOLEAN=false)
Consider writing another SP for getAll
Line 32: RETURNS SETOF gluster_hooks
Line 33: AS $procedure$
Line 34: BEGIN
Line 35:     if (v_returnAll = true) then


Line 74: Create or replace FUNCTION GetGlusterHook(v_cluster_id UUID,
Line 75:                                           v_gluster_command 
VARCHAR(1000),
Line 76:                                           v_stage VARCHAR(100),
Line 77:                                           v_name VARCHAR(1000),
Line 78:                                           v_returnAll BOOLEAN=false)
Consider writing another SP for getAll
Line 79: RETURNS SETOF gluster_hooks
Line 80: AS $procedure$
Line 81: BEGIN
Line 82:     if (v_returnAll = true) then


Line 108: 
Line 109: Create or replace FUNCTION DeleteGlusterHook(v_cluster_id UUID,
Line 110:                                              v_gluster_command 
VARCHAR(1000),
Line 111:                                              v_stage VARCHAR(100),
Line 112:                                              v_name VARCHAR(1000))
Hook/Hooks
Line 113: RETURNS VOID
Line 114: AS $procedure$
Line 115: BEGIN
Line 116:     DELETE FROM gluster_hooks


Line 276: RETURNS VOID
Line 277: AS $procedure$
Line 278: BEGIN
Line 279:     DELETE FROM gluster_server_hooks
Line 280:     WHERE hook_id = v_hook_id;
a nice q is whether we should update hook time stamp when removing/updating the 
server_hooks :-)
Line 281: END; $procedure$
Line 282: LANGUAGE plpgsql;
Line 283: 
Line 284: Create or replace FUNCTION DeleteGlusterServerHooksByIds(v_ids 
VARCHAR(5000))


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GetGlusterHooksQuery.java
Line 13:     }
Line 14: 
Line 15:     @Override
Line 16:     protected void executeQueryCommand() {
Line 17:         
getQueryReturnValue().setReturnValue(getGlusterHookDao().getByClusterId(getParameters().getClusterId()));
null == all?
Line 18:         getQueryReturnValue().setSucceeded(true);
Line 19:     }
Line 20: 


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterHookConflictFlags.java
Line 2: 
Line 3: public enum GlusterHookConflictFlags {
Line 4:     CONTENT_CONFLICT (1), //0b001
Line 5:     STATUS_CONFLICT(2), //0b010
Line 6:     MISSING_HOOK (4); //0b100
I agree + this enum can be represented as varchar as the others.
Line 7: 
Line 8:     private Integer flag;
Line 9: 
Line 10:     private GlusterHookConflictFlags(Integer value) {


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterHookEntity.java
Line 46:         return getId(true);
Line 47:     }
Line 48: 
Line 49:     public Guid getId(boolean generateIfNull) {
Line 50:         if (id == null && generateIfNull) {
can't we init the id in the c'tor (don't forget to add also the default c'tor)? 
remember it's a share code with client.
Line 51:             id = Guid.NewGuid();
Line 52:         }
Line 53:         return id;
Line 54:     }


Line 111:     }
Line 112: 
Line 113:     public void setContentType(String contentType) {
Line 114:         if (contentType != null) {
Line 115:             this.contentType = 
GlusterHookContentType.valueOf(contentType);
avoid using 'this' here.
Line 116:         }
Line 117:     }
Line 118: 
Line 119:     public String getChecksum() {


Line 182:                 && name.equals(hook.getName())
Line 183:                 && contentType == hook.getContentType()
Line 184:                 && conflictStatus == hook.getConflictStatus()
Line 185:                 && checksum.equals(hook.getChecksum())
Line 186:                 && status == hook.getStatus())) {
actually now it's an enforcement. see http://gerrit.ovirt.org/#/c/12342/
Line 187:             return false;
Line 188:         }
Line 189:         return true;
Line 190:     }


Line 194:         return getId();
Line 195:     }
Line 196: 
Line 197:     public boolean isMissingHookConflict() {
Line 198:         return (this.conflictStatus & MISSING_HOOK.getValue()) == 
MISSING_HOOK.getValue();
avoid using this in these cases.
Line 199:     }
Line 200: 
Line 201:     public boolean isStatusConflict() {
Line 202:         return (this.conflictStatus & STATUS_CONFLICT.getValue()) == 
STATUS_CONFLICT.getValue();


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

Gerrit-MessageType: comment
Gerrit-Change-Id: If8b2d261ead720fccea6884acbc806ec79e52b36
Gerrit-PatchSet: 20
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Selvasundaram <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Kanagaraj M <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Sahina Bose <[email protected]>
Gerrit-Reviewer: Selvasundaram <[email protected]>
Gerrit-Reviewer: Shireesh Anjal <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to