)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7385,"name":"Thomas Herve","email":"therve@redhat.com","username":"therve"},"change_message_id":"9932ea006215ea69dd3f1eea370867e0a972ffa1","unresolved":false,"context_lines":[{"line_number":10,"context_line":"paginate and guarantee FIFO. The counter was kept in the queue record"},{"line_number":11,"context_line":"since it provides a centralized place for it to live in. However, since"},{"line_number":12,"context_line":"we moved the QueueController to the control plane, we can\u0027t expect the"},{"line_number":13,"context_line":"QueueController to be on the same sotrage as the MessageController."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"The patch keeps the old methods around for backwards compatibility."},{"line_number":16,"context_line":"It\u0027ll check if the QueueController has these methods and call those"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"fa1b9901_5e749034","line":13,"updated":"2015-08-20 14:23:01.000000000","message":"Typo: storage.","commit_id":"1257e94a96d077b05b8b80ceace174a22d1045fe"}],"zaqar/storage/mongodb/messages.py":[{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"1fc90aeadac18311e5f374e79a4f09c1fd495fae","unresolved":false,"context_lines":[{"line_number":421,"context_line":"        # environments doing so already, we\u0027ll keep using the counter"},{"line_number":422,"context_line":"        # in the mongodb queue_controller rather than the one in the"},{"line_number":423,"context_line":"        # message_controller. This should go away, eventually"},{"line_number":424,"context_line":"        if hasattr(self._queue_ctrl, \u0027_inc_counter\u0027):"},{"line_number":425,"context_line":"            return self._queue_ctrl._inc_counter(queue_name, project,"},{"line_number":426,"context_line":"                                                 amount, window)"},{"line_number":427,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_1eec74c6","line":424,"updated":"2015-08-17 21:05:31.000000000","message":"I love this trick.","commit_id":"1257e94a96d077b05b8b80ceace174a22d1045fe"},{"author":{"_account_id":7385,"name":"Thomas Herve","email":"therve@redhat.com","username":"therve"},"change_message_id":"9932ea006215ea69dd3f1eea370867e0a972ffa1","unresolved":false,"context_lines":[{"line_number":421,"context_line":"        # environments doing so already, we\u0027ll keep using the counter"},{"line_number":422,"context_line":"        # in the mongodb queue_controller rather than the one in the"},{"line_number":423,"context_line":"        # message_controller. This should go away, eventually"},{"line_number":424,"context_line":"        if hasattr(self._queue_ctrl, \u0027_inc_counter\u0027):"},{"line_number":425,"context_line":"            return self._queue_ctrl._inc_counter(queue_name, project,"},{"line_number":426,"context_line":"                                                 amount, window)"},{"line_number":427,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_3ee43cdf","line":424,"in_reply_to":"fa1b9901_1eec74c6","updated":"2015-08-20 14:23:01.000000000","message":"Not a super fan. I didn\u0027t really manage to understand in which case the queue controller has such a method. I guess the good side is that it\u0027s well commented :).","commit_id":"1257e94a96d077b05b8b80ceace174a22d1045fe"},{"author":{"_account_id":7385,"name":"Thomas Herve","email":"therve@redhat.com","username":"therve"},"change_message_id":"9932ea006215ea69dd3f1eea370867e0a972ffa1","unresolved":false,"context_lines":[{"line_number":504,"context_line":"            doc \u003d collection.find_one_and_update("},{"line_number":505,"context_line":"                query, update, upsert\u003dTrue,"},{"line_number":506,"context_line":"                return_document\u003dpymongo.ReturnDocument.AFTER,"},{"line_number":507,"context_line":"                projection\u003d{\u0027c.v\u0027: 1, \u0027_id\u0027: 0})"},{"line_number":508,"context_line":""},{"line_number":509,"context_line":"            return doc[\u0027c\u0027][\u0027v\u0027]"},{"line_number":510,"context_line":"        except pymongo.errors.AutoReconnect as ex:"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_fe000468","line":507,"updated":"2015-08-20 14:23:01.000000000","message":"I may miss something, but this method is called \"_get_counter\", and it seems that it actually update it? The queue controller method doesn\u0027t seem to do so.\n\nIf it\u0027s necessary, I think it\u0027d be nice to update the docstring. I wonder why you couldn\u0027t do it in _inc_counter itself, though.","commit_id":"1257e94a96d077b05b8b80ceace174a22d1045fe"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"129a8c205ca4b00adfdfa180090e45c22871f9a6","unresolved":false,"context_lines":[{"line_number":504,"context_line":"            doc \u003d collection.find_one_and_update("},{"line_number":505,"context_line":"                query, update, upsert\u003dTrue,"},{"line_number":506,"context_line":"                return_document\u003dpymongo.ReturnDocument.AFTER,"},{"line_number":507,"context_line":"                projection\u003d{\u0027c.v\u0027: 1, \u0027_id\u0027: 0})"},{"line_number":508,"context_line":""},{"line_number":509,"context_line":"            return doc[\u0027c\u0027][\u0027v\u0027]"},{"line_number":510,"context_line":"        except pymongo.errors.AutoReconnect as ex:"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_59bb7fe5","line":507,"in_reply_to":"fa1b9901_fe000468","updated":"2015-08-25 15:03:45.000000000","message":"The difference is that it sets the counter to 0 when it doesn\u0027t exist. The `_inc_counter` doesn\u0027t do any upserts. The reason why we need this is that we have to guarantee that the counter exists.\n\nPreviously, this was done directly on the queue metadata and we were able to set the counter when the queue was created. This has changed now, though, since we don\u0027t keep the queue and the messages in the same store, hence we\u0027re moving these methods to the message controller.","commit_id":"1257e94a96d077b05b8b80ceace174a22d1045fe"}]}
