cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rohit Yadav <rohit.ya...@citrix.com>
Subject RE: API Updates: Tracking progress, changes
Date Tue, 25 Dec 2012 03:09:25 GMT
Hi Alex,

We got rid of IdentityMapper and enforced the translation of over the wire UUID string to
internal long int ID, so we know if internal IDs are used in any case starting 4.1 it will
break any client, script that are based off internal ID and not UUID strings. Few folks on
the ML have expressed concerns, but we need this change and to enforce that we won't have
any backward compatibility for over the wire api params to accept internal IDs.

I'll start moving out the code for all the adapter impls under plugins and start writing tests
for main loop and security adapters. I'm not sure about test drivers, so a test driver would
test contract of an interface by testing on specific sets of methods on the adapter and on
the plugin without having to test all the parts of a class?

Regards.

________________________________________
From: Alex Huang [Alex.Huang@citrix.com]
Sent: Tuesday, December 25, 2012 6:52 AM
To: cloudstack-dev@incubator.apache.org
Subject: RE: API Updates: Tracking progress, changes

Rohit & Prasanna,

I thought about this over the weekend a little bit.  I think testing the entire range of commands
really is an automated system test.  I think adding to current set of automated tests is fine
but it really serves no purpose in testing the changes in this api refactoring.

What you really changed is the processing loop and moving code out to adapters.  The right
thing to do is actually to write a test case that tests that main loop and also test drivers
for the security adapters.  So test drivers here is different than unit tests.  Unit tests
understands how your code works and you can write that too but test drivers loads code specified
and tests the interface to make sure in all situations the contract is upheld.

Also the actual adapter implementations need to be moved under plugins.  They should not be
any part of the api/server/core package.

--Alex

> -----Original Message-----
> From: Prasanna Santhanam [mailto:prasanna.santhanam@citrix.com]
> Sent: Sunday, December 23, 2012 7:39 PM
> To: cloudstack-dev@incubator.apache.org
> Subject: Re: API Updates: Tracking progress, changes
>
> On Mon, Dec 24, 2012 at 08:27:52AM +0530, Min Chen wrote:
> > Added recent change and TODO item for list api performance
> > optimization.
> >
> > Thanks
> > -min
> >
> > On 12/23/12 6:20 PM, "Rohit Yadav"
> > <rohit.yadav@citrix.com<mailto:rohit.yadav@citrix.com>> wrote:
> >
> > This thread is for tracking progress, changes on api_refactoring.
> >
> > Current changes:
> > 1. Introduction of a new InternalIdentity interface that provides a
> > contract for any extending Interface or implementing class that it
> > would have a getId() method that returns the internal id (long).
> > 2. Merge master on api_refactoring to get the latest changes, all
> > merge conflicts (about 3k lines) resolved.
> > 3. Host/hypervisor simulator runs with the mgmt server when the
> > profile simulator (mvn xxx -P simulator) is selected.
>
> The simulator is mostly running now save for systemVms that don't come
> up unless you remove the SecondaryStorageDiscoverer from
> components.xml. I'm still figuring out how to fix ComponentLocator to
> not load multiple adapters of the same name.
>
> Until then do the following:
> diff --cc build/replace.properties
> index c9a93c2,c9a93c2..23156ed
> --- a/build/replace.properties
> +++ b/build/replace.properties
> @@@ -24,6 -24,6 +24,6 @@@ DBHOST=localhos
>   AGENTLOGDIR=logs
>   AGENTLOG=logs/agent.log
>   MSMNTDIR=/mnt
> --COMPONENTS-SPEC=components.xml
> ++COMPONENTS-SPEC=components-simulator.xml
>   AWSAPILOG=awsapi.log
>   REMOTEHOST=localhost
> diff --cc client/tomcatconf/components.xml.in
> index 5957b61,5957b61..d224356
> --- a/client/tomcatconf/components.xml.in
> +++ b/client/tomcatconf/components.xml.in
> @@@ -130,7 -130,7 +130,6 @@@ under the License
>           </adapters>
>           <adapters key="com.cloud.resource.Discoverer">
>               <adapter name="XCP Agent"
> class="com.cloud.hypervisor.xen.discoverer.XcpServerDiscoverer"/>
> --            <adapter name="SecondaryStorage"
> class="com.cloud.storage.secondary.SecondaryStorageDiscoverer"/>
>               <adapter name="KVM Agent"
> class="com.cloud.hypervisor.kvm.discoverer.KvmServerDiscoverer"/>
>               <adapter name="Bare Metal Agent"
> class="com.cloud.baremetal.BareMetalDiscoverer"/>
>               <adapter name="SCVMMServer"
> class="com.cloud.hypervisor.hyperv.HypervServerDiscoverer"/>
>
>
> And then to startup the simulator:
> mvn -Psimulator clean install
> mvn -Pdeveloper -pl developer -Ddeploydb
> mvn -Pdeveloper -pl developer -Ddeploydb-simulator
> mvn -pl client jetty:run
>
> > 4. Correctly annotate @Parameter on *all apis* and remove
> > @IdentityMapper, except for few in plugin whose VO classes did not
> > implement an interface. For. ex:  ExternalLoadBalancerDeviceVO,
> > NiciraNvpDeviceVO
> > 5. Get rid of IdentityMapper annotation processing code in
> > ApiDispatcher.
> >   6. Replace IdentityProxy field in all Response classes by String
> >   field except CreateCmdResponse.
> >   7. Created Host db join view to improve listHostsCmd performance.
> >
> > TODO:
> > 1. Prasanna to completely resurrect the simulator.
> Check:
> There might be some commands that might be missing from Simulator's set
> but we
> can fix those along the way as we hit the corressponding API Cmd.
>
> > 2. Fix ACL Role and checkaccess adapters, move out config. to the
> > plugin and implement an interface for ACL adapter to get mappings of
> > apiname etc.
> > 3. Rename @Implementation to @Command and introduce name field so
> we
> > tightly couple over the wire api name to the Cmd class (no mappings
> > in properties files necessary).
> >   4. Performance profiling for several costly list APIs
> >   (listAccountsCmd, listUserCmd, listVolumesCmd, listStorgePoolsCmd)
> >   identified by QAs and look into creation of DB join views for
> >   these responses.
>
> 5. Come up with the marvin configurations covering the admin APIs/user
> APIs.
> 6. CRUD tests
>
> I'll start on 5 & 6 tomorrow.
>
> Happy Christmas and Happy Holidays to all!
>
> --
> Prasanna.,

Mime
View raw message