[Ovirt-devel] Ovirt QMF API Proposal

Bryan Kearney bkearney at redhat.com
Thu Apr 2 12:51:46 UTC 2009


Ian Main wrote:
> On Wed, 01 Apr 2009 09:59:54 -0400
> Bryan Kearney <bkearney at redhat.com> wrote:
> 
>> Ian Main wrote:
>>> # Look up completed tasks.
>>> tasks = s.objects(:class => 'Task', 'completed' => true)
>> How does this work on the backend? Are all Tasks instantiated and 
>> managed by the agent, or does this turn into a method call to get he 
>> managed objects?
>>
> 
> All tasks are instantiated and managed by the agent as you say.
> When you do a query like this QMF uses AMQP to send a message to all
> agents requesting that each agent return all object IDs for objects that
> match the given criteria.  

Here is my real question. The c++ and java agents all have 
"registerObject" and "registerClass" methods. The methods store in 
memory copies of the objects which queries go against. If the goal is to 
get an object out of the DB, it seems like you would need to register a 
Factory/Finder/EJBHome type class which returns the managed objects.

So. when I see this method:

tasks = s.objects(:class => 'Task', 'completed' => false)

I assume that the query will only return those tasks which are completed 
_and_ in memory at the time. Not against the DB. Is that correct and 
intended?


-- bk




More information about the ovirt-devel mailing list