)]}'
{"specs/mitaka/approved/resource-objects.rst":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"8f9d85e96130220d74a2dc163c9c57f70d32f870","unresolved":false,"context_lines":[{"line_number":263,"context_line":" class Inventory(object):"},{"line_number":264,"context_line":"    \"\"\"Describes the capacity, available and used amounts for a resource.\"\"\""},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"    def consume(self, amount):"},{"line_number":267,"context_line":"        \"\"\"Update (i.e. add) the given amount to the used amount in this"},{"line_number":268,"context_line":"        inventory. If the amount is negative, more resources will be available"},{"line_number":269,"context_line":"        afterwards than were before."}],"source_content_type":"text/x-rst","patch_set":1,"id":"ba8a016a_e15d0d16","line":266,"updated":"2015-11-23 19:22:38.000000000","message":"Is there some historical reason why \"consume\" was chosen here since in some cases it cane mean \"give back\" or \"release\".\n\nThere\u0027s an argument that could be made that an \"amount\" should be an absolute value and that its sign should be active only in the context in which it is used (whether it is being taken or given back).\n\nSo I\u0027m curious if there was some noodling around those concepts?","commit_id":"c33c2cabf57e7920395a08124c16c9b025eda020"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"db54e1d8c476b3491168790005126c9ff5661ca5","unresolved":false,"context_lines":[{"line_number":263,"context_line":" class Inventory(object):"},{"line_number":264,"context_line":"    \"\"\"Describes the capacity, available and used amounts for a resource.\"\"\""},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"    def consume(self, amount):"},{"line_number":267,"context_line":"        \"\"\"Update (i.e. add) the given amount to the used amount in this"},{"line_number":268,"context_line":"        inventory. If the amount is negative, more resources will be available"},{"line_number":269,"context_line":"        afterwards than were before."}],"source_content_type":"text/x-rst","patch_set":1,"id":"ba8a016a_64eb6b79","line":266,"in_reply_to":"ba8a016a_e15d0d16","updated":"2015-11-23 19:56:22.000000000","message":"Hi Chris :)\n\nI think I\u0027d originally had both a consume() and a release() method in my original PoC code:\n\nhttps://review.openstack.org/#/c/103598/4/nova/placement/resource_tracker.py\n\nSince release() is just consume() with a negative amount, and the Amount object always understands whether it is a negative amount, there didn\u0027t seem to be a need for two methods that would do identical things...\n\nWe could change this to update(), though, which would cover the addition and removal of resources...","commit_id":"c33c2cabf57e7920395a08124c16c9b025eda020"}]}
