Thanks Reka for the detail explanation. I got the point now. I am in the
process of changing these logic to incorporate deployment policy changes
(earlier, deployment policy refers an application. but now, cartridge or
cartridge group refers a deployment policy). That's why I wanted to
understand this logic.

So this is simple. An application instance bounds to a network partition. A
group instance bounds to a partition within its parent's network partition.
A cluster instance bounds to the same partition as its parent.

Am I correct?

Thanks.

On Sat, Feb 21, 2015 at 10:28 AM, Reka Thirunavukkarasu <r...@wso2.com>
wrote:

> Hi
>
>
>
> On Fri, Feb 20, 2015 at 7:44 PM, Rajkumar Rajaratnam <rajkum...@wso2.com>
> wrote:
>
>>
>>
>> On Sat, Feb 21, 2015 at 7:36 AM, Imesh Gunaratne <im...@apache.org>
>> wrote:
>>
>>> This method creates a copy of the network partition that it belongs to
>>> and call it "Group Level Network Partition Context".
>>>
>>
>> Thanks Imesh for the clarification. So purpose of this method is to
>> create a "Group Level Network Partition Context" obj for a group instance
>> or return if it already exists in the group monitor. But why it is checking
>> whether the parent of this group is having a "Group Level Network Partition
>> Context" obj already in the group monitor? If the parent is having "Group
>> Level Network Partition Context" obj, it is returning the same obj. Does
>> this mean the parent and the child groups are having the same "Group Level
>> Network Partition Context"?
>>
>
> What do you mean by getting the Group Level Network Partition Context from
> parent? Can you point me the line no of the code? If you meant the 
> parentInstanceContext,
> then that is not a type NetworkPartitionContext. ParentInstanceContext is a
> dataholder of ParentInstance. Let me explain a bit about how we handle this.
>
> As you may know, we are parsing policies in application level or group
> level or cluster level according to the policy plugged to the application.
> Also, we are not just creating  one instance of application. Rather we
> support multiple application instances or group instances or cluster
> instances. With the instances concept only, we have achieved group scaling
> and high availability for a group/application by creating multiple
> instances of it. Also, we spin application instance per network partition.
> When we create the application instance, we have to choose the correct
> network partition. After that the children of that application will enforce
> to use the same network partition even if they have a deployment policy
> associated with them. With the deployment policy associated with those
> children, they can only choose which partition they need to create their
> group instance or cluster instance. That's why in the GroupMonitor, we are
> getting the networkPartitionId from the parentInstanceContext, since the
> parent has already chosen the networkPartitionId.
>
> This is the same approach when a group chosen a partitionId with the group
> policy, underlying group monitor or cluster monitor will refer to the
> parent and get the correct partitionId.
>
> I will work on sequence diagrams and class diagrams to explain the logic
> implemented.
>
> Thanks,
> Reka
>
>>
>> Thanks.
>>
>>>
>>> On Fri, Feb 20, 2015 at 7:04 PM, Rajkumar Rajaratnam <rajkum...@wso2.com
>>> > wrote:
>>>
>>>> Hi Devs,
>>>>
>>>> Please explain me the logic of this method
>>>> GroupMonitor#getGroupLevelNetworkPartitionContext();
>>>>
>>>>
>>>> https://github.com/apache/stratos/blob/master/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/GroupMonitor.java#L528-558
>>>>
>>>> Thanks.
>>>>
>>>> --
>>>> Rajkumar Rajaratnam
>>>> Committer & PMC Member, Apache Stratos
>>>> Software Engineer, WSO2
>>>>
>>>> Mobile : +94777568639
>>>> Blog : rajkumarr.com
>>>>
>>>
>>>
>>>
>>> --
>>> Imesh Gunaratne
>>>
>>> Technical Lead, WSO2
>>> Committer & PMC Member, Apache Stratos
>>>
>>
>>
>>
>> --
>> Rajkumar Rajaratnam
>> Committer & PMC Member, Apache Stratos
>> Software Engineer, WSO2
>>
>> Mobile : +94777568639
>> Blog : rajkumarr.com
>>
>
>
>
> --
> Reka Thirunavukkarasu
> Senior Software Engineer,
> WSO2, Inc.:http://wso2.com,
> Mobile: +94776442007
>
>
>


-- 
Rajkumar Rajaratnam
Committer & PMC Member, Apache Stratos
Software Engineer, WSO2

Mobile : +94777568639
Blog : rajkumarr.com

Reply via email to