)]}'
{"nova/api/openstack/placement/objects/resource_provider.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e397d3c26e7a874c289696d7056cfe8f387d7b50","unresolved":false,"context_lines":[{"line_number":2659,"context_line":""},{"line_number":2660,"context_line":""},{"line_number":2661,"context_line":"@db_api.api_context_manager.reader"},{"line_number":2662,"context_line":"def _get_usages_from_trees(ctx, trees, rc_ids):"},{"line_number":2663,"context_line":"    \"\"\"Returns a row iterator of usage records grouped by resource provider ID"},{"line_number":2664,"context_line":"    and resource class ID for all resource providers and resource classes"},{"line_number":2665,"context_line":"    contained in the supplied providers trees."}],"source_content_type":"text/x-python","patch_set":5,"id":"bf659307_70059b13","line":2662,"range":{"start_line":2662,"start_character":32,"end_line":2662,"end_character":37},"updated":"2018-03-29 21:47:29.000000000","message":"Doc this.  (Appears to be a list of root provider IDs, but I had to read to the bottom to figure that out.)","commit_id":"57d5a13f1a289d4aae89243fc909f1294fd68a13"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e397d3c26e7a874c289696d7056cfe8f387d7b50","unresolved":false,"context_lines":[{"line_number":2663,"context_line":"    \"\"\"Returns a row iterator of usage records grouped by resource provider ID"},{"line_number":2664,"context_line":"    and resource class ID for all resource providers and resource classes"},{"line_number":2665,"context_line":"    contained in the supplied providers trees."},{"line_number":2666,"context_line":"    \"\"\""},{"line_number":2667,"context_line":"    rpt \u003d sa.alias(_RP_TBL, name\u003d\"rp\")"},{"line_number":2668,"context_line":"    inv \u003d sa.alias(_INV_TBL, name\u003d\"inv\")"},{"line_number":2669,"context_line":"    usage \u003d sa.alias("}],"source_content_type":"text/x-python","patch_set":5,"id":"bf659307_47ba1c6e","line":2666,"updated":"2018-03-29 21:47:29.000000000","message":"Please add the always-useful comment showing what the SQL ends up looking like.","commit_id":"57d5a13f1a289d4aae89243fc909f1294fd68a13"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e397d3c26e7a874c289696d7056cfe8f387d7b50","unresolved":false,"context_lines":[{"line_number":2699,"context_line":"        inv.c.allocation_ratio,"},{"line_number":2700,"context_line":"        usage.c.used,"},{"line_number":2701,"context_line":"    ]).select_from(usage_join).where("},{"line_number":2702,"context_line":"        sa.and_(rpt.c.root_provider_id.in_(trees),"},{"line_number":2703,"context_line":"                inv.c.resource_class_id.in_(rc_ids)))"},{"line_number":2704,"context_line":"    return ctx.session.execute(query).fetchall()"},{"line_number":2705,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"bf659307_6a004702","line":2702,"range":{"start_line":2702,"start_character":16,"end_line":2702,"end_character":49},"updated":"2018-03-29 21:47:29.000000000","message":"Except for this chunk, this method is identical to _get_usages_by_provider_and_rc.  I think I said this before, but let\u0027s consolidate the two.  There\u0027s no sense having 25 identical lines of complex code that we have to maintain in two places.","commit_id":"57d5a13f1a289d4aae89243fc909f1294fd68a13"}],"nova/objects/resource_provider.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0b38be4fa878ab54239d45b752329da721c1b3fb","unresolved":false,"context_lines":[{"line_number":2622,"context_line":""},{"line_number":2623,"context_line":""},{"line_number":2624,"context_line":"@db_api.api_context_manager.reader"},{"line_number":2625,"context_line":"def _get_usages_from_trees(ctx, trees, rc_ids):"},{"line_number":2626,"context_line":"    \"\"\"Returns a row iterator of usage records grouped by resource provider ID"},{"line_number":2627,"context_line":"    and resource class ID for all resource providers and resource classes"},{"line_number":2628,"context_line":"    contained in the supplied providers trees."}],"source_content_type":"text/x-python","patch_set":1,"id":"7f96bb07_814eb1be","line":2625,"updated":"2018-01-17 23:21:05.000000000","message":"Yeah, so this is useful, but could be more useful.  Technically `trees` could be *any* collection of RP IDs.  IMO that arg should be called \"provider_uuids\" or similar, and we should use this method regardless of whether than list represents\n\n- A single provider\n- All providers in a tree\n- A non-sharing provider plus all providers associated with it via aggregate\n- All providers in a tree plus all providers associated via aggregate with any of the providers in that tree.\n\nThe result is the same shape no matter what, and is equally useful in any of those scenarios.","commit_id":"36981b002757a2ccf19f198d2624e559bb5e14dc"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"4d10e9e6c9e88efd7c3c01954ac2c3fe4a17fa66","unresolved":false,"context_lines":[{"line_number":2622,"context_line":""},{"line_number":2623,"context_line":""},{"line_number":2624,"context_line":"@db_api.api_context_manager.reader"},{"line_number":2625,"context_line":"def _get_usages_from_trees(ctx, trees, rc_ids):"},{"line_number":2626,"context_line":"    \"\"\"Returns a row iterator of usage records grouped by resource provider ID"},{"line_number":2627,"context_line":"    and resource class ID for all resource providers and resource classes"},{"line_number":2628,"context_line":"    contained in the supplied providers trees."}],"source_content_type":"text/x-python","patch_set":1,"id":"7f96bb07_0521e29f","line":2625,"in_reply_to":"7f96bb07_814eb1be","updated":"2018-01-22 13:00:39.000000000","message":"The generalization Eric proposes make sense to me too but I can accept that we only generalize this function when the actual needs arises for a more generic function.","commit_id":"36981b002757a2ccf19f198d2624e559bb5e14dc"}],"nova/tests/functional/db/test_allocation_candidates.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"4d10e9e6c9e88efd7c3c01954ac2c3fe4a17fa66","unresolved":false,"context_lines":[{"line_number":1808,"context_line":""},{"line_number":1809,"context_line":"    def test_get_usages_from_trees(self):"},{"line_number":1810,"context_line":"        \"\"\"Tests that the return from"},{"line_number":1811,"context_line":"        _get_usages_by_provider_and_rc_from_trees() is correctly filtering the"},{"line_number":1812,"context_line":"        usage data based on the supplied provider tree IDs."},{"line_number":1813,"context_line":"        \"\"\""},{"line_number":1814,"context_line":"        # We set up 3 trees of providers that look like this:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f96bb07_454cca75","line":1811,"range":{"start_line":1811,"start_character":8,"end_line":1811,"end_character":49},"updated":"2018-01-22 13:00:39.000000000","message":"nit: _get_usages_from_trees","commit_id":"36981b002757a2ccf19f198d2624e559bb5e14dc"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"4d10e9e6c9e88efd7c3c01954ac2c3fe4a17fa66","unresolved":false,"context_lines":[{"line_number":1847,"context_line":"        SRIOV_NET_VF_ID \u003d fields.ResourceClass.STANDARD.index("},{"line_number":1848,"context_line":"            fields.ResourceClass.SRIOV_NET_VF)"},{"line_number":1849,"context_line":""},{"line_number":1850,"context_line":"        usages \u003d rp_obj._get_usages_from_trees(self.ctx, [1], [VCPU_ID])"},{"line_number":1851,"context_line":"        self.assertEqual(1, len(usages))"},{"line_number":1852,"context_line":""},{"line_number":1853,"context_line":"        usage \u003d usages[0]"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f96bb07_45836a57","line":1850,"range":{"start_line":1850,"start_character":58,"end_line":1850,"end_character":59},"updated":"2018-01-22 13:00:39.000000000","message":"Is this the db id of the first RP the test creates? It would be nice attach a name to it for readability.","commit_id":"36981b002757a2ccf19f198d2624e559bb5e14dc"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"4d10e9e6c9e88efd7c3c01954ac2c3fe4a17fa66","unresolved":false,"context_lines":[{"line_number":1859,"context_line":""},{"line_number":1860,"context_line":"        # Now check that if we ask for SRIOV_NET_VFs, with the first root"},{"line_number":1861,"context_line":"        # provider ID, that we indeed get back the two PFs"},{"line_number":1862,"context_line":"        usages \u003d rp_obj._get_usages_from_trees(self.ctx, [1],"},{"line_number":1863,"context_line":"            [SRIOV_NET_VF_ID])"},{"line_number":1864,"context_line":"        self.assertEqual(2, len(usages))"},{"line_number":1865,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7f96bb07_6588e670","line":1862,"range":{"start_line":1862,"start_character":58,"end_line":1862,"end_character":59},"updated":"2018-01-22 13:00:39.000000000","message":"ditto","commit_id":"36981b002757a2ccf19f198d2624e559bb5e14dc"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"4d10e9e6c9e88efd7c3c01954ac2c3fe4a17fa66","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"7f96bb07_65ed4624","line":1869,"updated":"2018-01-22 13:00:39.000000000","message":"I would add a case when the _get_usages_from_trees is called with a non-root RP id.","commit_id":"36981b002757a2ccf19f198d2624e559bb5e14dc"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"82f8931f8fd39bf6266f25b9f894502147d98d9a","unresolved":false,"context_lines":[{"line_number":1810,"context_line":"        child providers, each with different amounts of MEMORY_MB (min_unit,"},{"line_number":1811,"context_line":"        max_unit and total)."},{"line_number":1812,"context_line":"        \"\"\""},{"line_number":1813,"context_line":"        # We are setting up a single tree that looks like this:"},{"line_number":1814,"context_line":"        #           MEMORY_MB:          MEMORY_MB:"},{"line_number":1815,"context_line":"        #             total: 2048         total: 1024"},{"line_number":1816,"context_line":"        #             min_unit: 256       min_unit: 512"}],"source_content_type":"text/x-python","patch_set":5,"id":"df7087c5_05241fae","line":1813,"updated":"2018-03-23 10:04:50.000000000","message":"I\u0027m not getting why you wipe out the root node in your comment ?","commit_id":"57d5a13f1a289d4aae89243fc909f1294fd68a13"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"82f8931f8fd39bf6266f25b9f894502147d98d9a","unresolved":false,"context_lines":[{"line_number":1893,"context_line":"            name \u003d \u0027cn\u0027 + x + \u0027_numa0\u0027"},{"line_number":1894,"context_line":"            numa_cell0 \u003d self._create_provider(name, parent\u003dcn.uuid)"},{"line_number":1895,"context_line":"            name \u003d \u0027cn\u0027 + x + \u0027_numa1\u0027"},{"line_number":1896,"context_line":"            numa_cell1 \u003d self._create_provider(name, parent\u003dcn.uuid)"},{"line_number":1897,"context_line":""},{"line_number":1898,"context_line":"            name \u003d \u0027cn\u0027 + x + \u0027_numa0_pf0\u0027"},{"line_number":1899,"context_line":"            pf0 \u003d self._create_provider(name, parent\u003dnuma_cell0.uuid)"}],"source_content_type":"text/x-python","patch_set":5,"id":"df7087c5_e5a1ebf8","line":1896,"updated":"2018-03-23 10:04:50.000000000","message":"could we please have a test that would call _get_usages_from_trees() with a flat RP having no children ?\n\nI\u0027m pretty sure it\u0027ll work but that\u0027s really for regression testing.","commit_id":"57d5a13f1a289d4aae89243fc909f1294fd68a13"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e397d3c26e7a874c289696d7056cfe8f387d7b50","unresolved":false,"context_lines":[{"line_number":1925,"context_line":""},{"line_number":1926,"context_line":"        prov_uuids \u003d [r[\u0027resource_provider_uuid\u0027] for r in usages]"},{"line_number":1927,"context_line":"        exp_uuids \u003d [uuids.cn1_numa0_pf0, uuids.cn1_numa1_pf1]"},{"line_number":1928,"context_line":"        self.assertEqual(exp_uuids, prov_uuids)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bf659307_273848ec","line":1928,"updated":"2018-03-29 21:47:29.000000000","message":"Add a test that sets up multiple trees and requests a subset of them.\n\nAdd a test that makes a request using IDs of child nodes and assert those trees don\u0027t come back.\n\nAdd a test that requests the same tree multiple times and assert we only get one copy of the results.","commit_id":"57d5a13f1a289d4aae89243fc909f1294fd68a13"}]}
