Sahina Bose has uploaded a new change for review.

Change subject: engine,webadmin: Show RDMA port if present
......................................................................

engine,webadmin: Show RDMA port if present

If volume supports RDMA transport, then the
details view needs to support displaying
the RDMA port values.

Change-Id: I4cfc22a9bc6461b31a50ffe1c1350bf827802570
Signed-off-by: Sahina Bose <sab...@redhat.com>
---
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/BrickProperties.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterServerService.java
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/gluster/GlusterVolumeStatusReturnForXmlRpc.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/BrickPropertiesModel.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/BrickAdvancedDetailsPopupView.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/BrickAdvancedDetailsPopupView.ui.xml
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/SubTabClusterServiceView.java
8 files changed, 78 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/54/40454/1

diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/BrickProperties.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/BrickProperties.java
index c015c35..8e9a75d 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/BrickProperties.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/BrickProperties.java
@@ -33,6 +33,8 @@
 
     private String fsName;
 
+    private int rdmaPort;
+
     public Guid getBrickId() {
         return brickId;
     }
@@ -112,4 +114,13 @@
     public void setFsName(String fsName) {
         this.fsName = fsName;
     }
+
+    public int getRdmaPort() {
+        return rdmaPort;
+    }
+
+    public void setRdmaPort(int rdmaPort) {
+        this.rdmaPort = rdmaPort;
+    }
+
 }
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterServerService.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterServerService.java
index 94d76c3..0bd657f 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterServerService.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterServerService.java
@@ -23,6 +23,7 @@
     private Integer pid;
     private GlusterServiceStatus status;
     private String message;
+    private Integer rdmaPort;
 
     public ServiceType getServiceType() {
         return serviceType;
@@ -96,6 +97,14 @@
         this.serverId = hostId;
     }
 
+    public Integer getRdmaPort() {
+        return rdmaPort;
+    }
+
+    public void setRdmaPort(Integer rdmaPort) {
+        this.rdmaPort = rdmaPort;
+    }
+
     @Override
     public Guid getId() {
         return id;
@@ -129,7 +138,8 @@
                 && ObjectUtils.objectsEqual(pid, other.getPid())
                 && serviceType == other.getServiceType()
                 && ObjectUtils.objectsEqual(hostName, other.getHostName())
-                && ObjectUtils.objectsEqual(port, other.getPort()))) {
+                && ObjectUtils.objectsEqual(port, other.getPort())
+                && ObjectUtils.objectsEqual(rdmaPort, other.getRdmaPort()))) {
             return false;
         }
         return true;
@@ -148,6 +158,7 @@
         result = prime * result + ((serviceType == null) ? 0 : 
serviceType.hashCode());
         result = prime * result + ((hostName == null) ? 0 : 
hostName.hashCode());
         result = prime * result + ((port == null) ? 0 : port.hashCode());
+        result = prime * result + ((rdmaPort == null) ? 0 : 
rdmaPort.hashCode());
         return result;
     }
 
diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/gluster/GlusterVolumeStatusReturnForXmlRpc.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/gluster/GlusterVolumeStatusReturnForXmlRpc.java
index 0952ac5..1189141 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/gluster/GlusterVolumeStatusReturnForXmlRpc.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/gluster/GlusterVolumeStatusReturnForXmlRpc.java
@@ -37,6 +37,7 @@
     private static final String VOLUME_STATUS_INFO = "volumeStatsInfo";
     private static final String VOLUME_NAME = "name";
     private static final String PORT = "port";
+    private static final String RDMA_PORT = "rdma_port";
     private static final String PID = "pid";
     private static final String ONLINE = "ONLINE";
     private static final String BRICKS = "bricks";
@@ -152,6 +153,10 @@
                     serviceInfo.setPort(Integer.parseInt((String) 
volumeServiceInfo.get(PORT)));
                 }
 
