Shubhendu Tripathi has posted comments on this change.

Change subject: gluster: bll command to start/stop/restart service
......................................................................


Patch Set 4: (9 inline comments)

....................................................
File backend/manager/dbscripts/gluster_services_sp.sql
Line 39: END; $procedure$
Line 40: LANGUAGE plpgsql;
Line 41: 
Line 42: -- cluster-wide service given cluster id and service type
Line 43: Create or replace FUNCTION 
GetGlusterClusterServicesByClusterIdAndServiceType(v_cluster_id UUID, 
v_service_type VARCHAR(100))
Reverted the changes to this source as its taken care already as part of query.
Line 44:     RETURNS SETOF gluster_cluster_services
Line 45:     AS $procedure$
Line 46: BEGIN
Line 47:     RETURN  QUERY SELECT *


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/ManageGlusterServiceCommand.java
Line 64: 
Line 65:     public ManageGlusterServiceCommand(GlusterServiceParameters 
params) {
Line 66:         super(params);
Line 67:         this.clusterId = params.getClusterId();
Line 68:         this.serverId = params.getServerId();
Yes, will be doing the same changes
Line 69:         this.serviceType = params.getServiceType();
Line 70:         this.actionType = params.getActionType();
Line 71:     }
Line 72: 


Line 121:     }
Line 122: 
Line 123:     private void performActionForServicesOfCluster() {
Line 124:         List<VDS> servers = 
getClusterUtils().getAllUpServers(clusterId);
Line 125:         final List<GlusterService> serviceList = getServiceList();
Yes, will be doing the same changes
Line 126: 
Line 127:         List<Callable<Pair<VDS, VDSReturnValue>>> taskList = new 
ArrayList<Callable<Pair<VDS, VDSReturnValue>>>();
Line 128:         for (final VDS upServer : servers) {
Line 129:             final List<String> serviceListStr = new 
ArrayList<String>();


Line 123:     private void performActionForServicesOfCluster() {
Line 124:         List<VDS> servers = 
getClusterUtils().getAllUpServers(clusterId);
Line 125:         final List<GlusterService> serviceList = getServiceList();
Line 126: 
Line 127:         List<Callable<Pair<VDS, VDSReturnValue>>> taskList = new 
ArrayList<Callable<Pair<VDS, VDSReturnValue>>>();
Yes, will be taking out the task list creation into another method
Line 128:         for (final VDS upServer : servers) {
Line 129:             final List<String> serviceListStr = new 
ArrayList<String>();
Line 130:             for (GlusterService srvc : serviceList) {
Line 131:                 serviceListStr.add(srvc.getServiceName());


Line 146:                 }
Line 147:             });
Line 148:         }
Line 149: 
Line 150:         setSucceeded(true);
Will be removing the same line
Line 151:         if (!taskList.isEmpty()) {
Line 152:             List<Pair<VDS, VDSReturnValue>> pairResults = 
ThreadPoolUtil.invokeAll(taskList);
Line 153:             for (Pair<VDS, VDSReturnValue> pairResult : pairResults) {
Line 154:                 VDSReturnValue retValue = pairResult.getSecond();


Line 152:             List<Pair<VDS, VDSReturnValue>> pairResults = 
ThreadPoolUtil.invokeAll(taskList);
Line 153:             for (Pair<VDS, VDSReturnValue> pairResult : pairResults) {
Line 154:                 VDSReturnValue retValue = pairResult.getSecond();
Line 155:                 if (!retValue.getSucceeded()) {
Line 156:                     errors.add(retValue.getVdsError().getMessage());
Yes, will be moving the same to call() method
Line 157:                 }
Line 158:             }
Line 159:         } else {
Line 160:             setSucceeded(false);


Line 159:         } else {
Line 160:             setSucceeded(false);
Line 161:         }
Line 162: 
Line 163:         if (errors.size() > 0) {
Yes, will introduce a method invokeManageGlusterService() to move the code 
accordingly
Line 164:             setSucceeded(false);
Line 165:             handleVdsErrors(getAuditLogTypeValue(), errors);
Line 166:             addCustomValue(GlusterConstants.FAILURE_MESSAGE, 
StringUtils.join(errors, SystemUtils.LINE_SEPARATOR));
Line 167:         } else {


Line 189:                     returnValue.getVdsError().getMessage());
Line 190:         } else {
Line 191:             VDS vds = new VDS();
Line 192:             vds.setStatus(VDSStatus.Up);
Line 193:             Pair<VDS, VDSReturnValue> pairRetVal = new Pair<VDS, 
VDSReturnValue>(vds, returnValue);
Yes, will change the code
Line 194:             updateService(serverId, serviceList, pairRetVal);
Line 195:         }
Line 196:     }
Line 197: 


Line 204:                 if 
(serverService.getServiceId().equals(service.getId())
Line 205:                         && serverService.getServiceType() == 
serviceType
Line 206:                         && pairResult.getFirst().getStatus() != 
VDSStatus.Error) {
Line 207:                     
serverService.setStatus(manageActionDetailsMap.get(actionType).getStatus());
Line 208:                     
getGlusterServerServiceDao().update(serverService);
Once Spring Batch path is available, will do the required changes in the code
Line 209:                     break;
Line 210:                 }
Line 211:             }
Line 212:         }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifcab38866c49c6f5d43e3b33006c428ec9304501
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shubhendu Tripathi <shtri...@redhat.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Kanagaraj M <kmayi...@redhat.com>
Gerrit-Reviewer: Michael Pasternak <mpast...@redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofren...@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: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to