)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"c46980392b55a21716d80eed30ea8d8e80c42686","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch adds new parameter \u0027traits\u0027 to the _get_all_with_shared()"},{"line_number":10,"context_line":"function. Also filter the results by the return of"},{"line_number":11,"context_line":"\u0027_get_provider_ids_with_required_traits\u0027.y"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I089d1cec405ebe4a3735ded44706b6b3cff3463f"},{"line_number":14,"context_line":"blueprint: placement-allocation-requests"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"bf3e73b7_21140e4e","line":11,"updated":"2017-08-07 22:36:31.000000000","message":"s/\\.y$//","commit_id":"53807e272f24a15e8fe536fa96372e8989e72a56"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"408daef873fb046a1e2201f81ac84ef7fc6385c9","unresolved":false,"context_lines":[{"line_number":11,"context_line":"\u0027_get_provider_ids_with_required_traits\u0027."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I089d1cec405ebe4a3735ded44706b6b3cff3463f"},{"line_number":14,"context_line":"blueprint: placement-allocation-requests"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"7f287b81_11d97882","line":14,"range":{"start_line":14,"start_character":0,"end_line":14,"end_character":40},"updated":"2017-08-22 22:04:34.000000000","message":"This is closed for Pike. Can you propose a new spec for Queens since changing GET /allocation_candidates to filter on traits is going to be a new microversion.","commit_id":"80e7b363db899e5d4557a751492f90e49c716189"}],"nova/objects/resource_provider.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"c2852b2a43c91ea252f948fc685c7406ca34cf2e","unresolved":false,"context_lines":[{"line_number":888,"context_line":"    #"},{"line_number":889,"context_line":"    # For resource classes that DO NOT have any shared resource providers, the"},{"line_number":890,"context_line":"    # WHERE clause constructed finds resource providers that have inventory for"},{"line_number":891,"context_line":"    # \"local\" resource providers."},{"line_number":892,"context_line":"    #"},{"line_number":893,"context_line":"    # WHERE (COALESCE(usage_vcpu.used, 0) + $AMOUNT \u003c\u003d"},{"line_number":894,"context_line":"    #   (inv_{RC_NAME}.total + inv_{RC_NAME}.reserved)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f1d235d_6979c62d","line":891,"updated":"2017-07-10 11:41:04.000000000","message":"why was the : changed to . ?","commit_id":"ba902e5306eda18631448f0071080074fc2d3b54"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"82593ca6135323a14fa0358fef4b4536b8c0e74f","unresolved":false,"context_lines":[{"line_number":888,"context_line":"    #"},{"line_number":889,"context_line":"    # For resource classes that DO NOT have any shared resource providers, the"},{"line_number":890,"context_line":"    # WHERE clause constructed finds resource providers that have inventory for"},{"line_number":891,"context_line":"    # \"local\" resource providers."},{"line_number":892,"context_line":"    #"},{"line_number":893,"context_line":"    # WHERE (COALESCE(usage_vcpu.used, 0) + $AMOUNT \u003c\u003d"},{"line_number":894,"context_line":"    #   (inv_{RC_NAME}.total + inv_{RC_NAME}.reserved)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f1d235d_51f20c08","line":891,"in_reply_to":"3f1d235d_6979c62d","updated":"2017-07-11 08:55:56.000000000","message":"Done","commit_id":"ba902e5306eda18631448f0071080074fc2d3b54"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"c2852b2a43c91ea252f948fc685c7406ca34cf2e","unresolved":false,"context_lines":[{"line_number":1117,"context_line":"        sel \u003d sa.select("},{"line_number":1118,"context_line":"            [rpt.c.id,"},{"line_number":1119,"context_line":"             sa.func.count(required_traits.c.name).label("},{"line_number":1120,"context_line":"                \u0027required_traits_count\u0027)])"},{"line_number":1121,"context_line":""},{"line_number":1122,"context_line":"    for rc_id, sps in sharing_providers.items():"},{"line_number":1123,"context_line":"        it \u003d inv_tables[rc_id]"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f1d235d_09dc9216","line":1120,"updated":"2017-07-10 11:41:04.000000000","message":"This might be a bit easier to read if rather than clobbering \u0027sel\u0027 there was a colums variable which had rpt.c.id in it (assigned above) and we appended to that here.","commit_id":"ba902e5306eda18631448f0071080074fc2d3b54"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"82593ca6135323a14fa0358fef4b4536b8c0e74f","unresolved":false,"context_lines":[{"line_number":1117,"context_line":"        sel \u003d sa.select("},{"line_number":1118,"context_line":"            [rpt.c.id,"},{"line_number":1119,"context_line":"             sa.func.count(required_traits.c.name).label("},{"line_number":1120,"context_line":"                \u0027required_traits_count\u0027)])"},{"line_number":1121,"context_line":""},{"line_number":1122,"context_line":"    for rc_id, sps in sharing_providers.items():"},{"line_number":1123,"context_line":"        it \u003d inv_tables[rc_id]"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f1d235d_51cb2ca4","line":1120,"in_reply_to":"3f1d235d_09dc9216","updated":"2017-07-11 08:55:56.000000000","message":"Done","commit_id":"ba902e5306eda18631448f0071080074fc2d3b54"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"c2852b2a43c91ea252f948fc685c7406ca34cf2e","unresolved":false,"context_lines":[{"line_number":1214,"context_line":"    sel \u003d sel.group_by(rpt.c.id)"},{"line_number":1215,"context_line":""},{"line_number":1216,"context_line":"    if traits:"},{"line_number":1217,"context_line":"        # We need the resource provider which has enough traits."},{"line_number":1218,"context_line":"        sel \u003d sel.having("},{"line_number":1219,"context_line":"            sel.c.required_traits_count \u003d\u003d len(set(traits)))"},{"line_number":1220,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3f1d235d_49f28a9c","line":1217,"updated":"2017-07-10 11:41:04.000000000","message":"I think the explanation for why it is \"safe\" for count of traits to be an indicator of the provided traits being the right traits could be more clear.","commit_id":"ba902e5306eda18631448f0071080074fc2d3b54"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"82593ca6135323a14fa0358fef4b4536b8c0e74f","unresolved":false,"context_lines":[{"line_number":1214,"context_line":"    sel \u003d sel.group_by(rpt.c.id)"},{"line_number":1215,"context_line":""},{"line_number":1216,"context_line":"    if traits:"},{"line_number":1217,"context_line":"        # We need the resource provider which has enough traits."},{"line_number":1218,"context_line":"        sel \u003d sel.having("},{"line_number":1219,"context_line":"            sel.c.required_traits_count \u003d\u003d len(set(traits)))"},{"line_number":1220,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3f1d235d_913664b4","line":1217,"in_reply_to":"3f1d235d_49f28a9c","updated":"2017-07-11 08:55:56.000000000","message":"yes, I will try to explain more","commit_id":"ba902e5306eda18631448f0071080074fc2d3b54"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"134289e96b3430ad05a3eb790c7257c9440498b1","unresolved":false,"context_lines":[{"line_number":1302,"context_line":""},{"line_number":1303,"context_line":"    if traits:"},{"line_number":1304,"context_line":"        rps_with_required_traits \u003d _get_provider_ids_with_required_traits("},{"line_number":1305,"context_line":"            ctx, traits, sharing_providers\u003dsharing_providers)"},{"line_number":1306,"context_line":"        where_conds.append(rpt.c.id.in_(rps_with_required_traits))"},{"line_number":1307,"context_line":""},{"line_number":1308,"context_line":"    sel \u003d sel.select_from(join_chain)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f287b81_499c740e","line":1305,"updated":"2017-08-28 13:13:24.000000000","message":"Just out of curiosity, could this have been accomplished with a join instead?","commit_id":"a0e40197ff17325ddeec3444fb7c51aa90e3341c"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"b8d2a5ece427856157b3263004ac5fd543139eb3","unresolved":false,"context_lines":[{"line_number":1302,"context_line":""},{"line_number":1303,"context_line":"    if traits:"},{"line_number":1304,"context_line":"        rps_with_required_traits \u003d _get_provider_ids_with_required_traits("},{"line_number":1305,"context_line":"            ctx, traits, sharing_providers\u003dsharing_providers)"},{"line_number":1306,"context_line":"        where_conds.append(rpt.c.id.in_(rps_with_required_traits))"},{"line_number":1307,"context_line":""},{"line_number":1308,"context_line":"    sel \u003d sel.select_from(join_chain)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f287b81_8238e39f","line":1305,"in_reply_to":"7f287b81_499c740e","updated":"2017-08-29 01:13:53.000000000","message":"I guess you mean the common method just return a join, and merge the join into the main sql.\n\nI\u0027m not very sure. It isn\u0027t only a join, it also need to count the number of traits like this \u0027https://review.openstack.org/#/c/478464/1/nova/objects/resource_provider.py@1078\u0027\n\nFor \u0027generate a join\u0027, it will get better performance, but a huge sql, not very testable\nFor \u0027return a result\u0027, it is will more testable, bad performance than the `generate a join`","commit_id":"a0e40197ff17325ddeec3444fb7c51aa90e3341c"}]}
