Return-Path: X-Original-To: apmail-incubator-cloudstack-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1582CEE29 for ; Wed, 9 Jan 2013 22:40:46 +0000 (UTC) Received: (qmail 9631 invoked by uid 500); 9 Jan 2013 22:40:45 -0000 Delivered-To: apmail-incubator-cloudstack-dev-archive@incubator.apache.org Received: (qmail 9598 invoked by uid 500); 9 Jan 2013 22:40:45 -0000 Mailing-List: contact cloudstack-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-dev@incubator.apache.org Received: (qmail 9590 invoked by uid 99); 9 Jan 2013 22:40:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jan 2013 22:40:45 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rohit.yadav@citrix.com designates 203.166.19.134 as permitted sender) Received: from [203.166.19.134] (HELO SMTP.CITRIX.COM.AU) (203.166.19.134) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jan 2013 22:40:40 +0000 X-IronPort-AV: E=Sophos;i="4.84,440,1355097600"; d="scan'208,217";a="343874" Received: from banpmailmx01.citrite.net ([10.103.128.73]) by SYDPIPO01.CITRIX.COM.AU with ESMTP/TLS/RC4-MD5; 09 Jan 2013 22:40:18 +0000 Received: from BANPMAILBOX01.citrite.net ([10.103.128.72]) by BANPMAILMX01.citrite.net ([10.103.128.73]) with mapi; Thu, 10 Jan 2013 04:10:15 +0530 From: Rohit Yadav To: Min Chen CC: "cloudstack-dev@incubator.apache.org" Date: Thu, 10 Jan 2013 04:10:11 +0530 Subject: Fwd: [MERGE] Merge request: api_refactoring on master Thread-Topic: [MERGE] Merge request: api_refactoring on master Thread-Index: Ac3uukqpddYIw9BPRJeznhnT/VO8JQ== Message-ID: <920FB93F-BECA-495C-8B07-CB8A46160E60@citrix.com> References: <0BCCCE152323764BB7FD6AE6D7A1D9060102894ED07B@BANPMAILBOX01.citrite.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_920FB93FBECA495C8B07CB8A46160E60citrixcom_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_920FB93FBECA495C8B07CB8A46160E60citrixcom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Fwd, +Min, +cs-dev Begin forwarded message: From: Rohit Yadav > Subject: RE: [MERGE] Merge request: api_refactoring on master Date: 9 January 2013 11:36:47 AM PST To: Marcus Sorensen > No, so this change will first of all check the kind of input param we got a= s part of the api request and call getUuid() for: 1. If the API is Pre 3.x (since tag is empty), first we try to convert the = string to long int (only after checking against the uuid regex), if that su= cceeds we getById( this accepts long int id we just parsed), else if regex = suggests that it's uuid, we getByUuid(). In both cases a search query is bu= ilt by GenericDaoBase (see methods by same names) and we expect only one ro= w or result as uuid and id is unique. 2. For API introduced in 3.x and above using the since tag in the @APIComma= nd (previously @Implementation), we only check getUuid() and do the same as= above. In the change we don't get the table info from the @IdentityMapper (this an= notation had previously defined the table name as string within the cmd api= class), we get it through links via the response and the entity referred w= hich end up to a VO class which has the @Table name. Coming back to your question, so the above change applies only when a id is= passed, when just listing vms or for any list apis, we are actually perfor= ming well now, due to db views you don't have 10 or n queries for n entitie= s, Min can talk more about the implementation and how it speeds up the list= ing apis. Regards. ________________________________________ From: Marcus Sorensen [shadowsor@gmail.com] Sent: Wednesday, January 09, 2013 10:56 PM To: Rohit Yadav Subject: Re: [MERGE] Merge request: api_refactoring on master - Remove IdentityMapper and IdentityProxy - Fix api param processing and uuid/id translation. Pre 3.x apis (all apis = except those which has their @APICommand annotation's "since" field set to = 3.xx or 4.xx) accept both uuids (string) and internal (long int) ids. 3.x a= nd later apis are enforced to send uuids for api request to succeed. Does this mean we won't see 10 "SELECT uuid FROM `vm_instance` WHERE id=3D3= 079 OR uuid=3D'3079'" type calls for every VM we have when doing listVirtua= lMachines and such? Min and community, the above question and answer, just fyi. --_000_920FB93FBECA495C8B07CB8A46160E60citrixcom_--