)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"560a43ce3ea82a67d974804df3dbc6406ee034cd","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Chris Dent \u003ccdent@anticdent.org\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-10-22 20:11:53 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"WIP: [placement] Enable limiting GET /allocation_candidates"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This adds a limit query parameter to GET"},{"line_number":10,"context_line":"/allocation_candidates?limit\u003d5\u0026resource\u003dVCPU:1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3f4b6375_0a121bb2","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":3},"updated":"2017-10-22 20:05:43.000000000","message":"Is this still a WIP?","commit_id":"525f28df7de1c48eccc586f6a7cdbfbc0a5880d5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7418dee73dcd2a5dff351da1b91eede81603b865","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Chris Dent \u003ccdent@anticdent.org\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-10-22 20:11:53 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"WIP: [placement] Enable limiting GET /allocation_candidates"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This adds a limit query parameter to GET"},{"line_number":10,"context_line":"/allocation_candidates?limit\u003d5\u0026resource\u003dVCPU:1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3f4b6375_8a1debbe","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":3},"in_reply_to":"3f4b6375_0a121bb2","updated":"2017-10-22 20:06:34.000000000","message":"jinx","commit_id":"525f28df7de1c48eccc586f6a7cdbfbc0a5880d5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"560a43ce3ea82a67d974804df3dbc6406ee034cd","unresolved":false,"context_lines":[{"line_number":27,"context_line":"is added. When true the sampling of the result set it random, when"},{"line_number":28,"context_line":"false it is slice of the front of the results."},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"This is one as a new microversion, with updates to docs, a reno"},{"line_number":31,"context_line":"and adjustments to the api historydoc."},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"Change-Id: I5f3d4f49c34fd3cd6b9d2e12b3c3c4cdcb409bec"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3f4b6375_ea28dfe2","line":30,"range":{"start_line":30,"start_character":0,"end_line":30,"end_character":14},"updated":"2017-10-22 20:05:43.000000000","message":"eh?","commit_id":"525f28df7de1c48eccc586f6a7cdbfbc0a5880d5"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"a5b9d246925b0aff013f271a753282be249d30e5","unresolved":false,"context_lines":[{"line_number":27,"context_line":"is added. When true the sampling of the result set it random, when"},{"line_number":28,"context_line":"false it is slice of the front of the results."},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"This is one as a new microversion, with updates to docs, a reno"},{"line_number":31,"context_line":"and adjustments to the api historydoc."},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"Change-Id: I5f3d4f49c34fd3cd6b9d2e12b3c3c4cdcb409bec"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3f4b6375_81f4a987","line":30,"range":{"start_line":30,"start_character":0,"end_line":30,"end_character":14},"in_reply_to":"3f4b6375_ea28dfe2","updated":"2017-10-23 08:30:48.000000000","message":"supposed to be done, will fix","commit_id":"525f28df7de1c48eccc586f6a7cdbfbc0a5880d5"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f7eac1d9e151f8c8bcb00cb0499f3f70a1cb5946","unresolved":false,"context_lines":[{"line_number":21,"context_line":"data sent over the wire (as JSON) is shrunk. This is a trade off that"},{"line_number":22,"context_line":"was discussed in the spec and the discussion surrounding its review."},{"line_number":23,"context_line":"If it turns out that memory use server-side is an issue we can"},{"line_number":24,"context_line":"investgate changing the SQL."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"A configuration setting, [placement]/randomize_allocation_candidates,"},{"line_number":27,"context_line":"is added. When true the sampling of the result set is random, when"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"df87a7cf_057ec06a","line":24,"range":{"start_line":24,"start_character":0,"end_line":24,"end_character":10},"updated":"2017-12-04 17:46:00.000000000","message":"investigate","commit_id":"898f45df72ed08c2d7d4e1da1bc0c26329264c45"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"086ac5ac3d1f6dacdcb347d424e57f5d70948013","unresolved":false,"context_lines":[{"line_number":18,"context_line":"This method avoids needing to make changes to the generated SQL, the"},{"line_number":19,"context_line":"creation of which is fairly complex, or the database tables. The amount"},{"line_number":20,"context_line":"of data queried is still high in the extreme case, but the amount of"},{"line_number":21,"context_line":"data sent over the wire (as JSON) is shrunk. This is a trade off that"},{"line_number":22,"context_line":"was discussed in the spec and the discussion surrounding its review."},{"line_number":23,"context_line":"If it turns out that memory use server-side is an issue we can"},{"line_number":24,"context_line":"investgate changing the SQL."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"df87a7cf_609623f3","line":21,"range":{"start_line":21,"start_character":55,"end_line":21,"end_character":64},"updated":"2017-12-08 15:01:32.000000000","message":"nit: trade-off","commit_id":"84b301211a7d64bcec0ac1a588fd420ae2aca17e"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"3e0bd019141a368d156343e2faea63cda2fe5073","unresolved":false,"context_lines":[{"line_number":18,"context_line":"This method avoids needing to make changes to the generated SQL, the"},{"line_number":19,"context_line":"creation of which is fairly complex, or the database tables. The amount"},{"line_number":20,"context_line":"of data queried is still high in the extreme case, but the amount of"},{"line_number":21,"context_line":"data sent over the wire (as JSON) is shrunk. This is a trade off that"},{"line_number":22,"context_line":"was discussed in the spec and the discussion surrounding its review."},{"line_number":23,"context_line":"If it turns out that memory use server-side is an issue we can"},{"line_number":24,"context_line":"investgate changing the SQL."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"df87a7cf_e4489e5d","line":21,"range":{"start_line":21,"start_character":55,"end_line":21,"end_character":64},"in_reply_to":"df87a7cf_1b7b0a7b","updated":"2017-12-13 13:30:29.000000000","message":"Don\u0027t take my word for it: https://www.merriam-webster.com/dictionary/trade-off.","commit_id":"84b301211a7d64bcec0ac1a588fd420ae2aca17e"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"ae7f35daadf77efcf8f02313f8729697b1fc4dec","unresolved":false,"context_lines":[{"line_number":18,"context_line":"This method avoids needing to make changes to the generated SQL, the"},{"line_number":19,"context_line":"creation of which is fairly complex, or the database tables. The amount"},{"line_number":20,"context_line":"of data queried is still high in the extreme case, but the amount of"},{"line_number":21,"context_line":"data sent over the wire (as JSON) is shrunk. This is a trade off that"},{"line_number":22,"context_line":"was discussed in the spec and the discussion surrounding its review."},{"line_number":23,"context_line":"If it turns out that memory use server-side is an issue we can"},{"line_number":24,"context_line":"investgate changing the SQL."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"df87a7cf_1b7b0a7b","line":21,"range":{"start_line":21,"start_character":55,"end_line":21,"end_character":64},"in_reply_to":"df87a7cf_609623f3","updated":"2017-12-08 15:08:25.000000000","message":"hyphens are horrible","commit_id":"84b301211a7d64bcec0ac1a588fd420ae2aca17e"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4ff0b1b77c2218c52cfcc79c61ef0d0e177fb310","unresolved":false,"context_lines":[{"line_number":21,"context_line":"data sent over the wire (as JSON) is shrunk. This is a trade off that"},{"line_number":22,"context_line":"was discussed in the spec and the discussion surrounding its review."},{"line_number":23,"context_line":"If it turns out that memory use server-side is an issue we can"},{"line_number":24,"context_line":"investgate changing the SQL."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"A configuration setting, [placement]/randomize_allocation_candidates,"},{"line_number":27,"context_line":"is added. When true the sampling of the result set is random, when"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"df87a7cf_88aa846e","line":24,"range":{"start_line":24,"start_character":0,"end_line":24,"end_character":10},"updated":"2017-12-07 21:43:35.000000000","message":"investigate","commit_id":"84b301211a7d64bcec0ac1a588fd420ae2aca17e"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"086ac5ac3d1f6dacdcb347d424e57f5d70948013","unresolved":false,"context_lines":[{"line_number":23,"context_line":"If it turns out that memory use server-side is an issue we can"},{"line_number":24,"context_line":"investgate changing the SQL."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"A configuration setting, [placement]/randomize_allocation_candidates,"},{"line_number":27,"context_line":"is added. When true the sampling of the result set is random, when"},{"line_number":28,"context_line":"false it is slice of the front of the results. When a full result set"},{"line_number":29,"context_line":"is used, and the config setting is true, the entire set is shuffled."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"This is done as a new microversion, 1.15, with updates to docs, a reno"},{"line_number":32,"context_line":"and adjustments to the api history doc."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"df87a7cf_604dc398","line":29,"range":{"start_line":26,"start_character":0,"end_line":29,"end_character":68},"updated":"2017-12-08 15:01:32.000000000","message":"You could also say here that setting randomize* to True always shuffles the candidates. Then, depending on the limiting and number of results, either the whole set or the first N are returned. The particular python random module method used is not important.","commit_id":"84b301211a7d64bcec0ac1a588fd420ae2aca17e"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c8c9194a81606528531826e3de289fd09a455198","unresolved":false,"context_lines":[{"line_number":21,"context_line":"data sent over the wire (as JSON) is shrunk. This is a trade-off that"},{"line_number":22,"context_line":"was discussed in the spec and the discussion surrounding its review."},{"line_number":23,"context_line":"If it turns out that memory use server-side is an issue we can"},{"line_number":24,"context_line":"investgate changing the SQL."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"A configuration setting, [placement]/randomize_allocation_candidates,"},{"line_number":27,"context_line":"is added to allow deployers to declare whether they want the results"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":14,"id":"df87a7cf_3aef6388","line":24,"range":{"start_line":24,"start_character":0,"end_line":24,"end_character":10},"updated":"2017-12-14 13:47:07.000000000","message":"investigate","commit_id":"6727a93ef9fe1e22ab1a84840eabc98830121115"}],"nova/api/openstack/placement/handlers/allocation_candidate.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a0ede57d91595a96b2cb8022b832ff24c4a8474c","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        },"},{"line_number":40,"context_line":"        \"limit\": {"},{"line_number":41,"context_line":"            # A query parameter is always a string in webOb, but"},{"line_number":42,"context_line":"            # we\u0027ll handle integer here as well."},{"line_number":43,"context_line":"            \"type\": [\"integer\", \"string\"],"},{"line_number":44,"context_line":"            \"pattern\": \"^[1-9][0-9]*$\","},{"line_number":45,"context_line":"            \"minimum\": 1,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_8c576403","line":42,"range":{"start_line":42,"start_character":14,"end_line":42,"end_character":48},"updated":"2017-10-20 13:19:35.000000000","message":"Is there any reason to do that?","commit_id":"822d0e74343e56e0039f6722199b1f1183fdab2a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"6ea7c5a123b1ce9bd91ff5fdeafae66d1a0701b2","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        },"},{"line_number":40,"context_line":"        \"limit\": {"},{"line_number":41,"context_line":"            # A query parameter is always a string in webOb, but"},{"line_number":42,"context_line":"            # we\u0027ll handle integer here as well."},{"line_number":43,"context_line":"            \"type\": [\"integer\", \"string\"],"},{"line_number":44,"context_line":"            \"pattern\": \"^[1-9][0-9]*$\","},{"line_number":45,"context_line":"            \"minimum\": 1,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_e2fffffe","line":42,"range":{"start_line":42,"start_character":14,"end_line":42,"end_character":48},"in_reply_to":"3f4b6375_8c576403","updated":"2017-10-20 14:29:49.000000000","message":"two:\n\n* it\u0027s what\u0027s done elsewhere in nova for numeric parameter validation, so I borrowed it\n* if we change webob out from under us and things change in the query retrieval part, this part still works","commit_id":"822d0e74343e56e0039f6722199b1f1183fdab2a"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9ddabc559b9de13e11ce3c948334eee1652f7b65","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        },"},{"line_number":40,"context_line":"        \"limit\": {"},{"line_number":41,"context_line":"            # A query parameter is always a string in webOb, but"},{"line_number":42,"context_line":"            # we\u0027ll handle integer here as well."},{"line_number":43,"context_line":"            \"type\": [\"integer\", \"string\"],"},{"line_number":44,"context_line":"            \"pattern\": \"^[1-9][0-9]*$\","},{"line_number":45,"context_line":"            \"minimum\": 1,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_e28a5f19","line":42,"range":{"start_line":42,"start_character":14,"end_line":42,"end_character":48},"in_reply_to":"3f4b6375_e2fffffe","updated":"2017-10-20 14:39:35.000000000","message":"Dig","commit_id":"822d0e74343e56e0039f6722199b1f1183fdab2a"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"d4b32f6a163b3a28f8082bbc8c63f4dd550c4c17","unresolved":false,"context_lines":[{"line_number":48,"context_line":"# Add limit query parameter."},{"line_number":49,"context_line":"_GET_SCHEMA_1_14 \u003d copy.deepcopy(_GET_SCHEMA_1_10)"},{"line_number":50,"context_line":"_GET_SCHEMA_1_14[\u0027properties\u0027][\u0027limit\u0027] \u003d {"},{"line_number":51,"context_line":"    # A query parameter is always a string in webOb, but"},{"line_number":52,"context_line":"    # we\u0027ll handle integer here as well."},{"line_number":53,"context_line":"    \"type\": [\"integer\", \"string\"],"},{"line_number":54,"context_line":"    \"pattern\": \"^[1-9][0-9]*$\","},{"line_number":55,"context_line":"    \"minimum\": 1,"}],"source_content_type":"text/x-python","patch_set":11,"id":"df87a7cf_1ab7ffd7","line":52,"range":{"start_line":51,"start_character":4,"end_line":52,"end_character":40},"updated":"2017-12-04 17:35:42.000000000","message":"this is JSONschema, not Webob, obviously. We\u0027re validating that the supplied query parameter parses as an integer, not a string. So, type should be \"integer\", not \"string\".","commit_id":"898f45df72ed08c2d7d4e1da1bc0c26329264c45"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"f2ee27130a38f4bf3432819ed69962983bbfc9d4","unresolved":false,"context_lines":[{"line_number":200,"context_line":"    util.validate_query_params(req, get_schema)"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"    requests \u003d util.parse_qs_request_groups(req.GET)"},{"line_number":203,"context_line":"    limit \u003d req.GET.getall(\u0027limit\u0027)"},{"line_number":204,"context_line":"    # JSONschema has already confirmed that limit has the form"},{"line_number":205,"context_line":"    # of an integer."},{"line_number":206,"context_line":"    if limit:"},{"line_number":207,"context_line":"        limit \u003d int(limit[0])"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    try:"},{"line_number":210,"context_line":"        cands \u003d rp_obj.AllocationCandidates.get_by_requests(context, requests,"}],"source_content_type":"text/x-python","patch_set":17,"id":"9f91af0f_14cdc25c","line":207,"range":{"start_line":203,"start_character":0,"end_line":207,"end_character":29},"updated":"2017-12-28 12:29:24.000000000","message":"Do we need something like:\nhttps://github.com/openstack/nova/blob/751f5dec112898bb4903848d5efc347fe48d8750/nova/api/validation/parameter_types.py#L29-L35\n\nwe can add some constraint on the count of limit args， then all above stuff can be limited by schema.","commit_id":"4a97bbd8248d9db7936404b66c133331316ee4b5"}],"nova/api/openstack/placement/schemas/allocation_candidate.py":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"7a3a9a0e2777b6b162e2cbaf9a76faa35b58fb75","unresolved":false,"context_lines":[{"line_number":35,"context_line":"GET_SCHEMA_1_16[\u0027properties\u0027][\u0027limit\u0027] \u003d {"},{"line_number":36,"context_line":"    # A query parameter is always a string in webOb, but"},{"line_number":37,"context_line":"    # we\u0027ll handle integer here as well."},{"line_number":38,"context_line":"    \"type\": [\"integer\", \"string\"],"},{"line_number":39,"context_line":"    \"pattern\": \"^[1-9][0-9]*$\","},{"line_number":40,"context_line":"    \"minimum\": 1,"},{"line_number":41,"context_line":"    \"minLength\": 1"}],"source_content_type":"text/x-python","patch_set":17,"id":"9f91af0f_9e9e7f61","line":38,"range":{"start_line":38,"start_character":13,"end_line":38,"end_character":22},"updated":"2018-01-04 13:35:04.000000000","message":"query parameter is always string","commit_id":"4a97bbd8248d9db7936404b66c133331316ee4b5"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"7a3a9a0e2777b6b162e2cbaf9a76faa35b58fb75","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    # we\u0027ll handle integer here as well."},{"line_number":38,"context_line":"    \"type\": [\"integer\", \"string\"],"},{"line_number":39,"context_line":"    \"pattern\": \"^[1-9][0-9]*$\","},{"line_number":40,"context_line":"    \"minimum\": 1,"},{"line_number":41,"context_line":"    \"minLength\": 1"},{"line_number":42,"context_line":"}"}],"source_content_type":"text/x-python","patch_set":17,"id":"9f91af0f_be726348","line":40,"range":{"start_line":40,"start_character":4,"end_line":40,"end_character":17},"updated":"2018-01-04 13:35:04.000000000","message":"This is useless also.","commit_id":"4a97bbd8248d9db7936404b66c133331316ee4b5"}],"nova/conf/placement.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7574d4b4edce58bb9dac849ed1f7b9ab42dee0b6","unresolved":false,"context_lines":[{"line_number":37,"context_line":"                default\u003dFalse,"},{"line_number":38,"context_line":"                help\u003d\"\"\""},{"line_number":39,"context_line":"If True, when limiting allocation candidate results, the results will be"},{"line_number":40,"context_line":"a random sampling of the full result set."},{"line_number":41,"context_line":"\"\"\"),"},{"line_number":42,"context_line":"]"},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_ebd1f7ce","line":40,"updated":"2017-10-23 11:51:29.000000000","message":"Should mention what happens when it\u0027s False.\n\nI know, I know, it\u0027s not easy to describe.  And may change in the future, at which point we\u0027d have to change the description.\n\nAlso, who\u0027s the audience for this help string?  Does the setting affect the operator at all?  Because I don\u0027t think an operator is going to understand what this means.\n\nI\u0027m also thinking we should default this to True.","commit_id":"cdff7e6b6e738f8d8ea1fbaa2a802215b2a11e8a"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"827e8ee4dad89419a86a28834c686c6dad75f83e","unresolved":false,"context_lines":[{"line_number":37,"context_line":"                default\u003dFalse,"},{"line_number":38,"context_line":"                help\u003d\"\"\""},{"line_number":39,"context_line":"If True, when limiting allocation candidate results, the results will be"},{"line_number":40,"context_line":"a random sampling of the full result set."},{"line_number":41,"context_line":"\"\"\"),"},{"line_number":42,"context_line":"]"},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_362ad28f","line":40,"in_reply_to":"3f4b6375_d6ddbe42","updated":"2017-10-23 12:37:17.000000000","message":"Yeah, I had a feeling that was the case.\n\nIn relatively few words:\n\n\"If False, allocation candidates are returned in a deterministic but undefined order.  That is, all things being equal, two requests for allocation candidates will return the same results in the same order; but no guarantees are made as to how that order is determined.\"","commit_id":"cdff7e6b6e738f8d8ea1fbaa2a802215b2a11e8a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"0c3821b2fc78f3b9aa57ac839101713c4f554d5d","unresolved":false,"context_lines":[{"line_number":37,"context_line":"                default\u003dFalse,"},{"line_number":38,"context_line":"                help\u003d\"\"\""},{"line_number":39,"context_line":"If True, when limiting allocation candidate results, the results will be"},{"line_number":40,"context_line":"a random sampling of the full result set."},{"line_number":41,"context_line":"\"\"\"),"},{"line_number":42,"context_line":"]"},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_d6ddbe42","line":40,"in_reply_to":"3f4b6375_ebd1f7ce","updated":"2017-10-23 12:20:12.000000000","message":"I\u0027m being intentionally vague here because I\u0027m not sure how much of this we should reveal. It is ops who would choose to tweak this, but only if they\u0027ve read \"super secret tweaks for openstack faq\" or whatever.\n\nThat is: to make this comprehensible a lot of context is required and I\u0027m not sure there\u0027s room for it here. Very happy to accept suggestions, however.","commit_id":"cdff7e6b6e738f8d8ea1fbaa2a802215b2a11e8a"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"304d30aa60b8ab3ca2d127696cad78316420164a","unresolved":false,"context_lines":[{"line_number":51,"context_line":"service catalog."},{"line_number":52,"context_line":"\"\"\"),"},{"line_number":53,"context_line":"    cfg.BoolOpt(\u0027randomize_allocation_candidates\u0027,"},{"line_number":54,"context_line":"                default\u003dFalse,"},{"line_number":55,"context_line":"                help\u003d\"\"\""},{"line_number":56,"context_line":"If True, when limiting allocation candidate results, the results will be"},{"line_number":57,"context_line":"a random sampling of the full result set. If False, allocation candidates"},{"line_number":58,"context_line":"are returned in a deterministic but undefined order. That is, all things"}],"source_content_type":"text/x-python","patch_set":17,"id":"9f91af0f_abec6229","line":55,"range":{"start_line":54,"start_character":0,"end_line":55,"end_character":24},"updated":"2018-01-05 11:45:47.000000000","message":"nit: indentation is different","commit_id":"4a97bbd8248d9db7936404b66c133331316ee4b5"}],"nova/objects/resource_provider.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a0ede57d91595a96b2cb8022b832ff24c4a8474c","unresolved":false,"context_lines":[{"line_number":2425,"context_line":"                         that shares this resource and has capacity for the"},{"line_number":2426,"context_line":"                         requested amount."},{"line_number":2427,"context_line":"            \u0027limit\u0027: An integer, N, representing the maximum number of"},{"line_number":2428,"context_line":"                     AllocationCandidates to return. If"},{"line_number":2429,"context_line":"                     CONF.placement.randomize_allocation_candidates is True"},{"line_number":2430,"context_line":"                     this will be a random sampling of N of the available"},{"line_number":2431,"context_line":"                     results. If False then the first N results, in whatever"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_6ca8a8da","line":2428,"range":{"start_line":2428,"start_character":21,"end_line":2428,"end_character":41},"updated":"2017-10-20 13:19:35.000000000","message":"Technically AllocationRequests, nah?","commit_id":"822d0e74343e56e0039f6722199b1f1183fdab2a"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9ddabc559b9de13e11ce3c948334eee1652f7b65","unresolved":false,"context_lines":[{"line_number":2425,"context_line":"                         that shares this resource and has capacity for the"},{"line_number":2426,"context_line":"                         requested amount."},{"line_number":2427,"context_line":"            \u0027limit\u0027: An integer, N, representing the maximum number of"},{"line_number":2428,"context_line":"                     AllocationCandidates to return. If"},{"line_number":2429,"context_line":"                     CONF.placement.randomize_allocation_candidates is True"},{"line_number":2430,"context_line":"                     this will be a random sampling of N of the available"},{"line_number":2431,"context_line":"                     results. If False then the first N results, in whatever"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_627e6f1a","line":2428,"range":{"start_line":2428,"start_character":21,"end_line":2428,"end_character":41},"in_reply_to":"3f4b6375_223637e8","updated":"2017-10-20 14:39:35.000000000","message":"Perhaps just spell it \"allocation candidates\" instead.","commit_id":"822d0e74343e56e0039f6722199b1f1183fdab2a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"6ea7c5a123b1ce9bd91ff5fdeafae66d1a0701b2","unresolved":false,"context_lines":[{"line_number":2425,"context_line":"                         that shares this resource and has capacity for the"},{"line_number":2426,"context_line":"                         requested amount."},{"line_number":2427,"context_line":"            \u0027limit\u0027: An integer, N, representing the maximum number of"},{"line_number":2428,"context_line":"                     AllocationCandidates to return. If"},{"line_number":2429,"context_line":"                     CONF.placement.randomize_allocation_candidates is True"},{"line_number":2430,"context_line":"                     this will be a random sampling of N of the available"},{"line_number":2431,"context_line":"                     results. If False then the first N results, in whatever"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_223637e8","line":2428,"range":{"start_line":2428,"start_character":21,"end_line":2428,"end_character":41},"in_reply_to":"3f4b6375_6ca8a8da","updated":"2017-10-20 14:29:49.000000000","message":"Hmm, yeah, except that this method is get_by_filters on AllocationCandidates object called by a URL which is GET /allocation_candidates, so...\n\nYeah, not sure what\u0027s right.","commit_id":"822d0e74343e56e0039f6722199b1f1183fdab2a"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a0ede57d91595a96b2cb8022b832ff24c4a8474c","unresolved":false,"context_lines":[{"line_number":2430,"context_line":"                     this will be a random sampling of N of the available"},{"line_number":2431,"context_line":"                     results. If False then the first N results, in whatever"},{"line_number":2432,"context_line":"                     order the database picked them, will be returned. In"},{"line_number":2433,"context_line":"                     either case if there are less than N total results,"},{"line_number":2434,"context_line":"                     all the results will be returned."},{"line_number":2435,"context_line":"        \"\"\""},{"line_number":2436,"context_line":"        _ensure_rc_cache(context)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_2caab0d1","line":2433,"range":{"start_line":2433,"start_character":46,"end_line":2433,"end_character":50},"updated":"2017-10-20 13:19:35.000000000","message":"fewer","commit_id":"822d0e74343e56e0039f6722199b1f1183fdab2a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"6ea7c5a123b1ce9bd91ff5fdeafae66d1a0701b2","unresolved":false,"context_lines":[{"line_number":2430,"context_line":"                     this will be a random sampling of N of the available"},{"line_number":2431,"context_line":"                     results. If False then the first N results, in whatever"},{"line_number":2432,"context_line":"                     order the database picked them, will be returned. In"},{"line_number":2433,"context_line":"                     either case if there are less than N total results,"},{"line_number":2434,"context_line":"                     all the results will be returned."},{"line_number":2435,"context_line":"        \"\"\""},{"line_number":2436,"context_line":"        _ensure_rc_cache(context)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_c250830d","line":2433,"range":{"start_line":2433,"start_character":46,"end_line":2433,"end_character":50},"in_reply_to":"3f4b6375_2caab0d1","updated":"2017-10-20 14:29:49.000000000","message":"thanks for that, it gave me a smile","commit_id":"822d0e74343e56e0039f6722199b1f1183fdab2a"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a0ede57d91595a96b2cb8022b832ff24c4a8474c","unresolved":false,"context_lines":[{"line_number":2637,"context_line":"        alloc_req_rp_uuids \u003d set()"},{"line_number":2638,"context_line":"        # TODO(cdent): Actually do the CONF stuff."},{"line_number":2639,"context_line":"        randomize_allocation_candidates \u003d False"},{"line_number":2640,"context_line":"        # Limit the number of allocation requuest objects. We do this after"},{"line_number":2641,"context_line":"        # creating all of them so that we can do a random slice without"},{"line_number":2642,"context_line":"        # needing to mess with the complex sql above or add additional"},{"line_number":2643,"context_line":"        # columns to the DB."}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_ecba5808","line":2640,"range":{"start_line":2640,"start_character":41,"end_line":2640,"end_character":49},"updated":"2017-10-20 13:19:35.000000000","message":"request","commit_id":"822d0e74343e56e0039f6722199b1f1183fdab2a"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a0ede57d91595a96b2cb8022b832ff24c4a8474c","unresolved":false,"context_lines":[{"line_number":2641,"context_line":"        # creating all of them so that we can do a random slice without"},{"line_number":2642,"context_line":"        # needing to mess with the complex sql above or add additional"},{"line_number":2643,"context_line":"        # columns to the DB."},{"line_number":2644,"context_line":"        if limit:"},{"line_number":2645,"context_line":"            if randomize_allocation_candidates:"},{"line_number":2646,"context_line":"                alloc_request_objs \u003d random.sample(alloc_request_objs, limit)"},{"line_number":2647,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_8ccc04bd","line":2644,"range":{"start_line":2644,"start_character":11,"end_line":2644,"end_character":16},"updated":"2017-10-20 13:19:35.000000000","message":"Here\u0027s a crazy idea:\n\nIs there value to allowing limit\u003d0 ?\n\nLike maybe I just want to make sure my call isn\u0027t going to error?\n\nProbably silly.","commit_id":"822d0e74343e56e0039f6722199b1f1183fdab2a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"6ea7c5a123b1ce9bd91ff5fdeafae66d1a0701b2","unresolved":false,"context_lines":[{"line_number":2641,"context_line":"        # creating all of them so that we can do a random slice without"},{"line_number":2642,"context_line":"        # needing to mess with the complex sql above or add additional"},{"line_number":2643,"context_line":"        # columns to the DB."},{"line_number":2644,"context_line":"        if limit:"},{"line_number":2645,"context_line":"            if randomize_allocation_candidates:"},{"line_number":2646,"context_line":"                alloc_request_objs \u003d random.sample(alloc_request_objs, limit)"},{"line_number":2647,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_e2e93f1a","line":2644,"range":{"start_line":2644,"start_character":11,"end_line":2644,"end_character":16},"in_reply_to":"3f4b6375_8ccc04bd","updated":"2017-10-20 14:29:49.000000000","message":"Yeah, let\u0027s not, the semantics are weird anyway. How do you distinguish a request that returns no results and one that you limited to return 0 results?","commit_id":"822d0e74343e56e0039f6722199b1f1183fdab2a"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9ddabc559b9de13e11ce3c948334eee1652f7b65","unresolved":false,"context_lines":[{"line_number":2641,"context_line":"        # creating all of them so that we can do a random slice without"},{"line_number":2642,"context_line":"        # needing to mess with the complex sql above or add additional"},{"line_number":2643,"context_line":"        # columns to the DB."},{"line_number":2644,"context_line":"        if limit:"},{"line_number":2645,"context_line":"            if randomize_allocation_candidates:"},{"line_number":2646,"context_line":"                alloc_request_objs \u003d random.sample(alloc_request_objs, limit)"},{"line_number":2647,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_e2ddbf14","line":2644,"range":{"start_line":2644,"start_character":11,"end_line":2644,"end_character":16},"in_reply_to":"3f4b6375_e2e93f1a","updated":"2017-10-20 14:39:35.000000000","message":"I\u0027m just checking that I didn\u0027t do anything that would result in a 4xx.  Like, I dunno, spelled a resource class or trait wrong.  But there are other ways of doing that.  And it doesn\u0027t make any sense for programmatic consumers.  So yeah, let\u0027s not - but thanks for indulging my harebrained notion.","commit_id":"822d0e74343e56e0039f6722199b1f1183fdab2a"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7574d4b4edce58bb9dac849ed1f7b9ab42dee0b6","unresolved":false,"context_lines":[{"line_number":2642,"context_line":"        # needing to mess with the complex sql above or add additional"},{"line_number":2643,"context_line":"        # columns to the DB."},{"line_number":2644,"context_line":"        if limit:"},{"line_number":2645,"context_line":"            if CONF.placement.randomize_allocation_candidates:"},{"line_number":2646,"context_line":"                alloc_request_objs \u003d random.sample(alloc_request_objs, limit)"},{"line_number":2647,"context_line":"            else:"},{"line_number":2648,"context_line":"                alloc_request_objs \u003d alloc_request_objs[:limit]"},{"line_number":2649,"context_line":"            for aro in alloc_request_objs:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_ebea1773","line":2646,"range":{"start_line":2645,"start_character":12,"end_line":2646,"end_character":77},"updated":"2017-10-23 11:51:29.000000000","message":"Hey, so I\u0027m actually thinking we should make the random-or-not thing apply regardless of whether \u0027limit\u0027 was used, for all the same reasons.  Is the scheduler doing any randomization?","commit_id":"cdff7e6b6e738f8d8ea1fbaa2a802215b2a11e8a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"0c3821b2fc78f3b9aa57ac839101713c4f554d5d","unresolved":false,"context_lines":[{"line_number":2642,"context_line":"        # needing to mess with the complex sql above or add additional"},{"line_number":2643,"context_line":"        # columns to the DB."},{"line_number":2644,"context_line":"        if limit:"},{"line_number":2645,"context_line":"            if CONF.placement.randomize_allocation_candidates:"},{"line_number":2646,"context_line":"                alloc_request_objs \u003d random.sample(alloc_request_objs, limit)"},{"line_number":2647,"context_line":"            else:"},{"line_number":2648,"context_line":"                alloc_request_objs \u003d alloc_request_objs[:limit]"},{"line_number":2649,"context_line":"            for aro in alloc_request_objs:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_d6281e35","line":2646,"range":{"start_line":2645,"start_character":12,"end_line":2646,"end_character":77},"in_reply_to":"3f4b6375_ebea1773","updated":"2017-10-23 12:20:12.000000000","message":"Eric and I talked about this in IRC http://p.anticdent.org/n3U and pretty much decided that yeah, if the conf setting is true we should random.shuffle(alloc_request_objs)","commit_id":"cdff7e6b6e738f8d8ea1fbaa2a802215b2a11e8a"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a6765a7382d3412cafc529cbf0097615321dac49","unresolved":false,"context_lines":[{"line_number":3030,"context_line":"        # needing to mess with the complex sql above or add additional"},{"line_number":3031,"context_line":"        # columns to the DB."},{"line_number":3032,"context_line":""},{"line_number":3033,"context_line":"        # Track the resource provider uuids that we have chosen to can"},{"line_number":3034,"context_line":"        # pull out their summaries below."},{"line_number":3035,"context_line":"        alloc_req_rp_uuids \u003d set()"},{"line_number":3036,"context_line":"        if limit and limit \u003c\u003d len(alloc_request_objs):"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff82abbf_1eca051a","line":3033,"range":{"start_line":3033,"start_character":64,"end_line":3033,"end_character":70},"updated":"2017-11-28 12:47:06.000000000","message":"?","commit_id":"d31a0200c608d647aab32cd03dc300c6204d50fd"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"3124a3ae0f95a8abbb378bc0ad44f4331eae8109","unresolved":false,"context_lines":[{"line_number":3030,"context_line":"        # needing to mess with the complex sql above or add additional"},{"line_number":3031,"context_line":"        # columns to the DB."},{"line_number":3032,"context_line":""},{"line_number":3033,"context_line":"        # Track the resource provider uuids that we have chosen to can"},{"line_number":3034,"context_line":"        # pull out their summaries below."},{"line_number":3035,"context_line":"        alloc_req_rp_uuids \u003d set()"},{"line_number":3036,"context_line":"        if limit and limit \u003c\u003d len(alloc_request_objs):"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff82abbf_be7439d0","line":3033,"range":{"start_line":3033,"start_character":64,"end_line":3033,"end_character":70},"in_reply_to":"ff82abbf_1eca051a","updated":"2017-11-28 12:49:28.000000000","message":"you know, so the toucan can pull out their summaries\n\nwill fix after a few more suggestions pile up","commit_id":"d31a0200c608d647aab32cd03dc300c6204d50fd"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"246fb20348bba41c1eb350c43aab2b4ddff7f3b5","unresolved":false,"context_lines":[{"line_number":3030,"context_line":"        # needing to mess with the complex sql above or add additional"},{"line_number":3031,"context_line":"        # columns to the DB."},{"line_number":3032,"context_line":""},{"line_number":3033,"context_line":"        # Track the resource provider uuids that we have chosen to can"},{"line_number":3034,"context_line":"        # pull out their summaries below."},{"line_number":3035,"context_line":"        alloc_req_rp_uuids \u003d set()"},{"line_number":3036,"context_line":"        if limit and limit \u003c\u003d len(alloc_request_objs):"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff82abbf_19a45fb9","line":3033,"range":{"start_line":3033,"start_character":64,"end_line":3033,"end_character":70},"in_reply_to":"ff82abbf_be7439d0","updated":"2017-11-28 13:16:09.000000000","message":"I was thinking it may have had something to do with the \u0027arr\u0027 on L3043 - but then it should have been a parrot.","commit_id":"d31a0200c608d647aab32cd03dc300c6204d50fd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"d4b32f6a163b3a28f8082bbc8c63f4dd550c4c17","unresolved":false,"context_lines":[{"line_number":3047,"context_line":""},{"line_number":3048,"context_line":"        # Limit summaries to only those mentioned in the allocation requests."},{"line_number":3049,"context_line":"        if limit and limit \u003c\u003d len(alloc_request_objs):"},{"line_number":3050,"context_line":"            kept_summary_objs \u003d []"},{"line_number":3051,"context_line":"            for summary in summary_objs:"},{"line_number":3052,"context_line":"                rp_uuid \u003d summary.resource_provider.uuid"},{"line_number":3053,"context_line":"                # Skip a summary if we are limiting and haven\u0027t selected an"},{"line_number":3054,"context_line":"                # allocation request that uses the resource provider."},{"line_number":3055,"context_line":"                if rp_uuid not in alloc_req_rp_uuids:"},{"line_number":3056,"context_line":"                    continue"},{"line_number":3057,"context_line":"                kept_summary_objs.append(summary)"},{"line_number":3058,"context_line":"        else:"},{"line_number":3059,"context_line":"            kept_summary_objs \u003d summary_objs"},{"line_number":3060,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"df87a7cf_da5c374d","line":3057,"range":{"start_line":3050,"start_character":0,"end_line":3057,"end_character":49},"updated":"2017-12-04 17:35:42.000000000","message":"or just:\n\n kept_summary_objs \u003d [\n     summary for summary in summary_objects\n     if summary.resource_provider.uuid in alloc_req_rp_uuids\n ]","commit_id":"898f45df72ed08c2d7d4e1da1bc0c26329264c45"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"0b45ff68323941503548599abf064fbd7e0b91e7","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"import os_traits"},{"line_number":25,"context_line":"from oslo_concurrency import lockutils"},{"line_number":26,"context_line":"from oslo_config import cfg"},{"line_number":27,"context_line":"from oslo_db import api as oslo_db_api"},{"line_number":28,"context_line":"from oslo_db import exception as db_exc"},{"line_number":29,"context_line":"from oslo_log import log as logging"}],"source_content_type":"text/x-python","patch_set":12,"id":"df87a7cf_abddd0e0","line":26,"range":{"start_line":26,"start_character":0,"end_line":26,"end_character":27},"updated":"2017-12-11 01:12:50.000000000","message":"nit: nova.conf should be used instead of oslo_config.cfg.","commit_id":"84b301211a7d64bcec0ac1a588fd420ae2aca17e"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"2ed61516b1276a99788348d779b0ac9c8e40d0ac","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"import os_traits"},{"line_number":25,"context_line":"from oslo_concurrency import lockutils"},{"line_number":26,"context_line":"from oslo_config import cfg"},{"line_number":27,"context_line":"from oslo_db import api as oslo_db_api"},{"line_number":28,"context_line":"from oslo_db import exception as db_exc"},{"line_number":29,"context_line":"from oslo_log import log as logging"}],"source_content_type":"text/x-python","patch_set":12,"id":"df87a7cf_f4d6f4c3","line":26,"range":{"start_line":26,"start_character":0,"end_line":26,"end_character":27},"in_reply_to":"df87a7cf_12d29635","updated":"2017-12-20 20:09:30.000000000","message":"Of course, because that\u0027s where we _have_ to put conf things for now, but the idea is to minimize, as much as possible (it isn\u0027t always possible) the amount of nova imports.","commit_id":"84b301211a7d64bcec0ac1a588fd420ae2aca17e"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"78ac77dba2e5de03f9b6df5b9ad9762b2a5e7175","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"import os_traits"},{"line_number":25,"context_line":"from oslo_concurrency import lockutils"},{"line_number":26,"context_line":"from oslo_config import cfg"},{"line_number":27,"context_line":"from oslo_db import api as oslo_db_api"},{"line_number":28,"context_line":"from oslo_db import exception as db_exc"},{"line_number":29,"context_line":"from oslo_log import log as logging"}],"source_content_type":"text/x-python","patch_set":12,"id":"df87a7cf_c39d8f0a","line":26,"range":{"start_line":26,"start_character":0,"end_line":26,"end_character":27},"in_reply_to":"df87a7cf_abddd0e0","updated":"2017-12-11 15:02:37.000000000","message":"I chose olso because the intent is for this file to eventually not use anything in nova, so adding a nova import seemed like a step in the wrong direction","commit_id":"84b301211a7d64bcec0ac1a588fd420ae2aca17e"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"47000aae09b278cd81b79a9103c330ff10a6dda7","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"import os_traits"},{"line_number":25,"context_line":"from oslo_concurrency import lockutils"},{"line_number":26,"context_line":"from oslo_config import cfg"},{"line_number":27,"context_line":"from oslo_db import api as oslo_db_api"},{"line_number":28,"context_line":"from oslo_db import exception as db_exc"},{"line_number":29,"context_line":"from oslo_log import log as logging"}],"source_content_type":"text/x-python","patch_set":12,"id":"df87a7cf_12d29635","line":26,"range":{"start_line":26,"start_character":0,"end_line":26,"end_character":27},"in_reply_to":"df87a7cf_c39d8f0a","updated":"2017-12-14 00:46:43.000000000","message":"The option is added in nova/conf/placement.py.\nSo this file uses a thing in nova.","commit_id":"84b301211a7d64bcec0ac1a588fd420ae2aca17e"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"0b45ff68323941503548599abf064fbd7e0b91e7","unresolved":false,"context_lines":[{"line_number":57,"context_line":"_TRAIT_LOCK \u003d \u0027trait_sync\u0027"},{"line_number":58,"context_line":"_TRAITS_SYNCED \u003d False"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"CONF \u003d cfg.CONF"},{"line_number":61,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"df87a7cf_0becfc8c","line":60,"range":{"start_line":60,"start_character":0,"end_line":60,"end_character":15},"updated":"2017-12-11 01:12:50.000000000","message":"CONF \u003d nova.conf.CONF","commit_id":"84b301211a7d64bcec0ac1a588fd420ae2aca17e"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"086ac5ac3d1f6dacdcb347d424e57f5d70948013","unresolved":false,"context_lines":[{"line_number":3273,"context_line":"            alloc_request_objs, summary_objs \u003d _alloc_candidates_with_shared("},{"line_number":3274,"context_line":"                context, resources, rp_ids, sharing_providers)"},{"line_number":3275,"context_line":""},{"line_number":3276,"context_line":"        # Limit the number of allocation requuest objects. We do this after"},{"line_number":3277,"context_line":"        # creating all of them so that we can do a random slice without"},{"line_number":3278,"context_line":"        # needing to mess with the complex sql above or add additional"},{"line_number":3279,"context_line":"        # columns to the DB."}],"source_content_type":"text/x-python","patch_set":12,"id":"df87a7cf_c0012f08","line":3276,"range":{"start_line":3276,"start_character":44,"end_line":3276,"end_character":45},"updated":"2017-12-08 15:01:32.000000000","message":"ummm...","commit_id":"84b301211a7d64bcec0ac1a588fd420ae2aca17e"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"ae7f35daadf77efcf8f02313f8729697b1fc4dec","unresolved":false,"context_lines":[{"line_number":3273,"context_line":"            alloc_request_objs, summary_objs \u003d _alloc_candidates_with_shared("},{"line_number":3274,"context_line":"                context, resources, rp_ids, sharing_providers)"},{"line_number":3275,"context_line":""},{"line_number":3276,"context_line":"        # Limit the number of allocation requuest objects. We do this after"},{"line_number":3277,"context_line":"        # creating all of them so that we can do a random slice without"},{"line_number":3278,"context_line":"        # needing to mess with the complex sql above or add additional"},{"line_number":3279,"context_line":"        # columns to the DB."}],"source_content_type":"text/x-python","patch_set":12,"id":"df87a7cf_dbafe2e0","line":3276,"range":{"start_line":3276,"start_character":44,"end_line":3276,"end_character":45},"in_reply_to":"df87a7cf_c0012f08","updated":"2017-12-08 15:08:25.000000000","message":"oopth","commit_id":"84b301211a7d64bcec0ac1a588fd420ae2aca17e"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"47000aae09b278cd81b79a9103c330ff10a6dda7","unresolved":false,"context_lines":[{"line_number":3269,"context_line":"            alloc_request_objs, summary_objs \u003d _alloc_candidates_with_shared("},{"line_number":3270,"context_line":"                context, resources, rp_ids, sharing_providers)"},{"line_number":3271,"context_line":""},{"line_number":3272,"context_line":"        # Limit the number of allocation requuest objects. We do this after"},{"line_number":3273,"context_line":"        # creating all of them so that we can do a random slice without"},{"line_number":3274,"context_line":"        # needing to mess with the complex sql above or add additional"},{"line_number":3275,"context_line":"        # columns to the DB."}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_b2f40ad1","line":3272,"range":{"start_line":3272,"start_character":45,"end_line":3272,"end_character":46},"updated":"2017-12-14 00:46:43.000000000","message":"nit: It was not fixed.","commit_id":"76b339854f14e5184cc802427d3aa8fe4d3bd4fd"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a801e22f4332dab48e4fb54942a2d35c0bbe888e","unresolved":false,"context_lines":[{"line_number":3355,"context_line":"                                                    trait_map)"},{"line_number":3356,"context_line":"            alloc_request_objs, summary_objs \u003d _alloc_candidates_no_shared("},{"line_number":3357,"context_line":"                context, resources, rp_ids)"},{"line_number":3358,"context_line":"        else:"},{"line_number":3359,"context_line":"            if trait_map:"},{"line_number":3360,"context_line":"                trait_rps \u003d _get_provider_ids_having_any_trait(context,"},{"line_number":3361,"context_line":"                                                               trait_map)"},{"line_number":3362,"context_line":"                if not trait_rps:"},{"line_number":3363,"context_line":"                    # If there aren\u0027t any providers that have any of the"},{"line_number":3364,"context_line":"                    # required traits, just exit early..."},{"line_number":3365,"context_line":"                    return [], []"},{"line_number":3366,"context_line":""},{"line_number":3367,"context_line":"            # rp_ids contains a list of resource provider IDs that EITHER have"},{"line_number":3368,"context_line":"            # all the requested resources themselves OR have some resources"},{"line_number":3369,"context_line":"            # and are related to a provider that is sharing some resources"},{"line_number":3370,"context_line":"            # with it. In other words, this is the list of resource provider"},{"line_number":3371,"context_line":"            # IDs that are NOT sharing resources."},{"line_number":3372,"context_line":"            rps \u003d _get_all_with_shared(context, resources)"},{"line_number":3373,"context_line":"            rp_ids \u003d set([r[0] for r in rps])"},{"line_number":3374,"context_line":"            alloc_request_objs, summary_objs \u003d _alloc_candidates_with_shared("},{"line_number":3375,"context_line":"                context, resources, trait_map, rp_ids, sharing_providers)"},{"line_number":3376,"context_line":""},{"line_number":3377,"context_line":"        # Limit the number of allocation request objects. We do this after"},{"line_number":3378,"context_line":"        # creating all of them so that we can do a random slice without"}],"source_content_type":"text/x-python","patch_set":16,"id":"df87a7cf_9a4f6669","line":3375,"range":{"start_line":3358,"start_character":0,"end_line":3375,"end_character":73},"updated":"2017-12-15 20:59:54.000000000","message":"here","commit_id":"10f934a11054b0c865d3b485de0af3a4878c2e66"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"304d30aa60b8ab3ca2d127696cad78316420164a","unresolved":false,"context_lines":[{"line_number":3387,"context_line":"                alloc_request_objs \u003d random.sample(alloc_request_objs, limit)"},{"line_number":3388,"context_line":"            else:"},{"line_number":3389,"context_line":"                alloc_request_objs \u003d alloc_request_objs[:limit]"},{"line_number":3390,"context_line":"            # Extract resource provider uuids from the resource requests."},{"line_number":3391,"context_line":"            for aro in alloc_request_objs:"},{"line_number":3392,"context_line":"                for arr in aro.resource_requests:"},{"line_number":3393,"context_line":"                    alloc_req_rp_uuids.add(arr.resource_provider.uuid)"},{"line_number":3394,"context_line":"        elif CONF.placement.randomize_allocation_candidates:"},{"line_number":3395,"context_line":"            random.shuffle(alloc_request_objs)"},{"line_number":3396,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9f91af0f_818dad7c","line":3393,"range":{"start_line":3390,"start_character":0,"end_line":3393,"end_character":70},"updated":"2018-01-05 11:45:47.000000000","message":"We don\u0027t seem to be using this here. Could you move this down to the below block where we do actually use it, just to ease cognition?","commit_id":"4a97bbd8248d9db7936404b66c133331316ee4b5"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"b3bd1bb69c5907a0f3d051e430c5d5ee6c8a3a02","unresolved":false,"context_lines":[{"line_number":3387,"context_line":"                alloc_request_objs \u003d random.sample(alloc_request_objs, limit)"},{"line_number":3388,"context_line":"            else:"},{"line_number":3389,"context_line":"                alloc_request_objs \u003d alloc_request_objs[:limit]"},{"line_number":3390,"context_line":"            # Extract resource provider uuids from the resource requests."},{"line_number":3391,"context_line":"            for aro in alloc_request_objs:"},{"line_number":3392,"context_line":"                for arr in aro.resource_requests:"},{"line_number":3393,"context_line":"                    alloc_req_rp_uuids.add(arr.resource_provider.uuid)"},{"line_number":3394,"context_line":"        elif CONF.placement.randomize_allocation_candidates:"},{"line_number":3395,"context_line":"            random.shuffle(alloc_request_objs)"},{"line_number":3396,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9f91af0f_81fe0dac","line":3393,"range":{"start_line":3390,"start_character":0,"end_line":3393,"end_character":70},"in_reply_to":"9f91af0f_818dad7c","updated":"2018-01-05 11:51:19.000000000","message":"I think this block being where it is is a holdover from an earlier version where the logic was somewhat different and a rebase required shifting the logic a bit","commit_id":"4a97bbd8248d9db7936404b66c133331316ee4b5"}],"nova/tests/functional/api/openstack/placement/gabbits/allocation-candidates.yaml":[{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"512d98e0133a3f38c8323a1f397bfddb83a6b4f5","unresolved":false,"context_lines":[{"line_number":37,"context_line":"      - Invalid resource class in resources parameter"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"- name: get bad limit microversion"},{"line_number":40,"context_line":"  GET: /allocation_candidates?resources\u003dVCPU:1\u0026limit\u003dcow"},{"line_number":41,"context_line":"  request_headers:"},{"line_number":42,"context_line":"      openstack-api-version: placement 1.10"},{"line_number":43,"context_line":"  status: 400"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"3f4b6375_9093d5a3","line":40,"range":{"start_line":40,"start_character":47,"end_line":40,"end_character":56},"updated":"2017-10-23 05:44:47.000000000","message":"better to use a valid value... current also good given line 46","commit_id":"d258d450a075551d40f23c3477d62ec1747d076b"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"a5b9d246925b0aff013f271a753282be249d30e5","unresolved":false,"context_lines":[{"line_number":37,"context_line":"      - Invalid resource class in resources parameter"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"- name: get bad limit microversion"},{"line_number":40,"context_line":"  GET: /allocation_candidates?resources\u003dVCPU:1\u0026limit\u003dcow"},{"line_number":41,"context_line":"  request_headers:"},{"line_number":42,"context_line":"      openstack-api-version: placement 1.10"},{"line_number":43,"context_line":"  status: 400"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"3f4b6375_a1f56585","line":40,"range":{"start_line":40,"start_character":47,"end_line":40,"end_character":56},"in_reply_to":"3f4b6375_9093d5a3","updated":"2017-10-23 08:30:48.000000000","message":"yeah good point, is a pasto","commit_id":"d258d450a075551d40f23c3477d62ec1747d076b"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"304d30aa60b8ab3ca2d127696cad78316420164a","unresolved":false,"context_lines":[{"line_number":78,"context_line":"  response_strings:"},{"line_number":79,"context_line":"      - Invalid query string parameters"},{"line_number":80,"context_line":"      - \"Failed validating \u0027pattern\u0027\""},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"- name: get allocation candidates no allocations yet"},{"line_number":83,"context_line":"  GET: /allocation_candidates?resources\u003dVCPU:1,MEMORY_MB:1024,DISK_GB:100"},{"line_number":84,"context_line":"  status: 200"}],"source_content_type":"text/x-yaml","patch_set":17,"id":"9f91af0f_413b259b","line":81,"updated":"2018-01-05 11:45:47.000000000","message":"I was going to ask for the positive case...then I scrolled down :)","commit_id":"4a97bbd8248d9db7936404b66c133331316ee4b5"}],"nova/tests/functional/db/test_resource_provider.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"76dcddb4d6f5dfdaa837f9904f81471b774e3e39","unresolved":false,"context_lines":[{"line_number":3133,"context_line":"        self._confirm_available_providers(p_alts, length\u003d2)"},{"line_number":3134,"context_line":""},{"line_number":3135,"context_line":"        # Still randomized but without limit. We can\u0027t confirm the order"},{"line_number":3136,"context_line":"        # because it is, uh, random, but we can confirm it doesn\u0027t blow up."},{"line_number":3137,"context_line":"        p_alts \u003d rp_obj.AllocationCandidates.get_by_filters("},{"line_number":3138,"context_line":"            self.ctx,"},{"line_number":3139,"context_line":"            filters\u003d{"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f4b6375_347cc71d","line":3136,"updated":"2017-10-25 12:34:37.000000000","message":"You could mock random.shuffle and assert it\u0027s called.","commit_id":"ab08bd75df8d9127397ca1db14a6d6ca510fa23a"}],"releasenotes/notes/allocation-candidates-limit-37fe5c2ce57daf7f.yaml":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7574d4b4edce58bb9dac849ed1f7b9ab42dee0b6","unresolved":false,"context_lines":[{"line_number":5,"context_line":"    parameter when making a ``GET /allocation_candidates`` request. The"},{"line_number":6,"context_line":"    parameter accepts an integer value, `N`, which limits the number of"},{"line_number":7,"context_line":"    candidates returned. A new configuration item"},{"line_number":8,"context_line":"    ``[placement]/randomize_allocation_candidates``, defaulting to `False`"},{"line_number":9,"context_line":"    controls how the limited results are chosen. If `True`, a random sampling"},{"line_number":10,"context_line":"    of the entire result set is taken, otherwise the first N results are"},{"line_number":11,"context_line":"    returned."}],"source_content_type":"text/x-yaml","patch_set":5,"id":"3f4b6375_0b67b327","line":8,"updated":"2017-10-23 11:51:29.000000000","message":"comma","commit_id":"cdff7e6b6e738f8d8ea1fbaa2a802215b2a11e8a"}]}
