)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"ac177c5115c8648c9c4f3b955687a36c3a4ae6c1","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2016-04-23 15:21:09 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add redis HA implement"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: I3711b2a18d3c384a392a26b509e2db3e7df1f356"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"1a122d0e_0456a9d1","line":8,"updated":"2016-04-25 19:37:10.000000000","message":"Any blueprint or spec associated to your implementation?\n\nI suggest you add an explanation about how you achieve it.","commit_id":"343d869a39902402470a9e0ae5112ea8e2aa6bbd"},{"author":{"_account_id":20188,"name":"zhuweiqiong","email":"zhuweiqiong@huawei.com","username":"zhuweiqiong"},"change_message_id":"16a38abe883151585ccb42da34925e05c72008cd","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2016-04-23 15:21:09 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add redis HA implement"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: I3711b2a18d3c384a392a26b509e2db3e7df1f356"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"1a122d0e_0cefeb1e","line":8,"in_reply_to":"1a122d0e_0456a9d1","updated":"2016-04-26 03:36:34.000000000","message":"Yes, here is my spec https://review.openstack.org/#/c/298701/","commit_id":"343d869a39902402470a9e0ae5112ea8e2aa6bbd"}],"dragonflow/db/api_nb.py":[{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"e78f70042549efdd8a3e37a82fcc5fad73c54f7d","unresolved":false,"context_lines":[{"line_number":206,"context_line":"            self.db_recover_callback()"},{"line_number":207,"context_line":"            return"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        self.controller.vswitch_api.sync()"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"        if \u0027secgroup\u0027 \u003d\u003d table:"},{"line_number":212,"context_line":"            if action \u003d\u003d \u0027set\u0027 or action \u003d\u003d \u0027create\u0027:"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_8e6d1c9c","line":209,"updated":"2016-05-02 11:03:39.000000000","message":"I think vswitch_api is an instance of OvsdbSwitchApi, which doesn\u0027t have a sync method. Additionally, this will be called for every event that isn\u0027t sync or dbrestart.","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"},{"author":{"_account_id":20188,"name":"zhuweiqiong","email":"zhuweiqiong@huawei.com","username":"zhuweiqiong"},"change_message_id":"64aa297bdec5195f0657199a5bee96111f4d433d","unresolved":false,"context_lines":[{"line_number":206,"context_line":"            self.db_recover_callback()"},{"line_number":207,"context_line":"            return"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        self.controller.vswitch_api.sync()"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"        if \u0027secgroup\u0027 \u003d\u003d table:"},{"line_number":212,"context_line":"            if action \u003d\u003d \u0027set\u0027 or action \u003d\u003d \u0027create\u0027:"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_0afba248","line":209,"in_reply_to":"1a122d0e_8e6d1c9c","updated":"2016-05-03 03:21:34.000000000","message":"That\u0027s right, this is not my code, there maybe something wrong when i did rebase or other operations.","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"4a73fb4eeaacd0bfe46bfdc1d05ca5458e0a4974","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                # Start a thread to detect DB failover in Plugin"},{"line_number":66,"context_line":"                self.publisher.set_publisher_for_failover(self.publisher,"},{"line_number":67,"context_line":"                                                          self."},{"line_number":68,"context_line":"                                                          db_recover_callback)"},{"line_number":69,"context_line":"                self.publisher.start_detect_for_failover()"},{"line_number":70,"context_line":"            else:"},{"line_number":71,"context_line":"                # NOTE(gampel) we want to start queuing event as soon"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a122d0e_cba4d409","line":68,"range":{"start_line":68,"start_character":58,"end_line":68,"end_character":77},"updated":"2016-05-04 13:20:56.000000000","message":"self.publisher.set_publisher_for_failover(\n                                  self.publisher,\n                                  self.db_recover_callback)\nmay be better","commit_id":"0d8369f508a9087d06f3c8c361f57a450c33446c"},{"author":{"_account_id":20188,"name":"zhuweiqiong","email":"zhuweiqiong@huawei.com","username":"zhuweiqiong"},"change_message_id":"317d14bd74bf0b440bab9f06c44015dc7b42e274","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                # Start a thread to detect DB failover in Plugin"},{"line_number":66,"context_line":"                self.publisher.set_publisher_for_failover(self.publisher,"},{"line_number":67,"context_line":"                                                          self."},{"line_number":68,"context_line":"                                                          db_recover_callback)"},{"line_number":69,"context_line":"                self.publisher.start_detect_for_failover()"},{"line_number":70,"context_line":"            else:"},{"line_number":71,"context_line":"                # NOTE(gampel) we want to start queuing event as soon"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a122d0e_c06f6f90","line":68,"range":{"start_line":68,"start_character":58,"end_line":68,"end_character":77},"in_reply_to":"1a122d0e_cba4d409","updated":"2016-05-05 01:31:23.000000000","message":"Done","commit_id":"0d8369f508a9087d06f3c8c361f57a450c33446c"}],"dragonflow/db/drivers/redis_db_driver.py":[{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"e78f70042549efdd8a3e37a82fcc5fad73c54f7d","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def _update_server_list(self):"},{"line_number":38,"context_line":"        if self.redis_mgt is not None:"},{"line_number":39,"context_line":"            self.remote_server_lists \u003d self.redis_mgt.get_master_list()"},{"line_number":40,"context_line":"            self.clients \u003d {}"},{"line_number":41,"context_line":"            for remote in self.remote_server_lists:"},{"line_number":42,"context_line":"                remote_ip_port \u003d remote[\u0027ip_port\u0027]"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_4eeae4ad","line":39,"updated":"2016-05-02 11:03:39.000000000","message":"Where do you re-read the cluster members list?","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"},{"author":{"_account_id":20188,"name":"zhuweiqiong","email":"zhuweiqiong@huawei.com","username":"zhuweiqiong"},"change_message_id":"64aa297bdec5195f0657199a5bee96111f4d433d","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def _update_server_list(self):"},{"line_number":38,"context_line":"        if self.redis_mgt is not None:"},{"line_number":39,"context_line":"            self.remote_server_lists \u003d self.redis_mgt.get_master_list()"},{"line_number":40,"context_line":"            self.clients \u003d {}"},{"line_number":41,"context_line":"            for remote in self.remote_server_lists:"},{"line_number":42,"context_line":"                remote_ip_port \u003d remote[\u0027ip_port\u0027]"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_2502110a","line":39,"in_reply_to":"1a122d0e_4eeae4ad","updated":"2016-05-03 03:21:34.000000000","message":"In df controller nodes, only receive the cluster infomation from Plugin detection task.","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"e78f70042549efdd8a3e37a82fcc5fad73c54f7d","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        if topic is None:"},{"line_number":53,"context_line":"            local_key \u003d self.uuid_to_key(table, key, \u0027*\u0027)"},{"line_number":54,"context_line":"            try:"},{"line_number":55,"context_line":"                for host, client in self.clients.items():"},{"line_number":56,"context_line":"                    ip_port \u003d host"},{"line_number":57,"context_line":"                    local_keys \u003d client.keys(local_key)"},{"line_number":58,"context_line":"                    if len(local_keys) \u003d\u003d 1:"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_ae1e180b","line":55,"updated":"2016-05-02 11:03:39.000000000","message":"Using iteritems in this context is better, since it returns an iterator, and doesn\u0027t construct a list.\n\nConsider using six.iteritems, to support both python 2 and python 3.\n\n(This repeats in other places.)","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"},{"author":{"_account_id":20188,"name":"zhuweiqiong","email":"zhuweiqiong@huawei.com","username":"zhuweiqiong"},"change_message_id":"3ef98fb98665e5965f5f4ac20f980c0f25146c73","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        if topic is None:"},{"line_number":53,"context_line":"            local_key \u003d self.uuid_to_key(table, key, \u0027*\u0027)"},{"line_number":54,"context_line":"            try:"},{"line_number":55,"context_line":"                for host, client in self.clients.items():"},{"line_number":56,"context_line":"                    ip_port \u003d host"},{"line_number":57,"context_line":"                    local_keys \u003d client.keys(local_key)"},{"line_number":58,"context_line":"                    if len(local_keys) \u003d\u003d 1:"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_12c0f47b","line":55,"in_reply_to":"1a122d0e_ae1e180b","updated":"2016-05-03 07:43:11.000000000","message":"Done","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"e78f70042549efdd8a3e37a82fcc5fad73c54f7d","unresolved":false,"context_lines":[{"line_number":62,"context_line":"                self._update_server_list()"},{"line_number":63,"context_line":"                LOG.exception(_LE(\"exception %(key)s: %(e)s\")"},{"line_number":64,"context_line":"                              % {\u0027key\u0027: local_key, \u0027e\u0027: e})"},{"line_number":65,"context_line":"                # raise df_exceptions.DBKeyNotFound(key\u003dlocal_key)"},{"line_number":66,"context_line":"        else:"},{"line_number":67,"context_line":"            local_key \u003d self.uuid_to_key(table, key, topic)"},{"line_number":68,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_2eb848e8","line":65,"updated":"2016-05-02 11:03:39.000000000","message":"In case of exception, get_key will return None. Why not raise DBKeyNotFound exception? (This repeats in other places)","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"},{"author":{"_account_id":20188,"name":"zhuweiqiong","email":"zhuweiqiong@huawei.com","username":"zhuweiqiong"},"change_message_id":"64aa297bdec5195f0657199a5bee96111f4d433d","unresolved":false,"context_lines":[{"line_number":62,"context_line":"                self._update_server_list()"},{"line_number":63,"context_line":"                LOG.exception(_LE(\"exception %(key)s: %(e)s\")"},{"line_number":64,"context_line":"                              % {\u0027key\u0027: local_key, \u0027e\u0027: e})"},{"line_number":65,"context_line":"                # raise df_exceptions.DBKeyNotFound(key\u003dlocal_key)"},{"line_number":66,"context_line":"        else:"},{"line_number":67,"context_line":"            local_key \u003d self.uuid_to_key(table, key, topic)"},{"line_number":68,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_a53c61c0","line":65,"in_reply_to":"1a122d0e_2eb848e8","updated":"2016-05-03 03:21:34.000000000","message":"If get_key return None, method will return None. In exception, this means get_key get an error, maybe a disconnection, so here i update the server list and waiting for new cluster info from Plugin. Does it need to raise exception?","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"e78f70042549efdd8a3e37a82fcc5fad73c54f7d","unresolved":false,"context_lines":[{"line_number":86,"context_line":"            ip_port \u003d self.redis_mgt.get_ip_by_key(local_key)"},{"line_number":87,"context_line":"            client \u003d self._get_client(local_key)"},{"line_number":88,"context_line":"            if client is None:"},{"line_number":89,"context_line":"                return 0"},{"line_number":90,"context_line":"            client.set(local_key, value)"},{"line_number":91,"context_line":"            # make sure the write committed to 1 slave node"},{"line_number":92,"context_line":"            res \u003d client.wait(1, 1000)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_8e9ebc52","line":89,"updated":"2016-05-02 11:03:39.000000000","message":"In this case, shouldn\u0027t the driver re-read the cluster members list? (This repeats in other places)","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"},{"author":{"_account_id":20188,"name":"zhuweiqiong","email":"zhuweiqiong@huawei.com","username":"zhuweiqiong"},"change_message_id":"64aa297bdec5195f0657199a5bee96111f4d433d","unresolved":false,"context_lines":[{"line_number":86,"context_line":"            ip_port \u003d self.redis_mgt.get_ip_by_key(local_key)"},{"line_number":87,"context_line":"            client \u003d self._get_client(local_key)"},{"line_number":88,"context_line":"            if client is None:"},{"line_number":89,"context_line":"                return 0"},{"line_number":90,"context_line":"            client.set(local_key, value)"},{"line_number":91,"context_line":"            # make sure the write committed to 1 slave node"},{"line_number":92,"context_line":"            res \u003d client.wait(1, 1000)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_6571a9a8","line":89,"in_reply_to":"1a122d0e_8e9ebc52","updated":"2016-05-03 03:21:34.000000000","message":"All the re-read operations are implemented in Plugin.","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"e78f70042549efdd8a3e37a82fcc5fad73c54f7d","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                return 0"},{"line_number":90,"context_line":"            client.set(local_key, value)"},{"line_number":91,"context_line":"            # make sure the write committed to 1 slave node"},{"line_number":92,"context_line":"            res \u003d client.wait(1, 1000)"},{"line_number":93,"context_line":"            if not res:"},{"line_number":94,"context_line":"                client.delete(local_key)"},{"line_number":95,"context_line":"            return res"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_4e85c405","line":92,"updated":"2016-05-02 11:03:39.000000000","message":"What is the performance impact of this call?","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"},{"author":{"_account_id":20188,"name":"zhuweiqiong","email":"zhuweiqiong@huawei.com","username":"zhuweiqiong"},"change_message_id":"64aa297bdec5195f0657199a5bee96111f4d433d","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                return 0"},{"line_number":90,"context_line":"            client.set(local_key, value)"},{"line_number":91,"context_line":"            # make sure the write committed to 1 slave node"},{"line_number":92,"context_line":"            res \u003d client.wait(1, 1000)"},{"line_number":93,"context_line":"            if not res:"},{"line_number":94,"context_line":"                client.delete(local_key)"},{"line_number":95,"context_line":"            return res"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_65a889dc","line":92,"in_reply_to":"1a122d0e_4e85c405","updated":"2016-05-03 03:21:34.000000000","message":"It will low the performance a little. I used to want to let Redis providing more stronger consistency by it\u0027s own. Now i am considering to remove the \"wait\", i think it\u0027s useless with a lot of circumstances.","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"e78f70042549efdd8a3e37a82fcc5fad73c54f7d","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        if topic is None:"},{"line_number":129,"context_line":"            local_key \u003d self.uuid_to_key(table, \u0027*\u0027, \u0027*\u0027)"},{"line_number":130,"context_line":"            try:"},{"line_number":131,"context_line":"                for host, client in self.clients.items():"},{"line_number":132,"context_line":"                    ip_port \u003d host"},{"line_number":133,"context_line":"                    local_keys \u003d client.keys(local_key)"},{"line_number":134,"context_line":"                    if len(local_keys) \u003e 0:"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_2eb4c8d2","line":131,"updated":"2016-05-02 11:03:39.000000000","message":"Same here re: iterator and six","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"},{"author":{"_account_id":20188,"name":"zhuweiqiong","email":"zhuweiqiong@huawei.com","username":"zhuweiqiong"},"change_message_id":"3ef98fb98665e5965f5f4ac20f980c0f25146c73","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        if topic is None:"},{"line_number":129,"context_line":"            local_key \u003d self.uuid_to_key(table, \u0027*\u0027, \u0027*\u0027)"},{"line_number":130,"context_line":"            try:"},{"line_number":131,"context_line":"                for host, client in self.clients.items():"},{"line_number":132,"context_line":"                    ip_port \u003d host"},{"line_number":133,"context_line":"                    local_keys \u003d client.keys(local_key)"},{"line_number":134,"context_line":"                    if len(local_keys) \u003e 0:"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_52ba6c0b","line":131,"in_reply_to":"1a122d0e_2eb4c8d2","updated":"2016-05-03 07:43:11.000000000","message":"Done","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"4a73fb4eeaacd0bfe46bfdc1d05ca5458e0a4974","unresolved":false,"context_lines":[{"line_number":59,"context_line":"                    if len(local_keys) \u003d\u003d 1:"},{"line_number":60,"context_line":"                        return client.get(local_keys[0])"},{"line_number":61,"context_line":"            except Exception as e:"},{"line_number":62,"context_line":"                self.redis_mgt.remove_node_from_master_list(ip_port)"},{"line_number":63,"context_line":"                self._update_server_list()"},{"line_number":64,"context_line":"                LOG.exception(_LE(\"exception %(key)s: %(e)s\")"},{"line_number":65,"context_line":"                              % {\u0027key\u0027: local_key, \u0027e\u0027: e})"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a122d0e_7e045cc5","line":62,"range":{"start_line":62,"start_character":21,"end_line":62,"end_character":30},"updated":"2016-05-04 13:20:56.000000000","message":"Can we remove the node just because one key not found?\nI think we should process according to the type of exception","commit_id":"0d8369f508a9087d06f3c8c361f57a450c33446c"},{"author":{"_account_id":20188,"name":"zhuweiqiong","email":"zhuweiqiong@huawei.com","username":"zhuweiqiong"},"change_message_id":"317d14bd74bf0b440bab9f06c44015dc7b42e274","unresolved":false,"context_lines":[{"line_number":59,"context_line":"                    if len(local_keys) \u003d\u003d 1:"},{"line_number":60,"context_line":"                        return client.get(local_keys[0])"},{"line_number":61,"context_line":"            except Exception as e:"},{"line_number":62,"context_line":"                self.redis_mgt.remove_node_from_master_list(ip_port)"},{"line_number":63,"context_line":"                self._update_server_list()"},{"line_number":64,"context_line":"                LOG.exception(_LE(\"exception %(key)s: %(e)s\")"},{"line_number":65,"context_line":"                              % {\u0027key\u0027: local_key, \u0027e\u0027: e})"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a122d0e_40319fa1","line":62,"range":{"start_line":62,"start_character":21,"end_line":62,"end_character":30},"in_reply_to":"1a122d0e_7e045cc5","updated":"2016-05-05 01:31:23.000000000","message":"The Get operation will return None when key not found, only connection error, moved error, asked error can go in here.","commit_id":"0d8369f508a9087d06f3c8c361f57a450c33446c"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"4a73fb4eeaacd0bfe46bfdc1d05ca5458e0a4974","unresolved":false,"context_lines":[{"line_number":203,"context_line":"                return None"},{"line_number":204,"context_line":"            return client.incr(local_key)"},{"line_number":205,"context_line":"        except Exception:"},{"line_number":206,"context_line":"            self.redis_mgt.remove_node_from_master_list(ip_port)"},{"line_number":207,"context_line":"            self._update_server_list()"},{"line_number":208,"context_line":"            # raise e"},{"line_number":209,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"1a122d0e_3ef2e49a","line":206,"range":{"start_line":206,"start_character":17,"end_line":206,"end_character":26},"updated":"2016-05-04 13:20:56.000000000","message":"the processing is almost the same. consider using decorator","commit_id":"0d8369f508a9087d06f3c8c361f57a450c33446c"}],"dragonflow/db/drivers/redis_mgt.py":[{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"e78f70042549efdd8a3e37a82fcc5fad73c54f7d","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        def _split(line):"},{"line_number":135,"context_line":"            k, v \u003d line.split(\u0027:\u0027)"},{"line_number":136,"context_line":"            yield k"},{"line_number":137,"context_line":"            yield v"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        return {k: v for k, v in"},{"line_number":140,"context_line":"                [_split(line) for line in raw.split(\u0027\\r\\n\u0027) if line]}"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_8e687c23","line":137,"updated":"2016-05-02 11:03:39.000000000","message":"Why use yield? Why not return a tuple?","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"},{"author":{"_account_id":20188,"name":"zhuweiqiong","email":"zhuweiqiong@huawei.com","username":"zhuweiqiong"},"change_message_id":"64aa297bdec5195f0657199a5bee96111f4d433d","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        def _split(line):"},{"line_number":135,"context_line":"            k, v \u003d line.split(\u0027:\u0027)"},{"line_number":136,"context_line":"            yield k"},{"line_number":137,"context_line":"            yield v"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        return {k: v for k, v in"},{"line_number":140,"context_line":"                [_split(line) for line in raw.split(\u0027\\r\\n\u0027) if line]}"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_e56779b5","line":137,"in_reply_to":"1a122d0e_8e687c23","updated":"2016-05-03 03:21:34.000000000","message":"Sure, both of them can do. Using yield to simplify the code.","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"4a73fb4eeaacd0bfe46bfdc1d05ca5458e0a4974","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from dragonflow.db.drivers import redis_calckey"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"import eventlet"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from oslo_log import log"},{"line_number":23,"context_line":"from oslo_serialization import jsonutils"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"import random"},{"line_number":27,"context_line":"import redis"},{"line_number":28,"context_line":"import six"},{"line_number":29,"context_line":"import string"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":32,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"1a122d0e_5e7b60f4","line":29,"range":{"start_line":20,"start_character":0,"end_line":29,"end_character":13},"updated":"2016-05-04 13:20:56.000000000","message":"import the third-party lib firstly","commit_id":"0d8369f508a9087d06f3c8c361f57a450c33446c"},{"author":{"_account_id":20188,"name":"zhuweiqiong","email":"zhuweiqiong@huawei.com","username":"zhuweiqiong"},"change_message_id":"317d14bd74bf0b440bab9f06c44015dc7b42e274","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from dragonflow.db.drivers import redis_calckey"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"import eventlet"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from oslo_log import log"},{"line_number":23,"context_line":"from oslo_serialization import jsonutils"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"import random"},{"line_number":27,"context_line":"import redis"},{"line_number":28,"context_line":"import six"},{"line_number":29,"context_line":"import string"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":32,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"1a122d0e_20c5835b","line":29,"range":{"start_line":20,"start_character":0,"end_line":29,"end_character":13},"in_reply_to":"1a122d0e_5e7b60f4","updated":"2016-05-05 01:31:23.000000000","message":"Done","commit_id":"0d8369f508a9087d06f3c8c361f57a450c33446c"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"4a73fb4eeaacd0bfe46bfdc1d05ca5458e0a4974","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                node \u003d self._init_node(ip_port[0], ip_port[1])"},{"line_number":116,"context_line":"                info \u003d self._get_cluster_info(node)"},{"line_number":117,"context_line":"                if info[\u0027cluster_state\u0027] !\u003d \u0027ok\u0027:"},{"line_number":118,"context_line":"                    LOG.warning(_LW(\"redis cluster state failed\"))"},{"line_number":119,"context_line":"                else:"},{"line_number":120,"context_line":"                    new_nodes \u003d self._get_cluster_nodes(node)"},{"line_number":121,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"1a122d0e_7e945ce7","line":118,"range":{"start_line":118,"start_character":57,"end_line":118,"end_character":63},"updated":"2016-05-04 13:20:56.000000000","message":"please print the cluster state to make debug easier","commit_id":"0d8369f508a9087d06f3c8c361f57a450c33446c"},{"author":{"_account_id":20188,"name":"zhuweiqiong","email":"zhuweiqiong@huawei.com","username":"zhuweiqiong"},"change_message_id":"317d14bd74bf0b440bab9f06c44015dc7b42e274","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                node \u003d self._init_node(ip_port[0], ip_port[1])"},{"line_number":116,"context_line":"                info \u003d self._get_cluster_info(node)"},{"line_number":117,"context_line":"                if info[\u0027cluster_state\u0027] !\u003d \u0027ok\u0027:"},{"line_number":118,"context_line":"                    LOG.warning(_LW(\"redis cluster state failed\"))"},{"line_number":119,"context_line":"                else:"},{"line_number":120,"context_line":"                    new_nodes \u003d self._get_cluster_nodes(node)"},{"line_number":121,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"1a122d0e_60a13ba9","line":118,"range":{"start_line":118,"start_character":57,"end_line":118,"end_character":63},"in_reply_to":"1a122d0e_7e945ce7","updated":"2016-05-05 01:31:23.000000000","message":"Cluster state only has \"ok\" and \"failed\".","commit_id":"0d8369f508a9087d06f3c8c361f57a450c33446c"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"4a73fb4eeaacd0bfe46bfdc1d05ca5458e0a4974","unresolved":false,"context_lines":[{"line_number":272,"context_line":"            # should be recovered by people. Assumed that no scale down in"},{"line_number":273,"context_line":"            # cluster."},{"line_number":274,"context_line":"            # Do not have to notify changes."},{"line_number":275,"context_line":"            LOG.warning(_LW(\"redis cluster nodes less than local, \""},{"line_number":276,"context_line":"                            \"maybe there is a partition in db \""},{"line_number":277,"context_line":"                            \"cluster\"))"},{"line_number":278,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"1a122d0e_013a2dcd","line":275,"range":{"start_line":275,"start_character":24,"end_line":275,"end_character":27},"updated":"2016-05-04 13:20:56.000000000","message":"can print cluster nodes and local nodes here.","commit_id":"0d8369f508a9087d06f3c8c361f57a450c33446c"},{"author":{"_account_id":20188,"name":"zhuweiqiong","email":"zhuweiqiong@huawei.com","username":"zhuweiqiong"},"change_message_id":"317d14bd74bf0b440bab9f06c44015dc7b42e274","unresolved":false,"context_lines":[{"line_number":272,"context_line":"            # should be recovered by people. Assumed that no scale down in"},{"line_number":273,"context_line":"            # cluster."},{"line_number":274,"context_line":"            # Do not have to notify changes."},{"line_number":275,"context_line":"            LOG.warning(_LW(\"redis cluster nodes less than local, \""},{"line_number":276,"context_line":"                            \"maybe there is a partition in db \""},{"line_number":277,"context_line":"                            \"cluster\"))"},{"line_number":278,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"1a122d0e_80ff3765","line":275,"range":{"start_line":275,"start_character":24,"end_line":275,"end_character":27},"in_reply_to":"1a122d0e_013a2dcd","updated":"2016-05-05 01:31:23.000000000","message":"Done","commit_id":"0d8369f508a9087d06f3c8c361f57a450c33446c"}],"dragonflow/db/pub_sub_api.py":[{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"e78f70042549efdd8a3e37a82fcc5fad73c54f7d","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        \"\"\""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def set_publisher_for_failover(self, pub, callback):"},{"line_number":115,"context_line":"        handler_name \u003d \u0027_set_publisher_to_mgt\u0027"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        try:"},{"line_number":118,"context_line":"            handler \u003d getattr(self, handler_name, None)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_71b4e181","line":115,"updated":"2016-05-02 11:03:39.000000000","message":"Why not simply implement this method as \u0027pass\u0027, and let drivers extend and override it?\n\n(Same for the other new methods)","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"},{"author":{"_account_id":20188,"name":"zhuweiqiong","email":"zhuweiqiong@huawei.com","username":"zhuweiqiong"},"change_message_id":"95e8445f389fb2562845e2e2270c2130a2e03671","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        \"\"\""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def set_publisher_for_failover(self, pub, callback):"},{"line_number":115,"context_line":"        handler_name \u003d \u0027_set_publisher_to_mgt\u0027"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        try:"},{"line_number":118,"context_line":"            handler \u003d getattr(self, handler_name, None)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_0f522b35","line":115,"in_reply_to":"1a122d0e_71b4e181","updated":"2016-05-05 08:35:39.000000000","message":"Done, implement it as \"pass\" and the driver override it.","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"},{"author":{"_account_id":20188,"name":"zhuweiqiong","email":"zhuweiqiong@huawei.com","username":"zhuweiqiong"},"change_message_id":"64aa297bdec5195f0657199a5bee96111f4d433d","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        \"\"\""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def set_publisher_for_failover(self, pub, callback):"},{"line_number":115,"context_line":"        handler_name \u003d \u0027_set_publisher_to_mgt\u0027"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        try:"},{"line_number":118,"context_line":"            handler \u003d getattr(self, handler_name, None)"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_65e089fb","line":115,"in_reply_to":"1a122d0e_71b4e181","updated":"2016-05-03 03:21:34.000000000","message":"I think only Redis need this for cluster management in all drivers, so i did not add code for other db or pubsub drivers.","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"4a73fb4eeaacd0bfe46bfdc1d05ca5458e0a4974","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        \"\"\""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def set_publisher_for_failover(self, pub, callback):"},{"line_number":115,"context_line":"        handler_name \u003d \u0027_set_publisher_to_mgt\u0027"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        try:"},{"line_number":118,"context_line":"            handler \u003d getattr(self, handler_name, None)"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a122d0e_eb8f102c","line":115,"range":{"start_line":115,"start_character":24,"end_line":115,"end_character":45},"updated":"2016-05-04 13:20:56.000000000","message":"I think a better way is to define the default behavior of this method. The pubsub driver can override it if needed.","commit_id":"0d8369f508a9087d06f3c8c361f57a450c33446c"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"4a73fb4eeaacd0bfe46bfdc1d05ca5458e0a4974","unresolved":false,"context_lines":[{"line_number":122,"context_line":"            LOG.exception(e)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def start_detect_for_failover(self):"},{"line_number":125,"context_line":"        handler_name \u003d \u0027_start_detect_task\u0027"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        try:"},{"line_number":128,"context_line":"            handler \u003d getattr(self, handler_name, None)"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a122d0e_ab84f80a","line":125,"range":{"start_line":125,"start_character":24,"end_line":125,"end_character":42},"updated":"2016-05-04 13:20:56.000000000","message":"same question","commit_id":"0d8369f508a9087d06f3c8c361f57a450c33446c"}],"dragonflow/db/pubsub_drivers/redis_db_pubsub_driver.py":[{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"e78f70042549efdd8a3e37a82fcc5fad73c54f7d","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            if self.client is not None:"},{"line_number":85,"context_line":"                self.client.publish(local_topic, data)"},{"line_number":86,"context_line":"        except Exception as e:"},{"line_number":87,"context_line":"            LOG.warning(e)"},{"line_number":88,"context_line":"            self.redis_mgt.remove_node_from_master_list(self.remote)"},{"line_number":89,"context_line":"            self._update_client()"},{"line_number":90,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_d1a5f547","line":87,"updated":"2016-05-02 11:03:39.000000000","message":"Please use LOG.exception, which also prints the stack trace. (Or at least a more verbose warning message.)","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"},{"author":{"_account_id":20188,"name":"zhuweiqiong","email":"zhuweiqiong@huawei.com","username":"zhuweiqiong"},"change_message_id":"64aa297bdec5195f0657199a5bee96111f4d433d","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            if self.client is not None:"},{"line_number":85,"context_line":"                self.client.publish(local_topic, data)"},{"line_number":86,"context_line":"        except Exception as e:"},{"line_number":87,"context_line":"            LOG.warning(e)"},{"line_number":88,"context_line":"            self.redis_mgt.remove_node_from_master_list(self.remote)"},{"line_number":89,"context_line":"            self._update_client()"},{"line_number":90,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_45b8ede8","line":87,"in_reply_to":"1a122d0e_d1a5f547","updated":"2016-05-03 03:21:34.000000000","message":"Done","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"e78f70042549efdd8a3e37a82fcc5fad73c54f7d","unresolved":false,"context_lines":[{"line_number":201,"context_line":"                                    \"%(port)s\")"},{"line_number":202,"context_line":"                                % {\u0027ip\u0027: self.ip,"},{"line_number":203,"context_line":"                                   \u0027port\u0027: self.plugin_updates_port})"},{"line_number":204,"context_line":"                    eventlet.sleep(1)"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"            except Exception as e:"},{"line_number":207,"context_line":"                LOG.warning(_LW(\"subscriber listening task lost \""}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_3116e958","line":204,"updated":"2016-05-02 11:03:39.000000000","message":"Is it certain that _update_client will be called in this case?","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"},{"author":{"_account_id":20188,"name":"zhuweiqiong","email":"zhuweiqiong@huawei.com","username":"zhuweiqiong"},"change_message_id":"64aa297bdec5195f0657199a5bee96111f4d433d","unresolved":false,"context_lines":[{"line_number":201,"context_line":"                                    \"%(port)s\")"},{"line_number":202,"context_line":"                                % {\u0027ip\u0027: self.ip,"},{"line_number":203,"context_line":"                                   \u0027port\u0027: self.plugin_updates_port})"},{"line_number":204,"context_line":"                    eventlet.sleep(1)"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"            except Exception as e:"},{"line_number":207,"context_line":"                LOG.warning(_LW(\"subscriber listening task lost \""}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_2592114c","line":204,"in_reply_to":"1a122d0e_3116e958","updated":"2016-05-03 03:21:34.000000000","message":"This case means that pub_sub is None, so the only thing it can do is to wait for cluster changes from Plugin.","commit_id":"3656ebd2db068292ad3d7238869cc2c6b7f9febd"}]}
