You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geode.apache.org by Dinesh Akhand <di...@amdocs.com> on 2017/07/07 13:00:23 UTC

RE: Query for JMX "Async Event Queue properties"

Hi Team,



I tried to execute select sql  on  Internal region associated the Async Queue using command “gfsh>query --query=’select * from /AsyncEventQueue_XYZ_PARALLEL_GATEWAY_SENDER_QUEUE’

But in geode 1.1.1



There is a validation check in below method .   we always try to find out the Bean associated with it.   But for internal region we don’t have bean . Can someone suggest how I can skip this check.



Could  you please  suggest more generic check here , so we can make query on internal regions.





Classs:



   management/internal/cli/commands/DataCommands.java



method:

--------------------------------------------------------------------------------------

public static Set<DistributedMember> getRegionAssociatedMembers(String region,

      final InternalCache cache, boolean returnAll) {



    DistributedMember member;



    if (StringUtils.isEmpty(region)) {

      return null;

    }



    DistributedRegionMXBean bean =

        ManagementService.getManagementService(cache).getDistributedRegionMXBean(region);



    if (bean == null) {

      // try with slash ahead

      bean = ManagementService.getManagementService(cache)

          .getDistributedRegionMXBean(Region.SEPARATOR + region);

    }



    if (bean == null) {

      return null;

    }



-------------------------------------------------------------------------------



Thanks,

Dinesh Akhand































-----Original Message-----
From: Barry Oglesby [mailto:boglesby@pivotal.io]
Sent: Thursday, June 22, 2017 12:04 AM
To: dev@geode.apache.org
Subject: Re: Query for JMX "Async Event Queue properties"



I don't see that OR clause on Geode develop. What version of Geode are you using?



In any event, the JMX MBeans are registered using a ResourceEventsListener called ManagementListener. That listener is invoked by handleResourceEvent calls in GemFireCacheImpl for a bunch of different events including region creation. There isn't any other property that could be set to create the MBean for that region.



Rather than test the region name in that OR clause, a slightly better way to implement that would be:



if (!region.isInternalRegion()

    || region.isUsedForParallelGatewaySenderQueue()

    || region.isUsedForSerialGatewaySenderQueue()) {





btw - the MBean should be removed if the region is destroyed. The LocalRegion recursiveDestroyRegion and basicDestroyRegion methods contain code like this that should also be modified like above:



if (!region.isInternalRegion()) {

InternalDistributedSystem system =

region.cache.getInternalDistributedSystem();

system.handleResourceEvent(ResourceEvent.REGION_REMOVE, region); }





Thanks,

Barry Oglesby





On Tue, Jun 20, 2017 at 6:33 AM, Dinesh Akhand <di...@amdocs.com>> wrote:



> Hi Barry,

>

>

>

> Looks like things are already implemented in geode:

>

>

>

> Class : GemFireCacheImpl

>

>

>

> if (!rgn.isInternalRegion() ||

> rgn.getFullPath().contains("GATEWAY_SENDER_QUEUE"))

> {

>

>       system.handleResourceEvent(ResourceEvent.REGION_CREATE, rgn);

>

>     }

>

>

>

> Above code solved my problem .  Async Queue Partition region visible

> in JMX.

>

>

>

> But above code looks like hack in existing code.  Is this fix can we

> take and go ahead because in our requirement we need to show all

> internal partition region.

>

>

>

> Or can we define some property in .properties files to enable stats in

> jmx for internal region?.

>

>

>

> Thanks,

>

> Dinesh Akhand

>

>

>

>

>

> -----Original Message-----

> From: Barry Oglesby [mailto:boglesby@pivotal.io]

> Sent: Saturday, June 17, 2017 2:14 AM

> To: dev@geode.apache.org<ma...@geode.apache.org>

> Subject: Re: Query for JMX "Async Event Queue properties"

>

>

>

> The AsynceEventQueueMBean is monitoring the AsyncEventQueueStats not

> the PartitionedRegionStats. And, actually, the only stat being

> monitored by that MBean is the eventQueueSize stat. The parallel

> AsyncEventQueue creates a colocated PartitionedRegion under the

> covers, and the stats for that PR are the PartitionedRegionStats you

> referenced. There isn't currently any JMX support for those PartitionedRegionStats.

>

>

>

> Are you looking to add support for those PartitionedRegionStats to the

> AsynceEventQueueMBean? If so, I guess there are a few ways to do. The

> first would be to find the underlying PartitionedRegion for the

> parallel AsyncEventQueue, add its PartitionedRegionStats to the

> AsyncEventQueueMBeanBridge's monitor and reference the appropriate

> one(s) (in your case dataStoreBytesInUse). Another would be to

> actually create an MBean for that internal PartitionedRegion.

>

>

>

> Both of these would only be applicable for a parallel AsyncEventQueue.

>

> Serial AsyncEventQueues don't create a PartitionedRegion.

>

>

>

>

>

> Thanks,

>

> Barry Oglesby

>

>

>

>

>

> On Fri, Jun 16, 2017 at 5:38 AM, Dinesh Akhand <dineshak@amdocs.com

> <ma...@amdocs.com>> wrote:

>

>

>

> > Hi Team

>

> >

>

> > Regarding the following metrics:

>

> >

>

> > /AsyncEventQueue_XYZ_PARALLEL_GATEWAY_SENDER_QUEUE:

> PartitionedRegionStats.

>

> > dataStoreEntryCount

>

> > /AsyncEventQueue_XYZ_PARALLEL_GATEWAY_SENDER_QUEUE:

> PartitionedRegionStats.

>

> > dataStoreBytesInUse

>

> >

>

> >

>

> > I found only count for async queue in JMX , it called here

>

> > EventQueueSize = PartitionedRegionStats.dataStoreEntryCount

>

> >

>

> > /** AsyncEventQueue Stats **/

>

> >   public static final String ASYNCEVENTQUEUE_EVENTS_QUEUE_SIZE =

>

> > "eventQueueSize"

>

> >

>

> > we having Missing  PartitionedRegionStats.dataStoreBytesInUse in JMX

>

> > for Async Qeueue.

>

> >

>

> > Can you help me , which property I need to map for it.

>

> >

>

> > Thanks,

>

> > Dinesh Akhand

>

> >

>

> >

>

> > This message and the information contained herein is proprietary and

>

> > confidential and subject to the Amdocs policy statement,

>

> >

>

> > you may review at https://www.amdocs.com/about/email-disclaimer <

>

> > https://www.amdocs.com/about/email-disclaimer>

>

> >

> This message and the information contained herein is proprietary and

> confidential and subject to the Amdocs policy statement,

>

> you may review at https://www.amdocs.com/about/email-disclaimer <

> https://www.amdocs.com/about/email-disclaimer>

>
This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,

you may review at https://www.amdocs.com/about/email-disclaimer <https://www.amdocs.com/about/email-disclaimer>

RE: Query for JMX "Async Event Queue properties"

Posted by Dinesh Akhand <di...@amdocs.com>.
Please suggest on below question.

Thanks,
Dinesh

-----Original Message-----
From: Dinesh Akhand 
Sent: Friday, July 7, 2017 6:30 PM
To: dev@geode.apache.org; boglesby@pivotal.io
Subject: RE: Query for JMX "Async Event Queue properties"

Hi Team,



I tried to execute select sql  on  Internal region associated the Async Queue using command “gfsh>query --query=’select * from /AsyncEventQueue_XYZ_PARALLEL_GATEWAY_SENDER_QUEUE’

But in geode 1.1.1



There is a validation check in below method .   we always try to find out the Bean associated with it.   But for internal region we don’t have bean . Can someone suggest how I can skip this check.



Could  you please  suggest more generic check here , so we can make query on internal regions.





Classs:



   management/internal/cli/commands/DataCommands.java



method:

--------------------------------------------------------------------------------------

public static Set<DistributedMember> getRegionAssociatedMembers(String region,

      final InternalCache cache, boolean returnAll) {



    DistributedMember member;



    if (StringUtils.isEmpty(region)) {

      return null;

    }



    DistributedRegionMXBean bean =

        ManagementService.getManagementService(cache).getDistributedRegionMXBean(region);



    if (bean == null) {

      // try with slash ahead

      bean = ManagementService.getManagementService(cache)

          .getDistributedRegionMXBean(Region.SEPARATOR + region);

    }



    if (bean == null) {

      return null;

    }



-------------------------------------------------------------------------------



Thanks,

Dinesh Akhand































-----Original Message-----
From: Barry Oglesby [mailto:boglesby@pivotal.io]
Sent: Thursday, June 22, 2017 12:04 AM
To: dev@geode.apache.org
Subject: Re: Query for JMX "Async Event Queue properties"



I don't see that OR clause on Geode develop. What version of Geode are you using?



In any event, the JMX MBeans are registered using a ResourceEventsListener called ManagementListener. That listener is invoked by handleResourceEvent calls in GemFireCacheImpl for a bunch of different events including region creation. There isn't any other property that could be set to create the MBean for that region.



Rather than test the region name in that OR clause, a slightly better way to implement that would be:



if (!region.isInternalRegion()

    || region.isUsedForParallelGatewaySenderQueue()

    || region.isUsedForSerialGatewaySenderQueue()) {





btw - the MBean should be removed if the region is destroyed. The LocalRegion recursiveDestroyRegion and basicDestroyRegion methods contain code like this that should also be modified like above:



if (!region.isInternalRegion()) {

InternalDistributedSystem system =

region.cache.getInternalDistributedSystem();

system.handleResourceEvent(ResourceEvent.REGION_REMOVE, region); }





Thanks,

Barry Oglesby





On Tue, Jun 20, 2017 at 6:33 AM, Dinesh Akhand <di...@amdocs.com>> wrote:



> Hi Barry,

>

>

>

> Looks like things are already implemented in geode:

>

>

>

> Class : GemFireCacheImpl

>

>

>

> if (!rgn.isInternalRegion() ||

> rgn.getFullPath().contains("GATEWAY_SENDER_QUEUE"))

> {

>

>       system.handleResourceEvent(ResourceEvent.REGION_CREATE, rgn);

>

>     }

>

>

>

> Above code solved my problem .  Async Queue Partition region visible

> in JMX.

>

>

>

> But above code looks like hack in existing code.  Is this fix can we

> take and go ahead because in our requirement we need to show all

> internal partition region.

>

>

>

> Or can we define some property in .properties files to enable stats in

> jmx for internal region?.

>

>

>

> Thanks,

>

> Dinesh Akhand

>

>

>

>

>

> -----Original Message-----

> From: Barry Oglesby [mailto:boglesby@pivotal.io]

> Sent: Saturday, June 17, 2017 2:14 AM

> To: dev@geode.apache.org<ma...@geode.apache.org>

> Subject: Re: Query for JMX "Async Event Queue properties"

>

>

>

> The AsynceEventQueueMBean is monitoring the AsyncEventQueueStats not

> the PartitionedRegionStats. And, actually, the only stat being

> monitored by that MBean is the eventQueueSize stat. The parallel

> AsyncEventQueue creates a colocated PartitionedRegion under the

> covers, and the stats for that PR are the PartitionedRegionStats you

> referenced. There isn't currently any JMX support for those PartitionedRegionStats.

>

>

>

> Are you looking to add support for those PartitionedRegionStats to the

> AsynceEventQueueMBean? If so, I guess there are a few ways to do. The

> first would be to find the underlying PartitionedRegion for the

> parallel AsyncEventQueue, add its PartitionedRegionStats to the

> AsyncEventQueueMBeanBridge's monitor and reference the appropriate

> one(s) (in your case dataStoreBytesInUse). Another would be to

> actually create an MBean for that internal PartitionedRegion.

>

>

>

> Both of these would only be applicable for a parallel AsyncEventQueue.

>

> Serial AsyncEventQueues don't create a PartitionedRegion.

>

>

>

>

>

> Thanks,

>

> Barry Oglesby

>

>

>

>

>

> On Fri, Jun 16, 2017 at 5:38 AM, Dinesh Akhand <dineshak@amdocs.com

> <ma...@amdocs.com>> wrote:

>

>

>

> > Hi Team

>

> >

>

> > Regarding the following metrics:

>

> >

>

> > /AsyncEventQueue_XYZ_PARALLEL_GATEWAY_SENDER_QUEUE:

> PartitionedRegionStats.

>

> > dataStoreEntryCount

>

> > /AsyncEventQueue_XYZ_PARALLEL_GATEWAY_SENDER_QUEUE:

> PartitionedRegionStats.

>

> > dataStoreBytesInUse

>

> >

>

> >

>

> > I found only count for async queue in JMX , it called here

>

> > EventQueueSize = PartitionedRegionStats.dataStoreEntryCount

>

> >

>

> > /** AsyncEventQueue Stats **/

>

> >   public static final String ASYNCEVENTQUEUE_EVENTS_QUEUE_SIZE =

>

> > "eventQueueSize"

>

> >

>

> > we having Missing  PartitionedRegionStats.dataStoreBytesInUse in JMX

>

> > for Async Qeueue.

>

> >

>

> > Can you help me , which property I need to map for it.

>

> >

>

> > Thanks,

>

> > Dinesh Akhand

>

> >

>

> >

>

> > This message and the information contained herein is proprietary and

>

> > confidential and subject to the Amdocs policy statement,

>

> >

>

> > you may review at https://www.amdocs.com/about/email-disclaimer <

>

> > https://www.amdocs.com/about/email-disclaimer>

>

> >

> This message and the information contained herein is proprietary and

> confidential and subject to the Amdocs policy statement,

>

> you may review at https://www.amdocs.com/about/email-disclaimer <

> https://www.amdocs.com/about/email-disclaimer>

>
This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,

you may review at https://www.amdocs.com/about/email-disclaimer <https://www.amdocs.com/about/email-disclaimer>
This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,

you may review at https://www.amdocs.com/about/email-disclaimer <https://www.amdocs.com/about/email-disclaimer>