On Wed, Nov 27, 2013 at 2:02 PM, Udara Liyanage <[email protected]> wrote:

> What is the difference between  below two methods. What is the correct way
> of doing $subject
>
>  private int memberCount;
> //This map will keep number of currently spawned instance count against
> partitionId
>     private Map<String, Integer> partitionCountMap;
>
> public int getMemberCount() {
>         return memberCount;
>     }
>

This is the number of members in this cluster.(all the members)
For $subject you need this, hope you want to take overall count.


>
> public int getMemberCount(String partitionId){
>         if(partitionCountMap.containsKey(partitionId)) {
>             return partitionCountMap.get(partitionId);
>         }
>         return 0;
>     }
>

This is the count in a particular partition.



>
> --
> Udara Liyanage
> Software Engineer
>  WSO2, Inc.: http://wso2.com
> lean. enterprise. middleware
>
> web: http://udaraliyanage.wordpress.com
> phone: +94 71 443 6897
>



-- 
--
Lahiru Sandaruwan
Software Engineer,
Platform Technologies,
WSO2 Inc., http://wso2.com
lean.enterprise.middleware

email: [email protected] cell: (+94) 773 325 954
blog: http://lahiruwrites.blogspot.com/
twitter: http://twitter.com/lahirus
linked-in: http://lk.linkedin.com/pub/lahiru-sandaruwan/16/153/146

Reply via email to