You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by Isuru Haththotuwa <is...@apache.org> on 2015/11/18 14:22:10 UTC

[Stratos] [4.1.5] Message Type is Set to an Empty String when Using ClusterStatusProcessorChain

Hi,

In ClusterMonitor [1] and AutoscalerTopologyEventReceiver [2] classes,
there are two occasions where we are sending a message through the
ClusterStatusProcessorChain with type set to an empty String [3, 4]. AFAIK
the processor chain will determine which processor to use based on this
type, and since its empty, the message will not update the ClusterStatus.
Any particular reason to do this?

[1]. org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor
[2].
org.apache.stratos.autoscaler.event.receiver.topology.AutoscalerTopologyEventReceiver
[3].
ServiceReferenceHolder.getInstance().getClusterStatusProcessorChain().
                       * process("", clusterId, clusterInstanceId);*

[4].
ServiceReferenceHolder.getInstance().getClusterStatusProcessorChain().
                      *  process("", cluster.getClusterId(),
clusterInstance.getInstanceId());*



-- 
Thanks and Regards,

Isuru H.
+94 716 358 048* <http://wso2.com/>*

Re: [Stratos] [4.1.5] Message Type is Set to an Empty String when Using ClusterStatusProcessorChain

Posted by Reka Thirunavukkarasu <re...@wso2.com>.
Hi Isuru/Imesh,

This particular processor chain implemented in order to calculate the
status of the application/group/cluster. When an status change occurred in
member, cluster processor chain will get executed to calculate the current
status of the cluster in which that member is being part of. When a member
status changed to a particular status say Activated which could result the
cluster status change to Activated only. Hence, if we know cluster status
changes to particular status as part of member status change, then can pass
that event details to Processor chain. So that only that particular
processor will get executed rather than other processors also executed. In
that case, it will improve the performance. If we are not sure about the
status of the cluster could be decided by a member status change like
Terminated, then cluster processor chain can be invoked by passing empty
string. So that by executing all the processors, the cluster status can be
decided by the very first processor which calculated the status change.

Hope this will help you to understand the logic. Please let me know, if
anything is not clear..

Thanks,
Reka

On Wed, Nov 18, 2015 at 11:13 PM, Imesh Gunaratne <im...@apache.org> wrote:

> I'm sorry Isuru I'm not so sure how this logic works, @Reka: Do you have
> any thoughts?
>
> Thanks
>
> On Wed, Nov 18, 2015 at 6:52 PM, Isuru Haththotuwa <is...@apache.org>
> wrote:
>
>> Hi,
>>
>> In ClusterMonitor [1] and AutoscalerTopologyEventReceiver [2] classes,
>> there are two occasions where we are sending a message through the
>> ClusterStatusProcessorChain with type set to an empty String [3, 4]. AFAIK
>> the processor chain will determine which processor to use based on this
>> type, and since its empty, the message will not update the ClusterStatus.
>> Any particular reason to do this?
>>
>> [1]. org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor
>> [2].
>> org.apache.stratos.autoscaler.event.receiver.topology.AutoscalerTopologyEventReceiver
>> [3].
>> ServiceReferenceHolder.getInstance().getClusterStatusProcessorChain().
>>                        * process("", clusterId, clusterInstanceId);*
>>
>> [4].
>> ServiceReferenceHolder.getInstance().getClusterStatusProcessorChain().
>>                       *  process("", cluster.getClusterId(),
>> clusterInstance.getInstanceId());*
>>
>>
>>
>> --
>> Thanks and Regards,
>>
>> Isuru H.
>> +94 716 358 048* <http://wso2.com/>*
>>
>>
>>
>
>
> --
> Imesh Gunaratne
>
> Senior Technical Lead, WSO2
> Committer & PMC Member, Apache Stratos
>



-- 
Reka Thirunavukkarasu
Senior Software Engineer,
WSO2, Inc.:http://wso2.com,
Mobile: +94776442007

Re: [Stratos] [4.1.5] Message Type is Set to an Empty String when Using ClusterStatusProcessorChain

Posted by Imesh Gunaratne <im...@apache.org>.
I'm sorry Isuru I'm not so sure how this logic works, @Reka: Do you have
any thoughts?

Thanks

On Wed, Nov 18, 2015 at 6:52 PM, Isuru Haththotuwa <is...@apache.org>
wrote:

> Hi,
>
> In ClusterMonitor [1] and AutoscalerTopologyEventReceiver [2] classes,
> there are two occasions where we are sending a message through the
> ClusterStatusProcessorChain with type set to an empty String [3, 4]. AFAIK
> the processor chain will determine which processor to use based on this
> type, and since its empty, the message will not update the ClusterStatus.
> Any particular reason to do this?
>
> [1]. org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor
> [2].
> org.apache.stratos.autoscaler.event.receiver.topology.AutoscalerTopologyEventReceiver
> [3].
> ServiceReferenceHolder.getInstance().getClusterStatusProcessorChain().
>                        * process("", clusterId, clusterInstanceId);*
>
> [4].
> ServiceReferenceHolder.getInstance().getClusterStatusProcessorChain().
>                       *  process("", cluster.getClusterId(),
> clusterInstance.getInstanceId());*
>
>
>
> --
> Thanks and Regards,
>
> Isuru H.
> +94 716 358 048* <http://wso2.com/>*
>
>
>


-- 
Imesh Gunaratne

Senior Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

Re: [Stratos] [4.1.5] Message Type is Set to an Empty String when Using ClusterStatusProcessorChain

Posted by Gayan Gunarathne <ga...@wso2.com>.
Also in the cluster monitor we are getting status change from[1]. AFAIU
that process logic is not execute ever and stateChanged will be always
false.Is n't?

// Checking the current status of the cluster instance
                boolean stateChanged =

ServiceReferenceHolder.getInstance().getClusterStatusProcessorChain()
                                .process("", cluster.getClusterId(),
clusterInstance.getInstanceId());

AFAIU we have to listen to all the cluster events[2] for decide the current
status of the cluster.

[1]
https://github.com/apache/stratos/blob/stratos-4.1.x/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitor.java#L1498
[2]
https://github.com/apache/stratos/tree/stratos-4.1.x/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/cluster/status

Thanks,
Gayan


On Wed, Nov 18, 2015 at 6:52 PM, Isuru Haththotuwa <is...@apache.org>
wrote:

> Hi,
>
> In ClusterMonitor [1] and AutoscalerTopologyEventReceiver [2] classes,
> there are two occasions where we are sending a message through the
> ClusterStatusProcessorChain with type set to an empty String [3, 4]. AFAIK
> the processor chain will determine which processor to use based on this
> type, and since its empty, the message will not update the ClusterStatus.
> Any particular reason to do this?
>
> [1]. org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor
> [2].
> org.apache.stratos.autoscaler.event.receiver.topology.AutoscalerTopologyEventReceiver
> [3].
> ServiceReferenceHolder.getInstance().getClusterStatusProcessorChain().
>                        * process("", clusterId, clusterInstanceId);*
>
> [4].
> ServiceReferenceHolder.getInstance().getClusterStatusProcessorChain().
>                       *  process("", cluster.getClusterId(),
> clusterInstance.getInstanceId());*
>
>
>
> --
> Thanks and Regards,
>
> Isuru H.
> +94 716 358 048* <http://wso2.com/>*
>
>
>


-- 

Gayan Gunarathne
Technical Lead, WSO2 Inc. (http://wso2.com)
Committer & PMC Member, Apache Stratos
email : gayang@wso2.com  | mobile : +94 775030545 <%2B94%20766819985>