[ 
https://issues.apache.org/jira/browse/GEODE-3955?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16280315#comment-16280315
 ] 

ASF GitHub Bot commented on GEODE-3955:
---------------------------------------

jdeppe-pivotal commented on a change in pull request #1099: GEODE-3955: Add AEQ 
and Gateway Sender information to 'describe region' output.
URL: https://github.com/apache/geode/pull/1099#discussion_r153928571
 
 

 ##########
 File path: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DescribeRegionCommand.java
 ##########
 @@ -55,153 +54,129 @@ public Result describeRegion(
       @CliOption(key = CliStrings.DESCRIBE_REGION__NAME, optionContext = 
ConverterHint.REGION_PATH,
           help = CliStrings.DESCRIBE_REGION__NAME__HELP, mandatory = true) 
String regionName) {
 
-    Result result;
-
     InternalCache cache = getCache();
     ResultCollector<?, ?> rc =
-        CliUtil.executeFunction(getRegionDescription, regionName, 
CliUtil.getAllMembers(cache));
+        CliUtil.executeFunction(getRegionDescription, regionName, 
getAllNormalMembers(cache));
 
     List<?> resultList = (List<?>) rc.getResult();
 
-    // The returned result could be a region description with per member and 
/or single local
-    // region
-    Object[] results = resultList.toArray();
-    List<RegionDescription> regionDescriptionList = new ArrayList<>();
-
-    for (int i = 0; i < results.length; i++) {
-
-      if (results[i] instanceof RegionDescriptionPerMember) {
-        RegionDescriptionPerMember regionDescPerMember = 
(RegionDescriptionPerMember) results[i];
-
-        if (regionDescPerMember != null) {
-          RegionDescription regionDescription = new RegionDescription();
-          regionDescription.add(regionDescPerMember);
-
-          for (int j = i + 1; j < results.length; j++) {
-            if (results[j] != null && results[j] instanceof 
RegionDescriptionPerMember) {
-              RegionDescriptionPerMember preyRegionDescPerMember =
-                  (RegionDescriptionPerMember) results[j];
-              if (regionDescription.add(preyRegionDescPerMember)) {
-                results[j] = null;
-              }
-            }
-          }
-          regionDescriptionList.add(regionDescription);
-        }
-      } else if (results[i] instanceof Throwable) {
-        Throwable t = (Throwable) results[i];
-        LogWrapper.getInstance().info(t.getMessage(), t);
+    // Log any errors received.
+    
resultList.stream().filter(Throwable.class::isInstance).map(Throwable.class::cast)
+        .forEach(t -> LogWrapper.getInstance().info(t.getMessage(), t));
 
 Review comment:
   I don't think this should be using `LogWrapper` - isn't that only for 
immediate gfsh use? Rather `LogService.getLogger()`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> The gfsh 'describe region' command doesn't include asyncEventQueueIds or 
> gatewaySenderIds
> -----------------------------------------------------------------------------------------
>
>                 Key: GEODE-3955
>                 URL: https://issues.apache.org/jira/browse/GEODE-3955
>             Project: Geode
>          Issue Type: Improvement
>          Components: management
>            Reporter: Barry Oglesby
>            Priority: Minor
>             Fix For: 1.4.0
>
>         Attachments: geode-3955.diff
>
>
> The {{constructor}} and {{getNonDefaultAttributes}} methods in 
> {{org.apache.geode.management.internal.cli.domain.RegionAttributesInfo}} 
> class would have to be modified to include the {{asyncEventQueueIds}} and 
> {{gatewaySenderIds}}. 
> I did a quick modification of this class (attached).
> With these changes, 'describe region' looks like:
> {noformat}
> gfsh>describe region --name=/data
> ..........................................................
> Name            : data
> Data Policy     : partition
> Hosting Members : ln-1
> Non-Default Attributes Shared By Hosting Members  
>   Type    |         Name          | Value
> --------- | --------------------- | ---------
> Region    | data-policy           | PARTITION
>           | async-event-queue-ids | db
>           | size                  | 0
>           | gateway-sender-ids    | ny
> Partition | redundant-copies      | 1
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to