+                if (volumeServiceInfo.containsKey(RDMA_PORT) && 
StringUtils.isNumeric((String)volumeServiceInfo.get(RDMA_PORT))) {
+                    serviceInfo.setRdmaPort(Integer.parseInt((String) 
volumeServiceInfo.get(RDMA_PORT)));
+                }
+
                 if (volumeServiceInfo.containsKey(PID) && 
StringUtils.isNumeric((String)volumeServiceInfo.get(PID))) {
                     serviceInfo.setPid(Integer.parseInt((String) 
volumeServiceInfo.get(PID)));
                 }
@@ -201,15 +206,20 @@
             String brickStatus = (String) brick.get(STATUS);
             if (brickStatus.toUpperCase().equals(ONLINE)) {
                 brickProperties.setStatus(GlusterStatus.UP);
-
-                if (brick.containsKey(PORT)) {
-                    if (StringUtils.isNumeric((String)brick.get(PORT))) {
-                        brickProperties.setPort(Integer.parseInt((String) 
brick.get(PORT)));
-                    } else {
-                        //if there's no port registered, then the brick status 
is down.
-                        brickProperties.setStatus(GlusterStatus.DOWN);
-                    }
+                boolean portPresent = false;
+                if (brick.containsKey(PORT) && 
StringUtils.isNumeric((String)brick.get(PORT))) {
+                    brickProperties.setPort(Integer.parseInt((String) 
brick.get(PORT)));
+                    portPresent = true;
                 }
+                if (brick.containsKey(RDMA_PORT) && 
StringUtils.isNumeric((String)brick.get(RDMA_PORT))) {
+                    brickProperties.setRdmaPort(Integer.parseInt((String) 
brick.get(RDMA_PORT)));
+                    portPresent = true;
+                }
+                if (!portPresent) {
+                    //if there's no port registered, then the brick status is 
down.
+                    brickProperties.setStatus(GlusterStatus.DOWN);
+                }
+
                 if (brick.containsKey(PID) && 
StringUtils.isNumeric((String)brick.get(PID))) {
                     brickProperties.setPid(Integer.parseInt((String) 
brick.get(PID)));
                 }
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/BrickPropertiesModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/BrickPropertiesModel.java
index 4298075..92ed0f4 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/BrickPropertiesModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/BrickPropertiesModel.java
@@ -16,6 +16,7 @@
     private EntityModel<Integer> blockSize;
     private EntityModel<String> mountOptions;
     private EntityModel<String> fileSystem;
+    private EntityModel<Integer> rdmaPort;
 
     public BrickPropertiesModel() {
         setStatus(new EntityModel<GlusterStatus>());
@@ -27,6 +28,7 @@
         setBlockSize(new EntityModel<Integer>());
         setMountOptions(new EntityModel<String>());
         setFileSystem(new EntityModel<String>());
+        setRdmaPort(new EntityModel<Integer>());
     }
 
     public void setProperties(BrickProperties brickProperties) {
@@ -39,6 +41,7 @@
         getBlockSize().setEntity(brickProperties.getBlockSize());
         getMountOptions().setEntity(brickProperties.getMntOptions());
         getFileSystem().setEntity(brickProperties.getFsName());
+        getRdmaPort().setEntity(brickProperties.getRdmaPort());
     }
 
     public EntityModel<GlusterStatus> getStatus() {
@@ -112,4 +115,12 @@
     public void setFileSystem(EntityModel<String> fileSystem) {
         this.fileSystem = fileSystem;
     }
+
+    public EntityModel<Integer> getRdmaPort() {
+        return rdmaPort;
+    }
+
+    public void setRdmaPort(EntityModel<Integer> rdmaPort) {
+        this.rdmaPort = rdmaPort;
+    }
 }
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
index 61c0b6f..d62e034 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
@@ -2144,6 +2144,9 @@
     @DefaultStringValue("Port")
     String portService();
 
+    @DefaultStringValue("RDMA Port")
+    String rdmaPortService();
+
     @DefaultStringValue("Process Id")
     String pidService();
 
@@ -3053,6 +3056,9 @@
     @DefaultStringValue("Port")
     String portBrickAdvancedLabel();
 
+    @DefaultStringValue("RDMA Port")
+    String rdmaPortBrickAdvancedLabel();
+
     @DefaultStringValue("Process ID")
     String pidBrickAdvancedLabel();
 
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/BrickAdvancedDetailsPopupView.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/BrickAdvancedDetailsPopupView.java
index 9791546..0b776f7 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/BrickAdvancedDetailsPopupView.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/BrickAdvancedDetailsPopupView.java
@@ -71,6 +71,11 @@
     IntegerEntityModelLabelEditor portEditor;
 
     @UiField
+    @Path(value = "brickProperties.rdmaPort.entity")
+    @WithElementId
+    IntegerEntityModelLabelEditor rdmaPortEditor;
+
+    @UiField
     @Path(value = "brickProperties.pid.entity")
     @WithElementId
     IntegerEntityModelLabelEditor pidEditor;
@@ -213,6 +218,7 @@
         brickEditor.addContentWidgetStyleName(style.generalValue());
         statusEditor.addContentWidgetStyleName(style.generalValue());
         portEditor.addContentWidgetStyleName(style.generalValue());
+        rdmaPortEditor.addContentWidgetStyleName(style.generalValue());
         pidEditor.addContentWidgetStyleName(style.generalValue());
         totalSizeEditor.addContentWidgetStyleName(style.generalValue());
         freeSizeEditor.addContentWidgetStyleName(style.generalValue());
@@ -335,6 +341,7 @@
         brickEditor.setLabel(constants.brickAdvancedLabel());
         statusEditor.setLabel(constants.statusBrickAdvancedLabel());
         portEditor.setLabel(constants.portBrickAdvancedLabel());
+        rdmaPortEditor.setLabel(constants.rdmaPortBrickAdvancedLabel());
         pidEditor.setLabel(constants.pidBrickAdvancedLabel());
         totalSizeEditor.setLabel(constants.totalSizeBrickAdvancedLabel());
         freeSizeEditor.setLabel(constants.freeSizeBrickAdvancedLabel());
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/BrickAdvancedDetailsPopupView.ui.xml
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/BrickAdvancedDetailsPopupView.ui.xml
index ee666b4..6f979c0 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/BrickAdvancedDetailsPopupView.ui.xml
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/BrickAdvancedDetailsPopupView.ui.xml
@@ -47,6 +47,7 @@
                                                                
<ge:StringEntityModelLabelEditor ui:field="brickEditor" />
                                                                
<ge:EntityModelLabelEditor ui:field="statusEditor" />
                                                                
<ge:IntegerEntityModelLabelEditor ui:field="portEditor" />
+                                                               
<ge:IntegerEntityModelLabelEditor ui:field="rdmaPortEditor" />
                                                                
<ge:IntegerEntityModelLabelEditor ui:field="pidEditor" />
                                                                
<ge:DoubleEntityModelLabelEditor ui:field="totalSizeEditor" />
                                                                
<ge:DoubleEntityModelLabelEditor ui:field="freeSizeEditor" />
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/SubTabClusterServiceView.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/SubTabClusterServiceView.java
index 4db0da0..5cb87f0 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/SubTabClusterServiceView.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/SubTabClusterServiceView.java
@@ -151,6 +151,18 @@
         servicesTable.addEntityModelColumn(new 
EntityModelTextColumn<GlusterServerService>() {
             @Override
             public String getText(GlusterServerService entity) {
+                if (entity.getRdmaPort() != null && entity.getRdmaPort() > 0) {
+                    return String.valueOf(entity.getRdmaPort());
+                }
+                else {
+                    return constants.notAvailableLabel();
+                }
+            }
+        }, constants.rdmaPortService());
+
+        servicesTable.addColumn(new 
EntityModelTextColumn<GlusterServerService>() {
+            @Override
+            public String getText(GlusterServerService entity) {
                 return String.valueOf(entity.getPid());
             }
         }, constants.pidService());


-- 
To view, visit https://gerrit.ovirt.org/40454
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4cfc22a9bc6461b31a50ffe1c1350bf827802570
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5-gluster
Gerrit-Owner: Sahina Bose <sab...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to