)]}'
{"placement/objects/allocation_candidate.py":[{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"10e346b6f9ac69b5a30b27447f2d1167ccdfacb4","unresolved":false,"context_lines":[{"line_number":224,"context_line":"                alloc_request_objs, summary_objs)"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"        return cls._limit_results(context, alloc_request_objs, summary_objs,"},{"line_number":227,"context_line":"                                  limit)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"    @staticmethod"},{"line_number":230,"context_line":"    def _limit_results(context, alloc_request_objs, summary_objs, limit):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_4a1e33bb","line":227,"updated":"2019-05-20 07:47:01.000000000","message":"An alternative is to centralize the message around here, but since we\u0027d like to skip the message if limit is not processed, I\u0027m good with the current implementation.","commit_id":"73b29cd6e474882380b19c0fc0217cc47434de59"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"38fbbf1581ae653a4564d6adc68869420c664a52","unresolved":false,"context_lines":[{"line_number":252,"context_line":"                    continue"},{"line_number":253,"context_line":"                kept_summary_objs.append(summary)"},{"line_number":254,"context_line":"            summary_objs \u003d kept_summary_objs"},{"line_number":255,"context_line":"            LOG.debug(\u0027Limiting results yields %d allocation requests and \u0027"},{"line_number":256,"context_line":"                      \u0027%d provider summaries\u0027, len(alloc_request_objs),"},{"line_number":257,"context_line":"                      len(summary_objs))"},{"line_number":258,"context_line":"        elif context.config.placement.randomize_allocation_candidates:"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_48bdff66","line":255,"updated":"2019-05-16 18:31:49.000000000","message":"Assume len() is O(1) in python, so we\u0027re not taking a hit by precalculating these even when we\u0027re not at debug level. Else consider wrapping these in an explicit\n\n if LOG.is_debug():\n\nor however that\u0027s spelled.","commit_id":"73b29cd6e474882380b19c0fc0217cc47434de59"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"f57e1facb56776e02cb21391c770f68a4d35b69a","unresolved":false,"context_lines":[{"line_number":252,"context_line":"                    continue"},{"line_number":253,"context_line":"                kept_summary_objs.append(summary)"},{"line_number":254,"context_line":"            summary_objs \u003d kept_summary_objs"},{"line_number":255,"context_line":"            LOG.debug(\u0027Limiting results yields %d allocation requests and \u0027"},{"line_number":256,"context_line":"                      \u0027%d provider summaries\u0027, len(alloc_request_objs),"},{"line_number":257,"context_line":"                      len(summary_objs))"},{"line_number":258,"context_line":"        elif context.config.placement.randomize_allocation_candidates:"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_abfef5ab","line":255,"in_reply_to":"bfb3d3c7_48bdff66","updated":"2019-05-16 19:02:43.000000000","message":"I thought that the reason that string formatting args in LOG messages are _args_ instead of being done in a \u0027%s\u0027 % thing style is because if the level is not set, the args don\u0027t get processed. Not sure if that means we exit the call before args are processed or formatting alone is handled. I can\u0027t remember.\n\nBut it shouldn\u0027t matter. I made sure it was lists, sets and dicts being counted and they all have fast __len__.","commit_id":"73b29cd6e474882380b19c0fc0217cc47434de59"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d3d38f1257a5efd01a1bffcd2cbd87622ec4419b","unresolved":false,"context_lines":[{"line_number":252,"context_line":"                    continue"},{"line_number":253,"context_line":"                kept_summary_objs.append(summary)"},{"line_number":254,"context_line":"            summary_objs \u003d kept_summary_objs"},{"line_number":255,"context_line":"            LOG.debug(\u0027Limiting results yields %d allocation requests and \u0027"},{"line_number":256,"context_line":"                      \u0027%d provider summaries\u0027, len(alloc_request_objs),"},{"line_number":257,"context_line":"                      len(summary_objs))"},{"line_number":258,"context_line":"        elif context.config.placement.randomize_allocation_candidates:"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_ee6f1b90","line":255,"in_reply_to":"bfb3d3c7_abfef5ab","updated":"2019-05-16 19:51:32.000000000","message":"The string interpolation gets deferred, but python will still evaluate expressions to construct the parameter list.","commit_id":"73b29cd6e474882380b19c0fc0217cc47434de59"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"adbf537db2a13cfb927fd1096e6da440701fb84a","unresolved":false,"context_lines":[{"line_number":252,"context_line":"                    continue"},{"line_number":253,"context_line":"                kept_summary_objs.append(summary)"},{"line_number":254,"context_line":"            summary_objs \u003d kept_summary_objs"},{"line_number":255,"context_line":"            LOG.debug(\u0027Limiting results yields %d allocation requests and \u0027"},{"line_number":256,"context_line":"                      \u0027%d provider summaries\u0027, len(alloc_request_objs),"},{"line_number":257,"context_line":"                      len(summary_objs))"},{"line_number":258,"context_line":"        elif context.config.placement.randomize_allocation_candidates:"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_ea94c7ea","line":255,"in_reply_to":"bfb3d3c7_ee6f1b90","updated":"2019-05-20 07:43:38.000000000","message":"len() is O(1) https://wiki.python.org/moin/TimeComplexity, althrough Eric is right, the len will be executed, but it shouldn\u0027t be a matter.","commit_id":"73b29cd6e474882380b19c0fc0217cc47434de59"}]}
