)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"498f4d743372f53c95c5b8defb175b9099ee472d","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"placement: ensure RP maps to those RPs that share with it"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The current impelementation doesn\u0027t generate the correct combinations"},{"line_number":10,"context_line":"for the shared resource providers. The flowing cases are fixed in this"},{"line_number":11,"context_line":"patch:"},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"9f436f4f_792e2d44","line":9,"updated":"2017-08-10 11:14:24.000000000","message":"implementation","commit_id":"426bc5ddfc1daebc80e7c498dd91960bea6d0cca"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"498f4d743372f53c95c5b8defb175b9099ee472d","unresolved":false,"context_lines":[{"line_number":7,"context_line":"placement: ensure RP maps to those RPs that share with it"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The current impelementation doesn\u0027t generate the correct combinations"},{"line_number":10,"context_line":"for the shared resource providers. The flowing cases are fixed in this"},{"line_number":11,"context_line":"patch:"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"* Resource providers should only map with those sharing resource providers"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"9f436f4f_3928a532","line":10,"updated":"2017-08-10 11:14:24.000000000","message":"following","commit_id":"426bc5ddfc1daebc80e7c498dd91960bea6d0cca"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"498f4d743372f53c95c5b8defb175b9099ee472d","unresolved":false,"context_lines":[{"line_number":15,"context_line":"* The Root ResourceProvider may share multiple resources from multiple"},{"line_number":16,"context_line":"sharing resource providers. The combination should be multiple."},{"line_number":17,"context_line":"* Sharing resource providers are may just sharing to part of resource"},{"line_number":18,"context_line":"providers."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Change-Id: I7c7ffb0702cea994eef4ff8cadaadccd65b68cd0"},{"line_number":21,"context_line":"Closes-Bug: #1702420"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"9f436f4f_d91cf914","line":18,"updated":"2017-08-10 11:14:24.000000000","message":"I don\u0027t understand this sentence?","commit_id":"426bc5ddfc1daebc80e7c498dd91960bea6d0cca"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"d1ad2e1dc14b6298b1f9790a7ad3f689026f254b","unresolved":false,"context_lines":[{"line_number":15,"context_line":"* The Root ResourceProvider may share multiple resources from multiple"},{"line_number":16,"context_line":"sharing resource providers. The combination should be multiple."},{"line_number":17,"context_line":"* Sharing resource providers are may just sharing to part of resource"},{"line_number":18,"context_line":"providers."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Change-Id: I7c7ffb0702cea994eef4ff8cadaadccd65b68cd0"},{"line_number":21,"context_line":"Closes-Bug: #1702420"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"9f436f4f_1ca26f4c","line":18,"in_reply_to":"9f436f4f_d91cf914","updated":"2017-08-10 12:04:31.000000000","message":"This is for the case, cn1 and cn2 use the share resource from ss1 and ss2, but cn3 only use the share resource from ss1.","commit_id":"426bc5ddfc1daebc80e7c498dd91960bea6d0cca"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"f42dc21236ebe0d4c722a583ca4c5a238182e994","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The current implementation doesn\u0027t generate the correct combinations"},{"line_number":10,"context_line":"for the shared resource providers. The following cases are fixed in"},{"line_number":11,"context_line":"this w"},{"line_number":12,"context_line":"patch:"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"* Resource providers should only map with those sharing resource providers"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"9f436f4f_9ffd31b3","line":11,"updated":"2017-09-20 16:08:28.000000000","message":"s/w\\n//","commit_id":"05db7cb9e92a376b0d30435ee92c09d28b3dac37"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"f42dc21236ebe0d4c722a583ca4c5a238182e994","unresolved":false,"context_lines":[{"line_number":15,"context_line":"that are in the same aggregate,"},{"line_number":16,"context_line":"* The Root ResourceProvider may share multiple resources from multiple"},{"line_number":17,"context_line":"sharing resource providers. The combination should be multiple."},{"line_number":18,"context_line":"* It is not all the resource providers share resources from"},{"line_number":19,"context_line":"same set of sharing resource providers."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Change-Id: I7c7ffb0702cea994eef4ff8cadaadccd65b68cd0"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"9f436f4f_df1cd914","line":18,"updated":"2017-09-20 16:08:28.000000000","message":"s/It is/If","commit_id":"05db7cb9e92a376b0d30435ee92c09d28b3dac37"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0ea187b4bef89780d01a89aa14e019b35d3932d3","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"* Resource providers should only map with those sharing resource providers"},{"line_number":14,"context_line":"that are in the same aggregate,"},{"line_number":15,"context_line":"* The Root ResourceProvider may share multiple resources from multiple"},{"line_number":16,"context_line":"sharing resource providers. The combination should be multiple."},{"line_number":17,"context_line":"* If not all the resource providers share resources from"},{"line_number":18,"context_line":"same set of sharing resource providers."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"9f436f4f_3b570c5b","line":15,"range":{"start_line":15,"start_character":6,"end_line":15,"end_character":10},"updated":"2017-10-30 12:21:23.000000000","message":"I think cdent had mentioned that using the word \"Root\" here was confusing since you\u0027re not referring to a nested resource provider here. In fact, this and the last bullet point in the commit message are confusing me. Could you perhaps reword or elaborate on what specific scenarios you are referring to here?","commit_id":"1f918ee13dabd174ad788897f94d93ab5e493481"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"53dd8b7e97207222b8be0a3621fbd292660cfffa","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"* Resource providers should only map with those sharing resource providers"},{"line_number":14,"context_line":"that are in the same aggregate,"},{"line_number":15,"context_line":"* The Root ResourceProvider may share multiple resources from multiple"},{"line_number":16,"context_line":"sharing resource providers. The combination should be multiple."},{"line_number":17,"context_line":"* If not all the resource providers share resources from"},{"line_number":18,"context_line":"same set of sharing resource providers."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"3f4b6375_21fa60bc","line":15,"range":{"start_line":15,"start_character":6,"end_line":15,"end_character":10},"updated":"2017-10-24 19:26:39.000000000","message":"Help us come up with a better name: https://doodle.com/poll/9fkqidtfzwh7y9tr","commit_id":"27e5d0a20f11b3b8f92841ed0439dee57cf0ebf2"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0ea187b4bef89780d01a89aa14e019b35d3932d3","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"* Resource providers should only map with those sharing resource providers"},{"line_number":14,"context_line":"that are in the same aggregate,"},{"line_number":15,"context_line":"* The Root ResourceProvider may share multiple resources from multiple"},{"line_number":16,"context_line":"sharing resource providers. The combination should be multiple."},{"line_number":17,"context_line":"* If not all the resource providers share resources from"},{"line_number":18,"context_line":"same set of sharing resource providers."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"3f4b6375_2262de17","line":15,"range":{"start_line":15,"start_character":6,"end_line":15,"end_character":10},"in_reply_to":"3f4b6375_21fa60bc","updated":"2017-10-30 12:21:23.000000000","message":"Call them \"non-sharing providers\". It might be a little verbose, but it\u0027s explicit and says exactly what the things actually are. Call the variable ns_provs or something.","commit_id":"27e5d0a20f11b3b8f92841ed0439dee57cf0ebf2"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"470e712a7abd168ba8fa19f4fbe913dc04316af1","unresolved":false,"context_lines":[{"line_number":15,"context_line":"* The Root ResourceProvider may share multiple resources from multiple"},{"line_number":16,"context_line":"sharing resource providers. The combination should be multiple."},{"line_number":17,"context_line":"* If not all the resource providers share resources from"},{"line_number":18,"context_line":"same set of sharing resource providers."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Change-Id: I7c7ffb0702cea994eef4ff8cadaadccd65b68cd0"},{"line_number":21,"context_line":"Closes-Bug: #1702420"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"3f4b6375_ddcacb9f","line":18,"updated":"2017-10-30 12:36:36.000000000","message":"I\u0027d also like to clean these case descriptions up. I\u0027ll think of a way to reword this so it\u0027s more clear.","commit_id":"27e5d0a20f11b3b8f92841ed0439dee57cf0ebf2"}],"nova/objects/resource_provider.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"112d6b8b94ec171e5a50818e4309c6a5fa3ce870","unresolved":false,"context_lines":[{"line_number":2419,"context_line":"        _RP_TBL.c.id,"},{"line_number":2420,"context_line":"        _RP_AGG_TBL.c.aggregate_id]"},{"line_number":2421,"context_line":"    ).select_from(rpt_agg_join)"},{"line_number":2422,"context_line":"    return ctx.session.execute(query).fetchall()"},{"line_number":2423,"context_line":""},{"line_number":2424,"context_line":""},{"line_number":2425,"context_line":"@base.NovaObjectRegistry.register_if(False)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_6f7a6ef1","line":2422,"updated":"2017-07-05 13:23:34.000000000","message":"Given you don\u0027t filter this, that can become a very large query, right?","commit_id":"4780cd9600df473fa0a6139d152e7dc4f937f4d1"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"6f2a4bd6e9791aecc298b3b64246402dc77af296","unresolved":false,"context_lines":[{"line_number":2419,"context_line":"        _RP_TBL.c.id,"},{"line_number":2420,"context_line":"        _RP_AGG_TBL.c.aggregate_id]"},{"line_number":2421,"context_line":"    ).select_from(rpt_agg_join)"},{"line_number":2422,"context_line":"    return ctx.session.execute(query).fetchall()"},{"line_number":2423,"context_line":""},{"line_number":2424,"context_line":""},{"line_number":2425,"context_line":"@base.NovaObjectRegistry.register_if(False)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_8c013f3b","line":2422,"in_reply_to":"3f1d235d_6f7a6ef1","updated":"2017-07-06 02:56:37.000000000","message":"there is filter at line 2417","commit_id":"4780cd9600df473fa0a6139d152e7dc4f937f4d1"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"391b0843f95ff9d594d349a6de3430e94b38d113","unresolved":false,"context_lines":[{"line_number":2419,"context_line":"        _RP_TBL.c.id,"},{"line_number":2420,"context_line":"        _RP_AGG_TBL.c.aggregate_id]"},{"line_number":2421,"context_line":"    ).select_from(rpt_agg_join)"},{"line_number":2422,"context_line":"    return ctx.session.execute(query).fetchall()"},{"line_number":2423,"context_line":""},{"line_number":2424,"context_line":""},{"line_number":2425,"context_line":"@base.NovaObjectRegistry.register_if(False)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_211fa508","line":2422,"in_reply_to":"3f1d235d_8c013f3b","updated":"2017-07-07 00:59:39.000000000","message":"Actually, there\u0027s no reason to join any tables here :) Just do a:\n\n SELECT resource_provider_id, aggregate_id\n FROM resource_provider_aggregates\n WHERE resource_provider_id IN ($rp_ids)","commit_id":"4780cd9600df473fa0a6139d152e7dc4f937f4d1"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"112d6b8b94ec171e5a50818e4309c6a5fa3ce870","unresolved":false,"context_lines":[{"line_number":2520,"context_line":"        rp_aggregates_mapping \u003d collections.defaultdict(set)"},{"line_number":2521,"context_line":"        for r in _get_resource_provider_aggregates_mapping(context,"},{"line_number":2522,"context_line":"                                                           all_rp_ids):"},{"line_number":2523,"context_line":"            rp_aggregates_mapping[r[0]].add(r[1])"},{"line_number":2524,"context_line":""},{"line_number":2525,"context_line":"        # Build up a dict, keyed by internal resource provider ID, of usage"},{"line_number":2526,"context_line":"        # information from which we will then build both allocation request and"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_cf25020b","line":2523,"updated":"2017-07-05 13:23:34.000000000","message":"Sure, so you\u0027re caching the mapping table fully in memory.","commit_id":"4780cd9600df473fa0a6139d152e7dc4f937f4d1"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"6f2a4bd6e9791aecc298b3b64246402dc77af296","unresolved":false,"context_lines":[{"line_number":2520,"context_line":"        rp_aggregates_mapping \u003d collections.defaultdict(set)"},{"line_number":2521,"context_line":"        for r in _get_resource_provider_aggregates_mapping(context,"},{"line_number":2522,"context_line":"                                                           all_rp_ids):"},{"line_number":2523,"context_line":"            rp_aggregates_mapping[r[0]].add(r[1])"},{"line_number":2524,"context_line":""},{"line_number":2525,"context_line":"        # Build up a dict, keyed by internal resource provider ID, of usage"},{"line_number":2526,"context_line":"        # information from which we will then build both allocation request and"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_2c98eb19","line":2523,"in_reply_to":"3f1d235d_cf25020b","updated":"2017-07-06 02:56:37.000000000","message":"there is filter based on the \u0027all_rp_ids\u0027","commit_id":"4780cd9600df473fa0a6139d152e7dc4f937f4d1"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"391b0843f95ff9d594d349a6de3430e94b38d113","unresolved":false,"context_lines":[{"line_number":2635,"context_line":"            ]"},{"line_number":2636,"context_line":""},{"line_number":2637,"context_line":"            # Filters out the shared resource providers which are in the same"},{"line_number":2638,"context_line":"            # aggregate with root resource provider"},{"line_number":2639,"context_line":"            sharing_request_tuples \u003d zip("},{"line_number":2640,"context_line":"                filter("},{"line_number":2641,"context_line":"                    lambda arr:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_416f412a","line":2638,"updated":"2017-07-07 00:59:39.000000000","message":"I\u0027m actually confused why you want to filter *out* the shared resource providers that are in the same aggregate with root resource provider. What is your intention here exactly?","commit_id":"4780cd9600df473fa0a6139d152e7dc4f937f4d1"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"112d6b8b94ec171e5a50818e4309c6a5fa3ce870","unresolved":false,"context_lines":[{"line_number":2642,"context_line":"                        (rp_aggregates_mapping[arr.resource_provider.id] \u0026"},{"line_number":2643,"context_line":"                            rp_aggregates_mapping[root_rp_id]),"},{"line_number":2644,"context_line":"                    sharing_resource_requests[shared_rc_id])"},{"line_number":2645,"context_line":"                for shared_rc_id in shared_resources"},{"line_number":2646,"context_line":"            )"},{"line_number":2647,"context_line":""},{"line_number":2648,"context_line":"            # sharing_request_tuples will now contain a list of tuples with the"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_8f1b8ac8","line":2645,"updated":"2017-07-05 13:23:34.000000000","message":"AFAIR, we\u0027re already joining the aggregate mapping table when getting the root providers in _get_all_with_shared() so since we group by the RP IDs and select all the fields, we should have the aggregate IDs directly in the SQLA object returned by that method.\nTBC, I\u0027d very prefer to see us using directly a SQL query for making sure that we\u0027re grouping correctly the RPs instead of providing a python method for that that would use a lot of memory if we have lots of RPs.","commit_id":"4780cd9600df473fa0a6139d152e7dc4f937f4d1"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"08b4c246079b57196cb62acde14e1eedfff3d0b5","unresolved":false,"context_lines":[{"line_number":2642,"context_line":"                        (rp_aggregates_mapping[arr.resource_provider.id] \u0026"},{"line_number":2643,"context_line":"                            rp_aggregates_mapping[root_rp_id]),"},{"line_number":2644,"context_line":"                    sharing_resource_requests[shared_rc_id])"},{"line_number":2645,"context_line":"                for shared_rc_id in shared_resources"},{"line_number":2646,"context_line":"            )"},{"line_number":2647,"context_line":""},{"line_number":2648,"context_line":"            # sharing_request_tuples will now contain a list of tuples with the"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_d2f46cf3","line":2645,"in_reply_to":"3f1d235d_4fb9d912","updated":"2017-07-06 03:31:54.000000000","message":"after more thinking, maybe we can done that, and get all the combinations of the root RP and shared RP from the \u0027_get_all_with_shared\u0027. I need to try something more","commit_id":"4780cd9600df473fa0a6139d152e7dc4f937f4d1"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"6f2a4bd6e9791aecc298b3b64246402dc77af296","unresolved":false,"context_lines":[{"line_number":2642,"context_line":"                        (rp_aggregates_mapping[arr.resource_provider.id] \u0026"},{"line_number":2643,"context_line":"                            rp_aggregates_mapping[root_rp_id]),"},{"line_number":2644,"context_line":"                    sharing_resource_requests[shared_rc_id])"},{"line_number":2645,"context_line":"                for shared_rc_id in shared_resources"},{"line_number":2646,"context_line":"            )"},{"line_number":2647,"context_line":""},{"line_number":2648,"context_line":"            # sharing_request_tuples will now contain a list of tuples with the"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_4fb9d912","line":2645,"in_reply_to":"3f1d235d_8f1b8ac8","updated":"2017-07-06 02:56:37.000000000","message":"\u0027_get_all_with_shared\u0027 method only returned root RPs, I think we need the shared RP\u0027s aggregate id also. And it is grouped by rp_id, so the method returns one entry for each RP, so it doesn\u0027t work with the case the root RP associated with multiple shared RP.","commit_id":"4780cd9600df473fa0a6139d152e7dc4f937f4d1"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"36c857e39fd799d5beb532741769abdddcd40a8d","unresolved":false,"context_lines":[{"line_number":2409,"context_line":""},{"line_number":2410,"context_line":""},{"line_number":2411,"context_line":"@db_api.api_context_manager.reader"},{"line_number":2412,"context_line":"def _get_resource_provider_aggregates_mapping(ctx, rp_ids):"},{"line_number":2413,"context_line":"    \"\"\"Returns the mappings of resource provider id and aggregate id\"\"\""},{"line_number":2414,"context_line":"    query \u003d sa.select(["},{"line_number":2415,"context_line":"        _RP_AGG_TBL.c.resource_provider_id,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f1a1f67_3df67891","line":2412,"range":{"start_line":2412,"start_character":4,"end_line":2412,"end_character":45},"updated":"2017-07-12 21:57:23.000000000","message":"How about _get_mappings_of_rp_and_aggregate() as the docstring of line 2413?\n\nI did have a question about \"mapping\" instead of \"mappings\" at the first look..","commit_id":"88f90387dd586a597475f93933fc03ea448a21df"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"9290b38afd73136f0af4c3894a05e8836eeab693","unresolved":false,"context_lines":[{"line_number":2409,"context_line":""},{"line_number":2410,"context_line":""},{"line_number":2411,"context_line":"@db_api.api_context_manager.reader"},{"line_number":2412,"context_line":"def _get_resource_provider_aggregates_mapping(ctx, rp_ids):"},{"line_number":2413,"context_line":"    \"\"\"Returns the mappings of resource provider id and aggregate id\"\"\""},{"line_number":2414,"context_line":"    query \u003d sa.select(["},{"line_number":2415,"context_line":"        _RP_AGG_TBL.c.resource_provider_id,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f1a1f67_224da2c3","line":2412,"range":{"start_line":2412,"start_character":4,"end_line":2412,"end_character":45},"in_reply_to":"1f1a1f67_2d67eabf","updated":"2017-07-18 09:07:00.000000000","message":"yea, it is definitely \u0027mappings\u0027, I will fix it.","commit_id":"88f90387dd586a597475f93933fc03ea448a21df"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b3e20484b2493d88f86d3bf0b32ba1dfe0afa8e4","unresolved":false,"context_lines":[{"line_number":2409,"context_line":""},{"line_number":2410,"context_line":""},{"line_number":2411,"context_line":"@db_api.api_context_manager.reader"},{"line_number":2412,"context_line":"def _get_resource_provider_aggregates_mapping(ctx, rp_ids):"},{"line_number":2413,"context_line":"    \"\"\"Returns the mappings of resource provider id and aggregate id\"\"\""},{"line_number":2414,"context_line":"    query \u003d sa.select(["},{"line_number":2415,"context_line":"        _RP_AGG_TBL.c.resource_provider_id,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f1a1f67_2d67eabf","line":2412,"range":{"start_line":2412,"start_character":4,"end_line":2412,"end_character":45},"in_reply_to":"1f1a1f67_3df67891","updated":"2017-07-17 17:31:09.000000000","message":"I\u0027d go with _get_resource_provider_aggregate_mappings()","commit_id":"88f90387dd586a597475f93933fc03ea448a21df"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b3e20484b2493d88f86d3bf0b32ba1dfe0afa8e4","unresolved":false,"context_lines":[{"line_number":2514,"context_line":"        # Get the mappings of resource provider id and aggregate id, and build"},{"line_number":2515,"context_line":"        # a dict which keyed by resource provider id, and valued by a set of"},{"line_number":2516,"context_line":"        # aggregate id."},{"line_number":2517,"context_line":"        rp_aggregates_mapping \u003d collections.defaultdict(set)"},{"line_number":2518,"context_line":"        for r in _get_resource_provider_aggregates_mapping(context,"},{"line_number":2519,"context_line":"                                                           all_rp_ids):"},{"line_number":2520,"context_line":"            rp_aggregates_mapping[r[0]].add(r[1])"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f1a1f67_2d0c8aeb","line":2517,"range":{"start_line":2517,"start_character":8,"end_line":2517,"end_character":29},"updated":"2017-07-17 17:31:09.000000000","message":"could go with rp_agg_mappings","commit_id":"88f90387dd586a597475f93933fc03ea448a21df"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"9290b38afd73136f0af4c3894a05e8836eeab693","unresolved":false,"context_lines":[{"line_number":2514,"context_line":"        # Get the mappings of resource provider id and aggregate id, and build"},{"line_number":2515,"context_line":"        # a dict which keyed by resource provider id, and valued by a set of"},{"line_number":2516,"context_line":"        # aggregate id."},{"line_number":2517,"context_line":"        rp_aggregates_mapping \u003d collections.defaultdict(set)"},{"line_number":2518,"context_line":"        for r in _get_resource_provider_aggregates_mapping(context,"},{"line_number":2519,"context_line":"                                                           all_rp_ids):"},{"line_number":2520,"context_line":"            rp_aggregates_mapping[r[0]].add(r[1])"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f1a1f67_c2cdce31","line":2517,"range":{"start_line":2517,"start_character":8,"end_line":2517,"end_character":29},"in_reply_to":"1f1a1f67_2d0c8aeb","updated":"2017-07-18 09:07:00.000000000","message":"Done","commit_id":"88f90387dd586a597475f93933fc03ea448a21df"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"20a2c24eaa4ca73883f54ab12c1788e1cbb467e1","unresolved":false,"context_lines":[{"line_number":2693,"context_line":"                    for key in sharing_resource_request_ids.keys()"},{"line_number":2694,"context_line":"            }"},{"line_number":2695,"context_line":""},{"line_number":2696,"context_line":"            for p in itertools.combinations(filtered_all_sharing_rp_ids,"},{"line_number":2697,"context_line":"                                            len(shared_resources)):"},{"line_number":2698,"context_line":"                # filter the combinations are for the same resource class."},{"line_number":2699,"context_line":"                wrong_combination \u003d False"}],"source_content_type":"text/x-python","patch_set":10,"id":"9f436f4f_434a7d55","line":2696,"updated":"2017-08-09 09:30:54.000000000","message":"We need complex combinations for the case of multiple sharing resource providers for multiple shared resource.\n\nI need more test on this.\n\nOne of the case is:\n\nthere are two shared resources, and each shared resources have two sharing resource providers.\n\nSo we need the combinations is:\n\nresource1provider1, resource2provider1\nresource1provider1, resource2provider2\nresource1provider2, resource2provider1\nresource1provider2, resource2provider2","commit_id":"ea595cdbcb5197c60849fd8a857bd5d7338e86b1"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"498f4d743372f53c95c5b8defb175b9099ee472d","unresolved":false,"context_lines":[{"line_number":2495,"context_line":"    def _filter_resource_providers_by_agg(root_rp_id, sharing_rp_ids_by_rc_id,"},{"line_number":2496,"context_line":"            rp_agg_mappings):"},{"line_number":2497,"context_line":"        \"\"\"Filter the resource providers which are not with root resource"},{"line_number":2498,"context_line":"        provider in same aggregate out."},{"line_number":2499,"context_line":""},{"line_number":2500,"context_line":"        :params root_rp_id: The root resource provider id"},{"line_number":2501,"context_line":"        :params sharing_rp_ids_by_rc_id: A dict of sharing resource"}],"source_content_type":"text/x-python","patch_set":15,"id":"9f436f4f_19b961e8","line":2498,"updated":"2017-08-10 11:14:24.000000000","message":"move \"out\" to after \"filter\" otherwise this is very confusing.","commit_id":"426bc5ddfc1daebc80e7c498dd91960bea6d0cca"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"498f4d743372f53c95c5b8defb175b9099ee472d","unresolved":false,"context_lines":[{"line_number":2641,"context_line":"        sharing_rp_ids_by_rc_id \u003d collections.defaultdict(list)"},{"line_number":2642,"context_line":"        # A dict, use the resource provider ID as the key, and the value is"},{"line_number":2643,"context_line":"        # resource request."},{"line_number":2644,"context_line":"        sharing_resoruce_request_by_rp_id \u003d {}"},{"line_number":2645,"context_line":""},{"line_number":2646,"context_line":"        for shared_rc_id in sharing_providers.keys():"},{"line_number":2647,"context_line":"            sharing \u003d sharing_providers[shared_rc_id]"}],"source_content_type":"text/x-python","patch_set":15,"id":"9f436f4f_d978792c","line":2644,"updated":"2017-08-10 11:14:24.000000000","message":"when changing this you introduced a typo, making for a bad name. should be \"sharing_resource_request_by_rp_id\"","commit_id":"426bc5ddfc1daebc80e7c498dd91960bea6d0cca"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"498f4d743372f53c95c5b8defb175b9099ee472d","unresolved":false,"context_lines":[{"line_number":2658,"context_line":"                    amount\u003dresources[shared_rc_id],"},{"line_number":2659,"context_line":"                )"},{"line_number":2660,"context_line":""},{"line_number":2661,"context_line":"                sharing_resoruce_request_by_rp_id["},{"line_number":2662,"context_line":"                    sharing_rp_id] \u003d sharing_res_req"},{"line_number":2663,"context_line":"                sharing_rp_ids_by_rc_id[shared_rc_id].append("},{"line_number":2664,"context_line":"                    sharing_rp_id)"}],"source_content_type":"text/x-python","patch_set":15,"id":"9f436f4f_b977f53a","line":2661,"updated":"2017-08-10 11:14:24.000000000","message":"typo","commit_id":"426bc5ddfc1daebc80e7c498dd91960bea6d0cca"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"5ba41eda8e4a8a47bcd1eb667bb9cb181cba455a","unresolved":false,"context_lines":[{"line_number":2521,"context_line":"            providers, keyed by resource class id"},{"line_number":2522,"context_line":"        :params shared_resources: The shared resources which are needed by"},{"line_number":2523,"context_line":"            the root rp. `sharing_rp_ids_by_rc_id` may includes the"},{"line_number":2524,"context_line":"            sharing rps which aren\u0027t shared by root rp."},{"line_number":2525,"context_line":"        \"\"\""},{"line_number":2526,"context_line":"        ret \u003d []"},{"line_number":2527,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"7f287b81_47d27f5e","line":2524,"updated":"2017-08-23 20:38:45.000000000","message":"It would probably help if this docstring explained the structure of the returned data","commit_id":"9961df4ab8eeae863cb56551c12f67837b0424d2"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"8d29bdc04d3bea6d18bfbf47914b5bfa42a82939","unresolved":false,"context_lines":[{"line_number":2521,"context_line":"            providers, keyed by resource class id"},{"line_number":2522,"context_line":"        :params shared_resources: The shared resources which are needed by"},{"line_number":2523,"context_line":"            the root rp. `sharing_rp_ids_by_rc_id` may includes the"},{"line_number":2524,"context_line":"            sharing rps which aren\u0027t shared by root rp."},{"line_number":2525,"context_line":"        \"\"\""},{"line_number":2526,"context_line":"        ret \u003d []"},{"line_number":2527,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"7f287b81_626617c4","line":2524,"in_reply_to":"7f287b81_47d27f5e","updated":"2017-08-29 01:14:56.000000000","message":"Done","commit_id":"9961df4ab8eeae863cb56551c12f67837b0424d2"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"1de896cfbb25f934dea8b9f1306668bb8a149499","unresolved":false,"context_lines":[{"line_number":2525,"context_line":"        \"\"\""},{"line_number":2526,"context_line":"        ret \u003d []"},{"line_number":2527,"context_line":""},{"line_number":2528,"context_line":"        # When there is only one shared resource, we just needs to fetch each"},{"line_number":2529,"context_line":"        # resource provider for this resource as a combination."},{"line_number":2530,"context_line":"        if len(shared_resources) \u003d\u003d 1:"},{"line_number":2531,"context_line":"            for p in sharing_rp_ids_by_rc_id[list(shared_resources)[0]]:"}],"source_content_type":"text/x-python","patch_set":19,"id":"7f287b81_586dd996","line":2528,"updated":"2017-08-23 09:08:59.000000000","message":"s/just needs/only need/","commit_id":"9961df4ab8eeae863cb56551c12f67837b0424d2"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"8d29bdc04d3bea6d18bfbf47914b5bfa42a82939","unresolved":false,"context_lines":[{"line_number":2525,"context_line":"        \"\"\""},{"line_number":2526,"context_line":"        ret \u003d []"},{"line_number":2527,"context_line":""},{"line_number":2528,"context_line":"        # When there is only one shared resource, we just needs to fetch each"},{"line_number":2529,"context_line":"        # resource provider for this resource as a combination."},{"line_number":2530,"context_line":"        if len(shared_resources) \u003d\u003d 1:"},{"line_number":2531,"context_line":"            for p in sharing_rp_ids_by_rc_id[list(shared_resources)[0]]:"}],"source_content_type":"text/x-python","patch_set":19,"id":"7f287b81_42579bcb","line":2528,"in_reply_to":"7f287b81_586dd996","updated":"2017-08-29 01:14:56.000000000","message":"Done","commit_id":"9961df4ab8eeae863cb56551c12f67837b0424d2"}],"nova/tests/functional/db/test_resource_provider.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b3e20484b2493d88f86d3bf0b32ba1dfe0afa8e4","unresolved":false,"context_lines":[{"line_number":2712,"context_line":"        )"},{"line_number":2713,"context_line":"        cn3.create()"},{"line_number":2714,"context_line":""},{"line_number":2715,"context_line":"        # Populate the two compute node providers with inventory, sans DISK_GB"},{"line_number":2716,"context_line":"        for cn in (cn1, cn2, cn3):"},{"line_number":2717,"context_line":"            vcpu \u003d objects.Inventory("},{"line_number":2718,"context_line":"                resource_provider\u003dcn,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f1a1f67_0d5aee81","line":2715,"range":{"start_line":2715,"start_character":23,"end_line":2715,"end_character":26},"updated":"2017-07-17 17:31:09.000000000","message":"here and above, please correct this to say \"three\", since this looks to be just a copy/paste error?","commit_id":"88f90387dd586a597475f93933fc03ea448a21df"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"9290b38afd73136f0af4c3894a05e8836eeab693","unresolved":false,"context_lines":[{"line_number":2712,"context_line":"        )"},{"line_number":2713,"context_line":"        cn3.create()"},{"line_number":2714,"context_line":""},{"line_number":2715,"context_line":"        # Populate the two compute node providers with inventory, sans DISK_GB"},{"line_number":2716,"context_line":"        for cn in (cn1, cn2, cn3):"},{"line_number":2717,"context_line":"            vcpu \u003d objects.Inventory("},{"line_number":2718,"context_line":"                resource_provider\u003dcn,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f1a1f67_c2f6ee63","line":2715,"range":{"start_line":2715,"start_character":23,"end_line":2715,"end_character":26},"in_reply_to":"1f1a1f67_0d5aee81","updated":"2017-07-18 09:07:00.000000000","message":"Done","commit_id":"88f90387dd586a597475f93933fc03ea448a21df"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b3e20484b2493d88f86d3bf0b32ba1dfe0afa8e4","unresolved":false,"context_lines":[{"line_number":2918,"context_line":""},{"line_number":2919,"context_line":"        self.assertEqual(set([cn1_uuid, cn2_uuid, cn3_uuid,"},{"line_number":2920,"context_line":"                              ss1_uuid, ss2_uuid]),"},{"line_number":2921,"context_line":"                         a_req_rps)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f1a1f67_8d903eef","line":2921,"updated":"2017-07-17 17:31:09.000000000","message":"Excellent additional test, Alex, thank you :)","commit_id":"88f90387dd586a597475f93933fc03ea448a21df"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a9a9e248bd6f9a53e69aaae42bd8645159a0d13a","unresolved":false,"context_lines":[{"line_number":2981,"context_line":"        # t \u003d objects.Trait.get_by_name("},{"line_number":2982,"context_line":"        #    self.context,"},{"line_number":2983,"context_line":"        #    \"MISC_SHARES_VIA_AGGREGATE\","},{"line_number":2984,"context_line":"        # )"},{"line_number":2985,"context_line":"        t.create()"},{"line_number":2986,"context_line":"        ss1.set_traits(objects.TraitList(objects\u003d[t]))"},{"line_number":2987,"context_line":"        ss2.set_traits(objects.TraitList(objects\u003d[t]))"}],"source_content_type":"text/x-python","patch_set":8,"id":"9f436f4f_213b1039","line":2984,"updated":"2017-08-08 13:23:03.000000000","message":"Please un-TODO the above :) The commented-out code works just fine now.","commit_id":"bbc6f7a8271c84672978427b9ade05459ddbe8a6"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a9a9e248bd6f9a53e69aaae42bd8645159a0d13a","unresolved":false,"context_lines":[{"line_number":3104,"context_line":""},{"line_number":3105,"context_line":"        self.assertEqual(set([cn1_uuid, cn2_uuid, cn3_uuid,"},{"line_number":3106,"context_line":"                              ss1_uuid, ss2_uuid]),"},{"line_number":3107,"context_line":"                         a_req_rps)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9f436f4f_e172a811","line":3107,"updated":"2017-08-08 13:23:03.000000000","message":"excellent functional test, thank you Alex.\n\nAnother twist you might consider adding would be adding \u003e1 shared provider for one or more of the compute hosts and verifying the results are still correct.","commit_id":"bbc6f7a8271c84672978427b9ade05459ddbe8a6"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"f42dc21236ebe0d4c722a583ca4c5a238182e994","unresolved":false,"context_lines":[{"line_number":3350,"context_line":"        # Expect two allocation requests, it is (cn1, ss, sm) and"},{"line_number":3351,"context_line":"        # (cn2, ss, sm)"},{"line_number":3352,"context_line":"        self.assertEqual("},{"line_number":3353,"context_line":"             sorted([set([cn1_uuid, ss_uuid, sm_uuid]),"},{"line_number":3354,"context_line":"                    set([cn2_uuid, ss_uuid, sm_uuid])]),"},{"line_number":3355,"context_line":"             sorted(ar_list))"},{"line_number":3356,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"bf57530f_955b1186","line":3353,"updated":"2017-09-20 16:08:28.000000000","message":"this indentation (and the next sorted) is a bit weird at 5 spaces","commit_id":"27e5d0a20f11b3b8f92841ed0439dee57cf0ebf2"}],"nova/tests/unit/objects/test_resource_provider.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"756615a63aeb940630e12ccd95472b87ed4d214b","unresolved":false,"context_lines":[{"line_number":632,"context_line":"            _generate_sharing_rp_combinations)"},{"line_number":633,"context_line":""},{"line_number":634,"context_line":"        # The request contains two resources"},{"line_number":635,"context_line":"        ret \u003d gen_method(sharing_rp_ids_by_rc_id, set([100, 102]))"},{"line_number":636,"context_line":"        self.assertEqual(ret, [(1, 2)])"},{"line_number":637,"context_line":""},{"line_number":638,"context_line":"        # Resource 100 is provided by RP 1 and 2"}],"source_content_type":"text/x-python","patch_set":17,"id":"9f436f4f_33d3c7d7","line":635,"updated":"2017-08-14 18:55:34.000000000","message":"Is 102 right here? If so there needs to be some key checking in the method being tested","commit_id":"1f918ee13dabd174ad788897f94d93ab5e493481"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"19949a00691246642e61f0e477ec82c5588c0400","unresolved":false,"context_lines":[{"line_number":595,"context_line":"        self.assertTrue(synced)"},{"line_number":596,"context_line":""},{"line_number":597,"context_line":""},{"line_number":598,"context_line":"class TestAllocationCandidations(test.NoDBTestCase):"},{"line_number":599,"context_line":""},{"line_number":600,"context_line":"    def test_filter_resource_providers_by_agg(self):"},{"line_number":601,"context_line":"        # Resource 100 has two resource providers: 1 and 2."}],"source_content_type":"text/x-python","patch_set":18,"id":"9f436f4f_9534f74b","line":598,"updated":"2017-08-21 12:10:49.000000000","message":"Candidates","commit_id":"8d748efb09b3746b294b9fa8981fcee7841d0826"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"19949a00691246642e61f0e477ec82c5588c0400","unresolved":false,"context_lines":[{"line_number":612,"context_line":""},{"line_number":613,"context_line":"        filtered_ret \u003d filter_method("},{"line_number":614,"context_line":"            0, sharing_rp_ids_by_rc_id, rp_agg_mappings)"},{"line_number":615,"context_line":"        self.assertEqual({100: [1], 101: [3]}, filtered_ret)"},{"line_number":616,"context_line":""},{"line_number":617,"context_line":"        # ResourceProvider 1 is in the aggregate 1 and 2 now."},{"line_number":618,"context_line":"        rp_agg_mappings \u003d {"}],"source_content_type":"text/x-python","patch_set":18,"id":"9f436f4f_d991999c","line":615,"updated":"2017-08-21 12:10:49.000000000","message":"in python3 filtered_ret includes filter objects, not a list","commit_id":"8d748efb09b3746b294b9fa8981fcee7841d0826"}]}
