An IO optimised method for accessing resource data
This provides a wrapper over the db_api.resource_data_* methods that
attempts to avoid unnecessary database calls for get operations.
On resource create, all resource data is loaded with a single query and
stored with the resource as a dict. Calling data_set() or data_delete()
clears this dict so the next time data() is called all resource
data is loaded again from the database.
There is a future potential optimisation to prefetch the resource.data on
resource_get_by_name_and_stack, which would result in zero resource data
queries for a Stack.load.
This is part of an effort to reduce the number of database queries required
for a Stack.load operation.
Reviewed: https:/ /review. openstack. org/88498 /git.openstack. org/cgit/ openstack/ heat/commit/ ?id=7383f40eb01 3d4188c1ae4e2f4 1ef4b3e6acff92
Committed: https:/
Submitter: Jenkins
Branch: master
commit 7383f40eb013d41 88c1ae4e2f41ef4 b3e6acff92
Author: Steve Baker <email address hidden>
Date: Fri Apr 18 15:37:08 2014 +1200
An IO optimised method for accessing resource data
This provides a wrapper over the db_api. resource_ data_* methods that
attempts to avoid unnecessary database calls for get operations.
On resource create, all resource data is loaded with a single query and
stored with the resource as a dict. Calling data_set() or data_delete()
clears this dict so the next time data() is called all resource
data is loaded again from the database.
There is a future potential optimisation to prefetch the resource.data on get_by_ name_and_ stack, which would result in zero resource data
resource_
queries for a Stack.load.
This is part of an effort to reduce the number of database queries required
for a Stack.load operation.
Change-Id: I2564a9f953841d 895acd5b853a67a a4bc375b635
Related-Bug: #1306743