Add some bulk lookup methods to ML2 for RPC handling
This adds three methods to make working with bulk port
DB lookups easier in ML2:
* partial_port_ids_to_full_ids: takes short port IDs map to
full port IDs. This will allow us to eliminate many LIKE
queries and do one just once for all ports on an RPC call.
* get_port_db_objects: Takes a list of port IDs and returns
a map to port DB objects. This allows us to get access to
sqla obejcts for a bunch of ports without a custom
session.query call.
* get_network_contexts: Takes a list of network_ids and does
a bulk construction of NetworkContext objects and returns
them as a map of network_id to NetworkContext to avoid
expensive net lookups when constructing lots of PortContext
objects.
Reviewed: https:/ /review. openstack. org/466394 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=ce0e4b25d5c babaff147cc7212 fe033a95233a54
Committed: https:/
Submitter: Jenkins
Branch: stable/ocata
commit ce0e4b25d5cbaba ff147cc7212fe03 3a95233a54
Author: Kevin Benton <email address hidden>
Date: Thu Apr 6 05:42:25 2017 -0700
Add some bulk lookup methods to ML2 for RPC handling
This adds three methods to make working with bulk port
DB lookups easier in ML2:
* partial_ port_ids_ to_full_ ids: takes short port IDs map to db_objects: Takes a list of port IDs and returns contexts: Takes a list of network_ids and does
full port IDs. This will allow us to eliminate many LIKE
queries and do one just once for all ports on an RPC call.
* get_port_
a map to port DB objects. This allows us to get access to
sqla obejcts for a bunch of ports without a custom
session.query call.
* get_network_
a bulk construction of NetworkContext objects and returns
them as a map of network_id to NetworkContext to avoid
expensive net lookups when constructing lots of PortContext
objects.
Conflicts: plugins/ ml2/db. py plugins/ ml2/plugin. py
neutron/
neutron/
Partial-Bug: #1665215 2f2a7e8ebadf703 7da15c86815 2f7c25d59e57d1e 1e006cb71f)
Change-Id: I330eefbf429bd6
(cherry picked from commit 323eb7f2e146ecc