Moti Asayag has posted comments on this change.
Change subject: engine: Get Volume Advanced Details Query
......................................................................
Patch Set 9: (10 inline comments)
....................................................
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;
any reason why not to define as private all of the class members ?
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>();
you could first create the memPool ant than return
Collections.singletonList(memPool);
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>();
same as above
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:
the members are externalized via the getters/setter, please define as private
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;
the members are externalized via the getters/setter, please define as private
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 {
since the values represented as constants, please consider java naming
convention and write in upper-case.
Line 8: detail,
Line 9: clients,
Line 10: mem;
....................................................
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);
being able to do result.mStatus.mCode might indicate that somewhere in the way
setting modifiers for GlusterVolumeStatusReturnForXmlRpc.mStatus wasn't done
properly.
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();
since executeVolumeStatusInfo(""); is being executed for both condition result,
it could be pulled of prior to the if-statement from both if-else blocks.
Line 28: if (!getParameters().detailsRequired()) {
Line 29: executeVolumeStatusInfo("");
Line 30: volumeAdvancedDetails = result.getVolumeAdvancedDetails();
Line 31: } else {
....................................................
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;
why public ?
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) {
the method is called getXXX yet it returns no value.
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