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 <[email protected]> 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 >
