+1 this was a long due one. We have to do the same for all Threads used in
Stratos code.

On Sun, Oct 5, 2014 at 11:50 AM, Rajkumar Rajaratnam <rajkum...@wso2.com>
wrote:

> Hi,
>
> I have done the changes as in the previous mail.
>
> I am proposing one more changes to cluster monitors.
>
> Shall we use java executor services instead of thread sleep?
>
> For example, we are sleeping the thread in cluster monitors to monitor the
> cluster periodically.
>
> Instead, if we use ScheduledExecutorService, the logic would be more
> cleaner, readable, understandable and maintainable.
>
> wdyt?
>
> Thanks.
>
> On Thu, Oct 2, 2014 at 8:59 PM, Rajkumar Rajaratnam <rajkum...@wso2.com>
> wrote:
>
>> Hi,
>>
>> As discussed in the hangout, in AutoscalerHealthStatEventReceiver[1] we
>> are checking the cluster types, and doing things accordingly like below.
>>
>>                 if(monitor.getClusterType() ==
>> ClusterType.VMServiceCluster
>>                 || monitor.getClusterType() == ClusterType.VMLbCluster) {
>>                 //do stuff
>>                 } else if(monitor.getClusterType() ==
>> ClusterType.KubernetesServiceCluster) {
>>                        //do stuff
>>                 }
>>
>> IMO, better we introduce abstract methods, handleEventX(),
>> in AbstractClusterMonitor per events.
>>
>> For example,
>>
>> handleAverageLoadAverageEvent(AverageLoadAverageEvent
>> avgLoadAverageEvent);
>>
>> Then we can handle this event accordingly by overriding this method in
>> relevant concrete monitors.
>>
>> It will eliminate all if/else checking in the autoscaler event receiver.
>> Also we simply delegate the event to the relevant cluster monitor so that
>> they can do what ever they want to do with the event, rather than doing
>> stuffs at events receivers.
>>
>> wdyt?
>>
>> 1.
>> https://github.com/apache/stratos/blob/master/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/health/AutoscalerHealthStatEventReceiver.java
>>
>> Thanks
>>
>> On Tue, Sep 23, 2014 at 11:43 PM, Rajkumar Rajaratnam <rajkum...@wso2.com
>> > wrote:
>>
>>> Hi,
>>>
>>> *Review notes*
>>>
>>>    - use the word kubernetes instead of docker when naming classes
>>>    - arguments should be less than or equal to 4 (we need to add it to
>>>    coding practices!?)
>>>    - add licence header
>>>    - map variables names should have a clue about the map (say,
>>>    clusterIdToClusterMonitorMap)
>>>    - some classes and methods missing comments
>>>    - use complete topology event only once
>>>    - use event names for variables instead of using 'e' (say,
>>>    ClusterCreatedEvent)
>>>    - find abstraction in the things we do upon receiving health stats
>>>    events (set load avg value), to eliminate if/else
>>>
>>> Find the hangout video at [1]
>>>
>>> 1. https://www.youtube.com/watch?v=X0Jh_JCL7ZI
>>>
>>> Thanks.
>>>
>>> On Tue, Sep 23, 2014 at 7:27 PM, Chamila De Alwis <chami...@wso2.com>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> Please find the hangout at
>>>> https://plus.google.com/hangouts/_/hoaevent/AP36tYfCemYdNWEw38lnSZqhRCIA8rqA-FTHXaP0zw9juKeBvPIxiQ?authuser=0&hl=en
>>>>
>>>>
>>>> Regards,
>>>> Chamila de Alwis
>>>> Software Engineer | WSO2 | +94772207163
>>>> Blog: code.chamiladealwis.com
>>>>
>>>>
>>>>
>>>> On Tue, Sep 23, 2014 at 11:15 AM, Rajkumar Rajaratnam <
>>>> rajkum...@wso2.com> wrote:
>>>>
>>>>> Hi Imesh,
>>>>>
>>>>> You can find more information on the mail thread "Stratos Cluster
>>>>> Monitoring"
>>>>>
>>>>> Thanks.
>>>>>
>>>>> On Tue, Sep 23, 2014 at 10:38 AM, Imesh Gunaratne <im...@apache.org>
>>>>> wrote:
>>>>>
>>>>>> Hi Rajkumar,
>>>>>>
>>>>>> Can you please point me to a mail thread/wiki page where we have more
>>>>>> information on this improvement?
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> On Mon, Sep 22, 2014 at 11:00 AM, Lakmal Warusawithana <
>>>>>> lak...@wso2.com> wrote:
>>>>>>
>>>>>>> +1
>>>>>>>
>>>>>>> On Mon, Sep 22, 2014 at 4:51 PM, Rajkumar Rajaratnam <
>>>>>>> rajkum...@wso2.com> wrote:
>>>>>>>
>>>>>>>> Hi all,
>>>>>>>>
>>>>>>>> Can we have $Subject tomorrow (Tue, September 23) at 7:30 PM
>>>>>>>> GMT+5:30 ?
>>>>>>>>
>>>>>>>> We will be reviewing about the changes done to existing cluster
>>>>>>>> monitor hierarchy to allow any 'entity' cluster monitors to be plugged 
>>>>>>>> in
>>>>>>>> and the initial version of docker cluster monitoring.
>>>>>>>>
>>>>>>>> Thanks.
>>>>>>>>
>>>>>>>> --
>>>>>>>> Rajkumar Rajaratnam
>>>>>>>> Software Engineer | WSO2, Inc.
>>>>>>>> Mobile +94777568639 | +94783498120
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Lakmal Warusawithana
>>>>>>> Vice President, Apache Stratos
>>>>>>> Director - Cloud Architecture; WSO2 Inc.
>>>>>>> Mobile : +94714289692
>>>>>>> Blog : http://lakmalsview.blogspot.com/
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Imesh Gunaratne
>>>>>>
>>>>>> Technical Lead, WSO2
>>>>>> Committer & PMC Member, Apache Stratos
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Rajkumar Rajaratnam
>>>>> Software Engineer | WSO2, Inc.
>>>>> Mobile +94777568639 | +94783498120
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Rajkumar Rajaratnam
>>> Software Engineer | WSO2, Inc.
>>> Mobile +94777568639 | +94783498120
>>>
>>
>>
>>
>> --
>> Rajkumar Rajaratnam
>> Software Engineer | WSO2, Inc.
>> Mobile +94777568639 | +94783498120
>>
>
>
>
> --
> Rajkumar Rajaratnam
> Software Engineer | WSO2, Inc.
> Mobile +94777568639 | +94783498120
>



-- 
Best Regards,
Nirmal

Nirmal Fernando.
PPMC Member & Committer of Apache Stratos,
Senior Software Engineer, WSO2 Inc.

Blog: http://nirmalfdo.blogspot.com/

Reply via email to