geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [11/14] incubator-geode git commit: GEODE-1021: show members of the region that has hyphen in it's name
Date Fri, 04 Mar 2016 17:30:23 GMT
GEODE-1021: show members of the region that has hyphen in it's name


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/23950e80
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/23950e80
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/23950e80

Branch: refs/heads/feature/GEODE-949-2
Commit: 23950e80f8771eb134cb128ad9cff4d78f270d12
Parents: 4914142
Author: Jinmei Liao <jiliao@pivotal.io>
Authored: Thu Mar 3 13:38:27 2016 -0800
Committer: Jinmei Liao <jiliao@pivotal.io>
Committed: Fri Mar 4 07:51:50 2016 -0800

----------------------------------------------------------------------
 .../pulse/internal/data/JMXDataUpdater.java     | 85 ++------------------
 .../service/ClusterSelectedRegionService.java   |  8 +-
 .../ClusterSelectedRegionsMemberService.java    |  8 +-
 3 files changed, 14 insertions(+), 87 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/23950e80/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/JMXDataUpdater.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/JMXDataUpdater.java
b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/JMXDataUpdater.java
index 71dfa61..bb433f5 100644
--- a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/JMXDataUpdater.java
+++ b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/data/JMXDataUpdater.java
@@ -1246,10 +1246,10 @@ public class JMXDataUpdater implements IClusterUpdater, NotificationListener
{
   /**
    * Add member specific region information on the region
    *
-   * @param regionFullPath
+   * @param regionObjectName: used to construct the jmx objectname. For region name that
has special characters in, it will have double quotes around it.
    * @param region
    */
-  private void updateRegionOnMembers(String regionFullPath, Cluster.Region region) throws
IOException {
+  private void updateRegionOnMembers(String regionObjectName, String regionFullPath, Cluster.Region
region) throws IOException {
 
     try{
         List<String> memberNamesTemp = region.getMemberName();
@@ -1272,7 +1272,7 @@ public class JMXDataUpdater implements IClusterUpdater, NotificationListener
{
               regionOnMemberListNew.add(anRom);
 
               LOGGER.fine("updateRegionOnMembers : Processing existing Member name = " +
anRom.getMemberName());
-              String objectNameROM = PulseConstants.OBJECT_NAME_REGION_ON_MEMBER_REGION +
regionFullPath + PulseConstants.OBJECT_NAME_REGION_ON_MEMBER_MEMBER + anRom.getMemberName();
+              String objectNameROM = PulseConstants.OBJECT_NAME_REGION_ON_MEMBER_REGION +
regionObjectName + PulseConstants.OBJECT_NAME_REGION_ON_MEMBER_MEMBER + anRom.getMemberName();
               ObjectName regionOnMemberMBean = new ObjectName(objectNameROM);
               LOGGER.fine("updateRegionOnMembers : Object name = " + regionOnMemberMBean.getCanonicalName());
 
@@ -1339,7 +1339,7 @@ public class JMXDataUpdater implements IClusterUpdater, NotificationListener
{
         LOGGER.fine("updateRegionOnMembers : Remaining new members in this region = " + memberNames.size());
         //loop over the remaining regions members and add new members for this region
         for(String memberName : memberNames) {
-          String objectNameROM = PulseConstants.OBJECT_NAME_REGION_ON_MEMBER_REGION + regionFullPath
+ PulseConstants.OBJECT_NAME_REGION_ON_MEMBER_MEMBER + memberName;
+          String objectNameROM = PulseConstants.OBJECT_NAME_REGION_ON_MEMBER_REGION + regionObjectName
+ PulseConstants.OBJECT_NAME_REGION_ON_MEMBER_MEMBER + memberName;
           ObjectName regionOnMemberMBean = new ObjectName(objectNameROM);
           Cluster.RegionOnMember regionOnMember = new Cluster.RegionOnMember();
           regionOnMember.setMemberName(memberName);
@@ -1419,6 +1419,7 @@ public class JMXDataUpdater implements IClusterUpdater, NotificationListener
{
           PulseConstants.REGION_MBEAN_ATTRIBUTES);
 
       // retrieve the full path of the region
+      String regionObjectName = mbeanName.getKeyProperty("name");
       String regionFullPath = null;
       for (int i = 0; i < attributeList.size(); i++) {
         Attribute attribute = (Attribute) attributeList.get(i);
@@ -1512,82 +1513,8 @@ public class JMXDataUpdater implements IClusterUpdater, NotificationListener
{
         }
       }
 
-      /* GemfireXD related code
-      try{// Added for Rolling upgrade
-    	  CompositeData compositeData = (CompositeData) (this.mbs.invoke(mbeanName,
-    	          PulseConstants.MBEAN_OPERATION_LISTREGIONATTRIBUTES, null, null));
-
-    	      if (compositeData != null) {
-    	        if (compositeData
-    	            .containsKey(PulseConstants.COMPOSITE_DATA_KEY_COMPRESSIONCODEC)) {
-    	          String regCompCodec = (String) compositeData
-    	              .get(PulseConstants.COMPOSITE_DATA_KEY_COMPRESSIONCODEC);
-    	          if (null != regCompCodec) {
-    	            region.setCompressionCodec(regCompCodec);
-    	          }
-    	        }
-    	        if (compositeData
-    	            .containsKey(PulseConstants.COMPOSITE_DATA_KEY_ENABLEOFFHEAPMEMORY)) {
-    	          region.setEnableOffHeapMemory((Boolean) compositeData
-    	              .get(PulseConstants.COMPOSITE_DATA_KEY_ENABLEOFFHEAPMEMORY));
-    	        }
-    	        if (compositeData
-    	            .containsKey(PulseConstants.COMPOSITE_DATA_KEY_HDFSWRITEONLY)) {
-    	          region.setHdfsWriteOnly((Boolean) compositeData
-    	              .get(PulseConstants.COMPOSITE_DATA_KEY_HDFSWRITEONLY));
-    	        }
-    	      }
-      } catch (MBeanException anfe) {
-          LOGGER.warning(anfe);
-          region.setHdfsWriteOnly(false);
-          region.setEnableOffHeapMemory(false);
-          region.setCompressionCodec("NA");
-      }catch (javax.management.RuntimeMBeanException invalidOe) {
-    	    region.setHdfsWriteOnly(false);
-            region.setEnableOffHeapMemory(false);
-            region.setCompressionCodec("NA");
-           // LOGGER.info("Some of the Pulse elements are not available currently. There
might be a GemFire upgrade going on.");
-      }
-      */
-
-      // TODO : Uncomment below code when sql fire mbean attributes are
-      // available
-      /*
-       * // IF SQLFIRE if
-       * (PulseConstants.PRODUCT_NAME_SQLFIRE.equalsIgnoreCase(PulseController
-       * .getPulseProductSupport())) {
-       *
-       * try { String tableName = this.getTableNameFromRegionName(region
-       * .getFullPath());
-       *
-       * ObjectName tableObjName = new ObjectName(
-       * PulseConstants.OBJECT_NAME_TABLE_AGGREGATE_PATTERN + tableName);
-       *
-       * AttributeList tableAttributeList = this.mbs.getAttributes(
-       * tableObjName, PulseConstants.SF_TABLE_MBEAN_ATTRIBUTES);
-       *
-       * for (int i = 0; i < tableAttributeList.size(); i++) {
-       *
-       * Attribute attribute = (Attribute) tableAttributeList.get(i);
-       *
-       * if (attribute.getName().equals(
-       * PulseConstants.MBEAN_ATTRIBUTE_ENTRYSIZE)) {
-       * System.out.println("[SQLfire] setting entry size");
-       * region.setEntrySize(getLongAttribute(attribute.getValue(),
-       * attribute.getName())); } else if (attribute.getName().equals(
-       * PulseConstants.MBEAN_ATTRIBUTE_NUMBEROFROWS)) {
-       * System.out.println("[SQLfire] setting num of rows");
-       * region.setSystemRegionEntryCount(getLongAttribute(
-       * attribute.getValue(), attribute.getName())); } } } catch
-       * (MalformedObjectNameException e) { LOGGER.warning(e); } catch
-       * (NullPointerException e) { LOGGER.warning(e); } }
-       */
-
-      // Add to map even if region is present. If region is already there it
-      // will be a no-op.
-
       //add for each member
-      updateRegionOnMembers(regionFullPath, region);
+      updateRegionOnMembers(regionObjectName, regionFullPath, region);
 
       cluster.addClusterRegion(regionFullPath, region);
       cluster.getDeletedRegions().remove(region.getFullPath());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/23950e80/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterSelectedRegionService.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterSelectedRegionService.java
b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterSelectedRegionService.java
index 4309c40..1e2f5b1 100644
--- a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterSelectedRegionService.java
+++ b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterSelectedRegionService.java
@@ -209,13 +209,13 @@ public class ClusterSelectedRegionService implements PulseService {
       }
 
       regionJSON.put("memoryReadsTrend",
-          mapper.valueToTree(reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_GETS_PER_SEC_TREND)));
+          mapper.<JsonNode>valueToTree(reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_GETS_PER_SEC_TREND)));
       regionJSON.put("memoryWritesTrend",
-          mapper.valueToTree(reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_PUTS_PER_SEC_TREND)));
+          mapper.<JsonNode>valueToTree(reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_PUTS_PER_SEC_TREND)));
       regionJSON.put("diskReadsTrend",
-          mapper.valueToTree(reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_DISK_READS_PER_SEC_TREND)));
+          mapper.<JsonNode>valueToTree(reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_DISK_READS_PER_SEC_TREND)));
       regionJSON.put("diskWritesTrend",
-          mapper.valueToTree(reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_DISK_WRITES_PER_SEC_TREND)));
+          mapper.<JsonNode>valueToTree(reg.getRegionStatisticTrend(Cluster.Region.REGION_STAT_DISK_WRITES_PER_SEC_TREND)));
 
       regionJSON.put("emptyNodes", reg.getEmptyNode());
       Long entrySize = reg.getEntrySize();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/23950e80/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterSelectedRegionsMemberService.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterSelectedRegionsMemberService.java
b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterSelectedRegionsMemberService.java
index 00807d9..f99e6d6 100644
--- a/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterSelectedRegionsMemberService.java
+++ b/geode-pulse/src/main/java/com/vmware/gemfire/tools/pulse/internal/service/ClusterSelectedRegionsMemberService.java
@@ -115,19 +115,19 @@ public class ClusterSelectedRegionsMemberService implements PulseService
{
         LOGGER.finest("calling getSelectedRegionsMembersJson :: rom.getLocalMaxMemory() =
" + rom.getLocalMaxMemory());
 
         memberJSON.put("memoryReadsTrend",
-            mapper.valueToTree(rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_GETS_PER_SEC_TREND)));
+            mapper.<JsonNode>valueToTree(rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_GETS_PER_SEC_TREND)));
         LOGGER.finest("memoryReadsTrend = " + rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_GETS_PER_SEC_TREND).length);
 
         memberJSON.put("memoryWritesTrend",
-            mapper.valueToTree(rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_PUTS_PER_SEC_TREND)));
+            mapper.<JsonNode>valueToTree(rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_PUTS_PER_SEC_TREND)));
         LOGGER.finest("memoryWritesTrend = " + rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_PUTS_PER_SEC_TREND).length);
 
         memberJSON.put("diskReadsTrend",
-            mapper.valueToTree(rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_DISK_READS_PER_SEC_TREND)));
+            mapper.<JsonNode>valueToTree(rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_DISK_READS_PER_SEC_TREND)));
         LOGGER.finest("diskReadsTrend = " + rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_DISK_READS_PER_SEC_TREND).length);
 
         memberJSON.put("diskWritesTrend",
-            mapper.valueToTree(rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_DISK_WRITES_PER_SEC_TREND)));
+            mapper.<JsonNode>valueToTree(rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_DISK_WRITES_PER_SEC_TREND)));
         LOGGER.finest("diskWritesTrend = " + rom.getRegionOnMemberStatisticTrend(RegionOnMember.REGION_ON_MEMBER_STAT_DISK_WRITES_PER_SEC_TREND).length);
 
         regionMemberJSON.put(rom.getMemberName(), memberJSON);


Mime
View raw message