Selvasundaram has posted comments on this change.

Change subject: engine: Get gluster hooks query
......................................................................


Patch Set 9: (8 inline comments)

....................................................
File backend/manager/dbscripts/gluster_hooks_sp.sql
Line 42:     WHERE id = v_id;
Line 43: END; $procedure$
Line 44: LANGUAGE plpgsql;
Line 45: 
Line 46: 
Yes it will return list. 
I will modify the parameters to get exactly one record.
Line 47: Create or replace FUNCTION GetGlusterHookByName(v_cluster_id UUID, 
v_name VARCHAR(1000))
Line 48: RETURNS SETOF gluster_hooks
Line 49: AS $procedure$
Line 50: BEGIN


Line 117:     WHERE id = v_id;
Line 118: END; $procedure$
Line 119: LANGUAGE plpgsql;
Line 120: 
Line 121: 
No. I will remove the cluster id update.
Line 122: Create or replace FUNCTION UpdateGlusterHook(v_id UUID,
Line 123:                                              v_cluster_id UUID,
Line 124:                                              v_gluster_command 
VARCHAR(1000),
Line 125:                                              v_stage VARCHAR(100),


Line 140:     WHERE id = v_id;
Line 141: END; $procedure$
Line 142: LANGUAGE plpgsql;
Line 143: 
Line 144: 
Done
Line 145: Create or replace FUNCTION InsertGlusterServerHook(v_hook_id UUID,
Line 146:                                 v_host_id UUID,
Line 147:                                 v_checksum VARCHAR(100),
Line 148:                                 v_status VARCHAR(100))


Line 153:       VALUES(v_hook_id, v_host_id, v_checksum, v_status);
Line 154: END; $procedure$
Line 155: LANGUAGE plpgsql;
Line 156: 
Line 157: 
Yes. Removed.
Line 158: Create or replace FUNCTION GetGlusterServerHook(v_hook_id UUID, 
v_host_id UUID)
Line 159: RETURNS SETOF gluster_server_hooks
Line 160: AS $procedure$
Line 161: BEGIN


....................................................
File backend/manager/dbscripts/upgrade/03_02_0400_add_gluster_hooks_table.sql
Line 1: Create or replace FUNCTION __temp_fn_db_add_gluster_hooks_tables()
Line 2: RETURNS void
Line 3: AS $function$
Line 4: BEGIN
Line 5:     -- Add gluster_hooks table
The mismatch will happen in status and content (alternatively checksum). 
Inconsistent states are populated in gluster_server_hooks table. Gluster Hook 
Entity class having this field and collect the check sum and status from the 
gluster_server_hooks table as well.
Line 6:         CREATE TABLE gluster_hooks
Line 7:         (
Line 8:              id UUID NOT NULL,
Line 9:              cluster_id UUID NOT NULL references 
vds_groups(vds_group_id) on delete cascade,


Line 19:        ) WITH OIDS;
Line 20:        CREATE INDEX IDX_gluster_hooks_cluster_id ON 
gluster_hooks(cluster_id);
Line 21:        CREATE UNIQUE INDEX IDX_gluster_hooks_unique ON 
gluster_hooks(cluster_id, gluster_command, stage, name);
Line 22: 
Line 23:        -- Add gluster_server_hooks table
Done
Line 24:        CREATE TABLE gluster_server_hooks
Line 25:        (
Line 26:             hook_id UUID NOT NULL references gluster_hooks(id) on 
delete cascade,
Line 27:             host_id UUID default NULL,


Line 29:             status VARCHAR(100),
Line 30:             _create_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT 
LOCALTIMESTAMP,
Line 31:             _update_date TIMESTAMP WITH TIME ZONE
Line 32:        ) WITH OIDS;
Line 33:        CREATE INDEX IDX_gluster_server_hooks ON 
gluster_server_hooks(hook_id, host_id);
host_id is null if there is no conflicts between cluster servers (all having 
the same checksum and status).
Line 34: 
Line 35: END; $function$
Line 36: LANGUAGE plpgsql;
Line 37: 


....................................................
File 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/gluster/GlusterHooksDaoDbFacadeImpl.java
Line 46:         }
Line 47:         return glusterHook;
Line 48:     }
Line 49: 
Line 50:     @Override
No. gluster_command, stage and hook_name in a cluster is unique.
Updated the parameters and in stored procedure.
Line 51:     public GlusterHookEntity getByName(Guid clusterId, String 
hookName) {
Line 52:         GlusterHookEntity glusterHook = getCallsHandler().executeRead(
Line 53:                 "GetGlusterHookByName", glusterHookRowMapper,
Line 54:                 getCustomMapSqlParameterSource()


--
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: 9
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Selvasundaram <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Itamar Heim <[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