Dhandapani Gopal has posted comments on this change.

Change subject: engine: Get Volume Advanced Details Query
......................................................................


Patch Set 9: (13 inline comments)

Incorporated Yair and Moti review comments. One in-line reply for Yair's 
comment.

....................................................
File 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GetGlusterVolumeAdvancedDetailsQueryTest.java
Line 40:     private static final Guid CLUSTER_ID = new 
Guid("b399944a-81ab-4ec5-8266-e19ba7c3c9d1");
Line 41:     private static final String VOLUME_NAME = "test-volume1";
Line 42:     private static final String BRICK_NAME = "test-server1:/tmp/b1";
Line 43:     private static final String SERVER_NAME = "server1";
Line 44:     ClusterUtils clusterUtils;
Done
Line 45:     VDSBrokerFrontend vdsBrokerFrontend;
Line 46:     VdsDAO vdsDao;
Line 47:     GlusterVolumeAdvancedDetailsParameters params;
Line 48: 


Line 98:         return memoryStatus;
Line 99:     }
Line 100: 
Line 101:     private List<Mempool> getMemPools() {
Line 102:         List<Mempool> memPoolList = new ArrayList<Mempool>();
Done
Line 103:         Mempool memPool = new Mempool();
Line 104:         memPool.setAllocCount(0);
Line 105:         memPool.setColdCount(1024);
Line 106:         memPool.setHotCount(0);


Line 135:         return vds;
Line 136:     }
Line 137: 
Line 138:     private List<VDS> getDummyVdsList(VDSStatus status) {
Line 139:         List<VDS> vdsList = new ArrayList<VDS>();
Done
Line 140:         vdsList.add(getVds(status));
Line 141:         return vdsList;
Line 142:     }
Line 143: 


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/BrickDetails.java
Line 12:  */
Line 13: public class BrickDetails implements Serializable {
Line 14: 
Line 15:     private static final long serialVersionUID = -1134758927239004412L;
Line 16: 
Done
Line 17:     BrickProperties brickProperties;
Line 18:     List<GlusterClientInfo> clients;
Line 19:     MemoryStatus memoryStatus;
Line 20: 


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterVolumeAdvancedDetails.java
Line 21:     }
Line 22: 
Line 23:     private Guid volumeId;
Line 24: 
Line 25:     List<BrickDetails> brickDetails;
Done
Line 26:     List<ServiceInfo> serviceInfo;
Line 27: 
Line 28:     public Guid getVolumeId() {
Line 29:         return volumeId;


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterVolumeStatusOption.java
Line 3: /**
Line 4:  * Enum of Gluster volume Status options. These enum options are used 
to retrieve the various volume statuses.
Line 5:  *
Line 6:  */
Line 7: public enum GlusterVolumeStatusOption {
Done
Line 8:     detail,
Line 9:     clients,
Line 10:     mem;


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/MallInfo.java
Line 10: public class MallInfo implements Serializable {
Line 11: 
Line 12:     private static final long serialVersionUID = -5333436625976301182L;
Line 13: 
Line 14:     private Integer arena;
I thought some of these fields are optional. Instead of null I will assume 0 
for optional fields by changing its type to 'int'.
Line 15: 
Line 16:     private Integer ordblks;
Line 17: 
Line 18:     private Integer smblks;


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/Mempool.java
Line 11: 
Line 12:     private static final long serialVersionUID = 4426819375609665363L;
Line 13: 
Line 14:     private String name;
Line 15: 
Changed Integer to int.
Line 16:     private Integer hotCount;
Line 17: 
Line 18:     private Integer coldCount;
Line 19: 


....................................................
File 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/gluster/GetGlusterVolumeAdvancedDetailsVDSCommand.java
Line 18:         return result.mStatus;
Line 19:     }
Line 20: 
Line 21:     private boolean getSucceeded() {
Line 22:         return (result.mStatus.mCode == 0);
Changed to result.getmStatus().mCode.
Line 23:     }
Line 24: 
Line 25:     @Override
Line 26:     protected void ExecuteVdsBrokerCommand() {


Line 23:     }
Line 24: 
Line 25:     @Override
Line 26:     protected void ExecuteVdsBrokerCommand() {
Line 27:         GlusterVolumeAdvancedDetails volumeAdvancedDetails = new 
GlusterVolumeAdvancedDetails();
Done
Line 28:         if (!getParameters().detailsRequired()) {
Line 29:             executeVolumeStatusInfo("");
Line 30:             volumeAdvancedDetails = result.getVolumeAdvancedDetails();
Line 31:         } else {


Line 32:             executeVolumeStatusInfo("");
Line 33:             if (getSucceeded()) {
Line 34:                 volumeAdvancedDetails = 
result.getVolumeAdvancedDetails();
Line 35:                 
executeVolumeStatusInfo(GlusterVolumeStatusOption.detail.name());
Line 36:                 if (getSucceeded()) {
Since each "executeVolumeStatusInfo" call invokes vdsm/gluster command, based 
on the command success only further call will be determined. I think it is 
difficult to avoid nesting.
Line 37:                     
volumeAdvancedDetails.copyDetailsFrom(result.getVolumeAdvancedDetails());
Line 38:                     
executeVolumeStatusInfo(GlusterVolumeStatusOption.clients.name());
Line 39:                     if (getSucceeded()) {
Line 40:                         
volumeAdvancedDetails.copyClientsFrom(result.getVolumeAdvancedDetails());


....................................................
File 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/irsbroker/GlusterVolumeStatusReturnForXmlRpc.java
Line 68:     private static final String MEMORY_MAXALLOC = "maxAlloc";
Line 69:     private static final String MEMORY_POOLMISSES = "poolMisses";
Line 70:     private static final String MEMORY_MAXSTDALLOC = "maxStdAlloc";
Line 71: 
Line 72:     public StatusForXmlRpc mStatus;
Changed to private and added getter/setter for mStatus.
Line 73: 
Line 74:     private GlusterVolumeAdvancedDetails volumeAdvancedDetails = new 
GlusterVolumeAdvancedDetails();
Line 75: 
Line 76:     public GlusterVolumeStatusReturnForXmlRpc(Guid clusterId, 
Map<String, Object> innerMap) {


Line 99:         getServiceInfo(statusInfo, serviceInfoList, SHD_KEY);
Line 100:         return serviceInfoList;
Line 101:     }
Line 102: 
Line 103:     private void getServiceInfo(Map<String, Object> statusInfo, 
List<ServiceInfo> serviceInfoList, String service) {
Changed the method name to prepareServiceInfo().
Line 104:         if (statusInfo.containsKey(service)) {
Line 105:             Object[] serviceInfo = (Object[]) statusInfo.get(service);
Line 106:             for (Object serviceObj : serviceInfo) {
Line 107:                 Map<String, Object> serviceMap = (Map<String, 
Object>) serviceObj;


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

Gerrit-MessageType: comment
Gerrit-Change-Id: If6b590eaebeb1d06b7278300d5e12b2dab9eb093
Gerrit-PatchSet: 9
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Dhandapani Gopal <[email protected]>
Gerrit-Reviewer: Dhandapani Gopal <[email protected]>
Gerrit-Reviewer: Kanagaraj M <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Selvasundaram <[email protected]>
Gerrit-Reviewer: Shireesh Anjal <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to