Return-Path: X-Original-To: apmail-airavata-dev-archive@www.apache.org Delivered-To: apmail-airavata-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9F3E811114 for ; Tue, 5 Aug 2014 18:59:53 +0000 (UTC) Received: (qmail 67393 invoked by uid 500); 5 Aug 2014 18:59:53 -0000 Delivered-To: apmail-airavata-dev-archive@airavata.apache.org Received: (qmail 67342 invoked by uid 500); 5 Aug 2014 18:59:53 -0000 Mailing-List: contact dev-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list dev@airavata.apache.org Received: (qmail 67328 invoked by uid 99); 5 Aug 2014 18:59:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Aug 2014 18:59:53 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of samindaw@gmail.com designates 209.85.215.41 as permitted sender) Received: from [209.85.215.41] (HELO mail-la0-f41.google.com) (209.85.215.41) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Aug 2014 18:59:50 +0000 Received: by mail-la0-f41.google.com with SMTP id s18so1094511lam.28 for ; Tue, 05 Aug 2014 11:59:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=3WYahsFYvgVSdltp47mYL+ui9N35kXoClvw3ufv7f60=; b=nK5TYynPp/ypipeWqqCZOTQV2igIzzD5L3Tm5cN3C9xr9qRaMW4XlKXEEZXLUVNyaN UQN0RQ49L/UXivNkxw4fKcUq7rx9fHgl8fHvskDMGhapdm5Iw4cI7DFyrmLp9ANK4rKP pfKlLymtVGm9v6tLXay3QW/qDQu+HNvqwxk6jAt3kCPcupZLKoUJJX+7QsfC8kpx8YYY TrZd3h8/Gcff/LH2qfw+TbK2/hHEsPY2UAfcHvBiXdYZ/YvYjb0RSJeoN27iTDayC0Pm U6f0oOjLcTDzixWjOOKt38ONSHLxWGVD4v/0vlnVJ15HJFkGwgAPspxcVe03l+PPH64b cIUg== X-Received: by 10.112.62.132 with SMTP id y4mr5367388lbr.105.1407265164668; Tue, 05 Aug 2014 11:59:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.119.241 with HTTP; Tue, 5 Aug 2014 11:59:04 -0700 (PDT) In-Reply-To: References: From: Saminda Wijeratne Date: Tue, 5 Aug 2014 14:59:04 -0400 Message-ID: Subject: Re: How to add a new Jobsubmission To: dev Content-Type: multipart/alternative; boundary=001a11c3ac003eb45a04ffe67469 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c3ac003eb45a04ffe67469 Content-Type: text/plain; charset=UTF-8 Hi Lahiru, I understand your pain. You guessed it correct. All these inconveniences are due to limitations in thrift where it doesn't support inheritance and polymorphism. We'd be glad for a better approach which thrift would also support. :) On Tue, Aug 5, 2014 at 12:32 AM, Lahiru Gunathilake wrote: > Hi All, > > Please bear with me for my less knowledge about thrift, I have following > questions about thrift models in app-catalog when I tried to add a new > jobSubmission to computeResourceModel. > > We have few JobSubmissionProtocols and I wanted to add a new protocol. I > am not sure why we have defined each struct separate, why can't we have > inheritance(my guess is thrift doesn't support). > > When I added the new type I realized I have to add a new method in > Airavata.java to store that new type. Each Job Submission protocol has to > be saved first and have to implement a new method to add that. For me this > seems little odd. We have methods > like addSSHJobSubmissionDetails, addLocalSubmissionDetails. This is a very > big change because I have to again add a new method to Airavata thrift > service and add an implementation to AiravataServerHandler. When I look in > to these objects they cannot be re-used among compute resources because > they have very much machine specific details like(ssh port etc), so a > single SSHJobSubmission object shouldn't be shared among different hosts, > in that case why do we have to save them separate and get an ID and set > that ID to computing resource. > > And there is another class ComputeResourceImpl and it has the same set of > methods to add each and every object then I have to add another method to > that and invoke that in the AiravataServerHandler.java. Can someone please > tell me why do we have to invoke registry 4 times to save a > computingResource, why can't I just set everything to the computing > Resource and save with a single operation ? What are the reasons we have > operations to save each atomic things in computingResources and give > computingResourceId for each component. > > For all these questions, the only answer is that thrift doesn't support > inheritance,then I do understand... otherwise we can improve it. As a CPI > user I feels this is too complex and very difficult to develop and modify a > single thing in CPI I have to change so many places. > > Regards > Lahiru > -- > System Analyst Programmer > PTI Lab > Indiana University > --001a11c3ac003eb45a04ffe67469 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Lahiru,

I understand your pain. You guessed it c= orrect. All these inconveniences are due to limitations in thrift where it = doesn't support inheritance and polymorphism. We'd be glad for a be= tter approach which thrift would also support. :)


On Tue,= Aug 5, 2014 at 12:32 AM, Lahiru Gunathilake <glahiru@gmail.com> wrote:
Hi All,

= Please bear with me for my less knowledge about thrift, I have following qu= estions about thrift models =C2=A0in app-catalog when I tried to add a new = jobSubmission to computeResourceModel.

We have few JobSubmissionProtocols and I wanted to add = a new protocol. I am not sure why we have defined each struct separate, why= can't we have inheritance(my guess is thrift doesn't support).

When I added the new type I realized I have to add a ne= w method in Airavata.java to store that new type. Each Job Submission proto= col has to be saved first and have to implement a new method to add =C2=A0t= hat. For me this seems little odd. We have methods like=C2=A0addSSHJobSubmi= ssionDetails,=C2=A0addLocalSubmissionDetails. This is a very big change bec= ause I have to again add a new method to Airavata thrift service and add an= implementation to AiravataServerHandler. When I look in to these objects t= hey cannot be re-used among compute resources because they have very much m= achine specific details like(ssh port etc), so a single SSHJobSubmission ob= ject shouldn't be shared among different hosts, in that case why do we = have to save them separate and get an ID and set that ID to computing resou= rce.

And there is another class ComputeResourceImpl and it h= as the same set of methods to add each and every object then I have to add = another method to that and invoke that in the AiravataServerHandler.java. C= an someone please tell me why do we have to invoke registry 4 times to save= a computingResource, why can't I just set everything to the computing = Resource and save with a single operation ? What are the reasons we have op= erations to save each atomic things in computingResources and give computin= gResourceId for each component.

For all these questions, the only answer is that thrift= doesn't support inheritance,then I do understand... otherwise we can i= mprove it. As a CPI user I feels this is too complex and very difficult to = develop and modify a single thing in CPI I have to change so many places.

Regards
Lahiru
--
System Analyst Programmer
PTI Lab
Indiana University

--001a11c3ac003eb45a04ffe67469--