Hi Raj,

What happens for  the validation if another partition algo is added ? Is
the check specifically checking for these two types of algorithms or is it
validating against the types available ?
If it's a specific check then one day when someone adds a new partition
algo this will break.
If it's a check based on the second way - then all is well !

Thank you,
Shiro


On Tue, Feb 17, 2015 at 10:39 AM, Rajkumar Rajaratnam <rajkum...@wso2.com>
wrote:

> Hi,
>
> I have now implemented following deployment policy validations.
>
>    - deployment policy can't be null
>    - deployment policy id can't be null or empty
>    - deployment policy should contain at least one network partition
>    reference
>    - network partition id can't be null or empty
>    - network partitions should be already added
>    - partition algorithm can't be null or empty
>    - partition algorithm should be either one-after-another or round-robin
>    - a network partition reference should contain at least one partition
>    reference
>    - partition id can't be null or empty
>    - partitions should be defined in the relevant network partitions (on
>    network partition deployment)
>    - partition reference should have a valid max value
>
> Please add if I missed any other validations.
>
> Thanks.
>
> On Mon, Feb 16, 2015 at 8:13 PM, Rajkumar Rajaratnam <rajkum...@wso2.com>
> wrote:
>
>> Hi,
>>
>> I have now done the followings and pushed the changes to
>> 4.1.0-beta-deployment-policy-fix branch.
>>
>>    - implemented network partitions management APIs in CC
>>
>>
>>    - switched rest APIs to use CC's network partition management APIs
>>
>> I didn't remove some unused methods in ObjectConverter class to avoid
>> merge conflicts when we merge this branch back to the master. I will remove
>> these methods after the merging process.
>>
>> Now I am going to do the $Subject.
>>
>> Thanks.
>>
>> On Mon, Feb 16, 2015 at 1:57 PM, Rajkumar Rajaratnam <rajkum...@wso2.com>
>> wrote:
>>
>>> Thanks Imesh. Will do the changes.
>>>
>>> Thanks.
>>>
>>> On Mon, Feb 16, 2015 at 1:46 PM, Imesh Gunaratne <im...@apache.org>
>>> wrote:
>>>
>>>> +1 Better to move the Network Partition management logic to Cloud
>>>> Controller and add validations at each level. Please go ahead with this 
>>>> Raj.
>>>>
>>>> Thanks
>>>>
>>>> On Mon, Feb 16, 2015 at 1:24 PM, Gayan Gunarathne <gay...@wso2.com>
>>>> wrote:
>>>>
>>>>> Yeah.Good point Raj. It is better to have that validation too.
>>>>>
>>>>> Thanks,
>>>>> Gayan
>>>>>
>>>>> On Mon, Feb 16, 2015 at 1:19 PM, Rajkumar Rajaratnam <
>>>>> rajkum...@wso2.com> wrote:
>>>>>
>>>>>> To be more clear,
>>>>>>
>>>>>> I am not telling we need to validate "network partitions" while
>>>>>> deploying deployment policy. I am telling we should validate whether all
>>>>>> the network partitions given in the deployment policy are already 
>>>>>> *deployed/added
>>>>>> or not*. This validation is different from network partitions
>>>>>> validation.
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>> On Mon, Feb 16, 2015 at 1:01 PM, Rajkumar Rajaratnam <
>>>>>> rajkum...@wso2.com> wrote:
>>>>>>
>>>>>>> Hi Gayan,
>>>>>>>
>>>>>>> Please find my comments inline.
>>>>>>>
>>>>>>> On Mon, Feb 16, 2015 at 12:41 PM, Gayan Gunarathne <gay...@wso2.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi Raj,
>>>>>>>>
>>>>>>>> I think we don't need to validate the network partition stuff with
>>>>>>>> the deployment policy.It should validate through network partition
>>>>>>>> management API.
>>>>>>>>
>>>>>>>
>>>>>>> The validation I am talking is different from the validation you are
>>>>>>> referring. While deploying deployment policy, we need to validate 
>>>>>>> whether
>>>>>>> the network partitions given in the deployment policy is already 
>>>>>>> deployed
>>>>>>> or not. Otherwise, one can refer a dummy network partition id in the
>>>>>>> deployment policy.
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> Deployment policy has only the reference to the network
>>>>>>>> partitions.Network partition management is done through separate REST 
>>>>>>>> API
>>>>>>>> methods.
>>>>>>>>
>>>>>>>> Yeah currently network partition management API reside in AS. IMO
>>>>>>>> we can move that network partition management to the CC as well.
>>>>>>>>
>>>>>>>
>>>>>>> I also feel CC is the best place to have network partition
>>>>>>> management APIs. Lets hear others' opinion as well.
>>>>>>>
>>>>>>> Thanks.
>>>>>>>
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Gayan
>>>>>>>>
>>>>>>>> On Mon, Feb 16, 2015 at 12:18 PM, Rajkumar Rajaratnam <
>>>>>>>> rajkum...@wso2.com> wrote:
>>>>>>>>
>>>>>>>>> Hi Devs,
>>>>>>>>>
>>>>>>>>> I guess $Subject is not done at the moment. I am in the process of
>>>>>>>>> adding the validation. This is the sample deployment policy.
>>>>>>>>>
>>>>>>>>> {
>>>>>>>>>    "id": "deployment-policy-2",
>>>>>>>>>    "networkPartition": [
>>>>>>>>>       {
>>>>>>>>>          "id": "network-partition-1",
>>>>>>>>>          "partitionAlgo": "one-after-another",
>>>>>>>>>          "partitions": [
>>>>>>>>>             {
>>>>>>>>>                "id": "partition-1",
>>>>>>>>>                "max": 5
>>>>>>>>>             }
>>>>>>>>>          ]
>>>>>>>>>       }
>>>>>>>>>    ]
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> AFAIU, we need to validate two things.
>>>>>>>>>
>>>>>>>>>    - whether all network partitions are already deployed
>>>>>>>>>    - whether all partitions are defined in relevant network
>>>>>>>>>    partitions
>>>>>>>>>
>>>>>>>>> Are there any other stuffs to be validated?
>>>>>>>>>
>>>>>>>>> Further, deployment policy management APIs are at CC side. Network
>>>>>>>>> partitions management APIs are at AS side.
>>>>>>>>>
>>>>>>>>> I am not sure about this. Do we have a convention that we
>>>>>>>>> shouldn't call AS service from CC?
>>>>>>>>> Thanks.
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Rajkumar Rajaratnam
>>>>>>>>> Committer & PMC Member, Apache Stratos
>>>>>>>>> Software Engineer, WSO2
>>>>>>>>>
>>>>>>>>> Mobile : +94777568639
>>>>>>>>> Blog : rajkumarr.com
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>>
>>>>>>>> Gayan Gunarathne
>>>>>>>> Technical Lead
>>>>>>>> WSO2 Inc. (http://wso2.com)
>>>>>>>> email  : gay...@wso2.com  | mobile : +94 766819985
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Rajkumar Rajaratnam
>>>>>>> Committer & PMC Member, Apache Stratos
>>>>>>> Software Engineer, WSO2
>>>>>>>
>>>>>>> Mobile : +94777568639
>>>>>>> Blog : rajkumarr.com
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Rajkumar Rajaratnam
>>>>>> Committer & PMC Member, Apache Stratos
>>>>>> Software Engineer, WSO2
>>>>>>
>>>>>> Mobile : +94777568639
>>>>>> Blog : rajkumarr.com
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> Gayan Gunarathne
>>>>> Technical Lead
>>>>> WSO2 Inc. (http://wso2.com)
>>>>> email  : gay...@wso2.com  | mobile : +94 766819985
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> 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
>>>
>>
>>
>>
>> --
>> Rajkumar Rajaratnam
>> Committer & PMC Member, Apache Stratos
>> Software Engineer, WSO2
>>
>> Mobile : +94777568639
>> Blog : rajkumarr.com
>>
>
>
>
> --
> Rajkumar Rajaratnam
> Committer & PMC Member, Apache Stratos
> Software Engineer, WSO2
>
> Mobile : +94777568639
> Blog : rajkumarr.com
>

Reply via email to