)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8514,"name":"Yathiraj Udupi","email":"yudupi@cisco.com","username":"yudupi"},"change_message_id":"99553fe520b7a8d30b274850a8b71ce70f789fed","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Implements: blueprint kafka-publisher"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add a Kafka publisher as a Ceilometer publisher"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: I7f8727ef5a85627a5a605079b6acdcd0619f978c"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"baa201ad_4029af99","line":9,"updated":"2014-10-08 20:27:51.000000000","message":"Move this line as the first line of the commit message.","commit_id":"366b92f959ddb7e9a51891e6bdf9796190d95228"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"5430645b17fd6695f744293df377582252b95ea5","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2015-02-09 15:50:31 -0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add a Kafka publisher as a Ceilometer publisher"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Implements: blueprint kafka-publisher"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: I7f8727ef5a85627a5a605079b6acdcd0619f978c"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":13,"id":"da86d52c_a1fe64ac","line":8,"updated":"2015-02-10 15:12:07.000000000","message":"(nit)can you add short description? ie.\n\nkafka publisher to support requeuing metering and event data to kafka MQ for external consumption.","commit_id":"fd246f647db13d920f603fa750fc0b8fa132a0a3"}],"ceilometer/publisher/kafka_broker.py":[{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"bf2815a3ff4359413ce14d15976946e1dea4d9c6","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#"},{"line_number":2,"context_line":"# Copyright 2014 Cisco Inc."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"# Author: Komei Shimamura \u003ckomei.t.f@gmail.com\u003e"},{"line_number":5,"context_line":"#"},{"line_number":6,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":7,"context_line":"# not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_9cba0c6d","line":4,"updated":"2015-02-07 00:25:29.000000000","message":"-1: remove author tag","commit_id":"bb36f628e3f43a9ec5f0dc7c296b08aaf4c6ba90"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"751ee63964ffdf3ba1828e07920d68796789bf95","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"class KafkaBrokerPublisher(publisher.PublisherBase):"},{"line_number":33,"context_line":"    \"\"\"Publisher metering data to kafka broker."},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    The ip address and port number of kafka broker should be configured in"},{"line_number":36,"context_line":"    ceilometer pipeline configuration file. If ip address is not specified,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_5aa8f676","line":33,"updated":"2015-01-26 18:26:19.000000000","message":"s/Publisher/Publish/","commit_id":"bb36f628e3f43a9ec5f0dc7c296b08aaf4c6ba90"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"751ee63964ffdf3ba1828e07920d68796789bf95","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    \"\"\"Publisher metering data to kafka broker."},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    The ip address and port number of kafka broker should be configured in"},{"line_number":36,"context_line":"    ceilometer pipeline configuration file. If ip address is not specified,"},{"line_number":37,"context_line":"    this kafka publisher does not publish any meters."},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    To enable this publisher, add the following section to the"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_faa442a7","line":36,"updated":"2015-01-26 18:26:19.000000000","message":"s/if ip address/if an ip address/","commit_id":"bb36f628e3f43a9ec5f0dc7c296b08aaf4c6ba90"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"751ee63964ffdf3ba1828e07920d68796789bf95","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    The ip address and port number of kafka broker should be configured in"},{"line_number":36,"context_line":"    ceilometer pipeline configuration file. If ip address is not specified,"},{"line_number":37,"context_line":"    this kafka publisher does not publish any meters."},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    To enable this publisher, add the following section to the"},{"line_number":40,"context_line":"    /etc/ceilometer/pipeline.yaml file or simply add it to an existing"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_3aab2a76","line":37,"updated":"2015-01-26 18:26:19.000000000","message":"s/does not/will not/","commit_id":"bb36f628e3f43a9ec5f0dc7c296b08aaf4c6ba90"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"751ee63964ffdf3ba1828e07920d68796789bf95","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            \u0027max_queue_length\u0027, [1024])[-1])"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        if self.policy in [\u0027default\u0027, \u0027drop\u0027, \u0027queue\u0027]:"},{"line_number":82,"context_line":"            LOG.info(_(\u0027Publishing policy set to %s\u0027) % self.policy)"},{"line_number":83,"context_line":"        else:"},{"line_number":84,"context_line":"            LOG.warn(_(\u0027Publishing policy is unknown (%s) force to default\u0027)"},{"line_number":85,"context_line":"                     % self.policy)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_3a1ecabb","line":82,"updated":"2015-01-26 18:26:19.000000000","message":"_LI","commit_id":"bb36f628e3f43a9ec5f0dc7c296b08aaf4c6ba90"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"751ee63964ffdf3ba1828e07920d68796789bf95","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        if self.policy in [\u0027default\u0027, \u0027drop\u0027, \u0027queue\u0027]:"},{"line_number":82,"context_line":"            LOG.info(_(\u0027Publishing policy set to %s\u0027) % self.policy)"},{"line_number":83,"context_line":"        else:"},{"line_number":84,"context_line":"            LOG.warn(_(\u0027Publishing policy is unknown (%s) force to default\u0027)"},{"line_number":85,"context_line":"                     % self.policy)"},{"line_number":86,"context_line":"            self.policy \u003d \u0027default\u0027"},{"line_number":87,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_5a1b96c9","line":84,"updated":"2015-01-26 18:26:19.000000000","message":"_LW","commit_id":"bb36f628e3f43a9ec5f0dc7c296b08aaf4c6ba90"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"751ee63964ffdf3ba1828e07920d68796789bf95","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        :param context: Execution context from the service or RPC call"},{"line_number":92,"context_line":"        :param samples: Samples from pipeline after transformation"},{"line_number":93,"context_line":"        \"\"\""},{"line_number":94,"context_line":"        self.local_queue.append(copy.deepcopy(samples))"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"        if not self._get_client():"},{"line_number":97,"context_line":"            if self.policy \u003d\u003d \u0027queue\u0027:"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_5a8e36d1","line":94,"updated":"2015-01-26 18:26:19.000000000","message":"why do you need this deepcopy? this seems like it would create massive overhead.","commit_id":"bb36f628e3f43a9ec5f0dc7c296b08aaf4c6ba90"},{"author":{"_account_id":12850,"name":"Komei Shimamura","email":"komei.t.f@gmail.com","username":"kshimamu"},"change_message_id":"05bfa7ff3b9a29962a850e1a03b37970a3eb26ef","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        :param context: Execution context from the service or RPC call"},{"line_number":92,"context_line":"        :param samples: Samples from pipeline after transformation"},{"line_number":93,"context_line":"        \"\"\""},{"line_number":94,"context_line":"        self.local_queue.append(copy.deepcopy(samples))"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"        if not self._get_client():"},{"line_number":97,"context_line":"            if self.policy \u003d\u003d \u0027queue\u0027:"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_1da2e898","line":94,"in_reply_to":"1a930d6b_5a8e36d1","updated":"2015-01-26 18:45:11.000000000","message":"without deep copy, queue have just reference of the object. In my Unit test, it fails, but it worth to confirm the case without deepcopy. thanks!","commit_id":"bb36f628e3f43a9ec5f0dc7c296b08aaf4c6ba90"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"751ee63964ffdf3ba1828e07920d68796789bf95","unresolved":false,"context_lines":[{"line_number":114,"context_line":"            try:"},{"line_number":115,"context_line":"                self._send(samples)"},{"line_number":116,"context_line":"            except Exception:"},{"line_number":117,"context_line":"                LOG.warn(_(\"Failed to publish %d samples\"),"},{"line_number":118,"context_line":"                         sum([len(m) for m in queue]))"},{"line_number":119,"context_line":"                if self.policy \u003d\u003d \u0027queue\u0027:"},{"line_number":120,"context_line":"                    return queue"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_5aa55645","line":117,"updated":"2015-01-26 18:26:19.000000000","message":"_LW","commit_id":"bb36f628e3f43a9ec5f0dc7c296b08aaf4c6ba90"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"1dadd7a21322ed1b0341384cf036b290143f9bec","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                LOG.warn(_(\"Failed to publish %d samples\"),"},{"line_number":118,"context_line":"                         sum([len(m) for m in queue]))"},{"line_number":119,"context_line":"                if self.policy \u003d\u003d \u0027queue\u0027:"},{"line_number":120,"context_line":"                    return queue"},{"line_number":121,"context_line":"                elif self.policy \u003d\u003d \u0027drop\u0027:"},{"line_number":122,"context_line":"                    return []"},{"line_number":123,"context_line":"                # default: immediately retry"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_29bcc605","line":120,"updated":"2015-01-26 20:18:36.000000000","message":"Isn\u0027t it a little dangerous to just return at this point as you could get stuck just retrying with the same message indefinitely.\n\nAlso, do you want to add some sort of retry timeout.\n\nPersonally, though, I prefer \"fail fast\" architecture in that you wouldn\u0027t try to handle this case and just exception and probably exit the program.\n\nHowever, if you do want to retry then would you want to retry indefintiely, or some number of times before giving up and exiting.","commit_id":"bb36f628e3f43a9ec5f0dc7c296b08aaf4c6ba90"},{"author":{"_account_id":8514,"name":"Yathiraj Udupi","email":"yudupi@cisco.com","username":"yudupi"},"change_message_id":"8d2615578d9b8a1b090e9c9b31843f8c87c7045b","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                LOG.warn(_(\"Failed to publish %d samples\"),"},{"line_number":118,"context_line":"                         sum([len(m) for m in queue]))"},{"line_number":119,"context_line":"                if self.policy \u003d\u003d \u0027queue\u0027:"},{"line_number":120,"context_line":"                    return queue"},{"line_number":121,"context_line":"                elif self.policy \u003d\u003d \u0027drop\u0027:"},{"line_number":122,"context_line":"                    return []"},{"line_number":123,"context_line":"                # default: immediately retry"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_661ce778","line":120,"in_reply_to":"1a930d6b_29bcc605","updated":"2015-02-06 23:32:09.000000000","message":"Yeah. working with Komei on this one.   The _check_queue_length() method gets called after processing queue, so that will ensure the same message is not retried indefinitely. \n\nRegarding the retry policy, we will add a mechanism to limit the number of retries based on a configuration option for max_retries, and then exit with an exception after maximum retries.","commit_id":"bb36f628e3f43a9ec5f0dc7c296b08aaf4c6ba90"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"751ee63964ffdf3ba1828e07920d68796789bf95","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        if queue_length \u003e self.max_queue_length \u003e 0:"},{"line_number":132,"context_line":"            diff \u003d queue_length - self.max_queue_length"},{"line_number":133,"context_line":"            self.local_queue \u003d self.local_queue[diff:]"},{"line_number":134,"context_line":"            LOG.warn(_(\"Kafka Publisher max local queue length is exceeded, \""},{"line_number":135,"context_line":"                     \"dropping %d oldest samples\") % diff)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def _get_client(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_ba6b9aef","line":134,"updated":"2015-01-26 18:26:19.000000000","message":"_LW","commit_id":"bb36f628e3f43a9ec5f0dc7c296b08aaf4c6ba90"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"751ee63964ffdf3ba1828e07920d68796789bf95","unresolved":false,"context_lines":[{"line_number":134,"context_line":"            LOG.warn(_(\"Kafka Publisher max local queue length is exceeded, \""},{"line_number":135,"context_line":"                     \"dropping %d oldest samples\") % diff)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def _get_client(self):"},{"line_number":138,"context_line":"        if not self.kafka_client:"},{"line_number":139,"context_line":"            try:"},{"line_number":140,"context_line":"                self.kafka_client \u003d kafka.KafkaClient("}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_bacf1a28","line":137,"updated":"2015-01-26 18:26:19.000000000","message":"is there a reason we don\u0027t do this on initialisation?","commit_id":"bb36f628e3f43a9ec5f0dc7c296b08aaf4c6ba90"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"1dadd7a21322ed1b0341384cf036b290143f9bec","unresolved":false,"context_lines":[{"line_number":134,"context_line":"            LOG.warn(_(\"Kafka Publisher max local queue length is exceeded, \""},{"line_number":135,"context_line":"                     \"dropping %d oldest samples\") % diff)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def _get_client(self):"},{"line_number":138,"context_line":"        if not self.kafka_client:"},{"line_number":139,"context_line":"            try:"},{"line_number":140,"context_line":"                self.kafka_client \u003d kafka.KafkaClient("}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_534461b6","line":137,"in_reply_to":"1a930d6b_3d3244f2","updated":"2015-01-26 20:18:36.000000000","message":"I would second Gordon\u0027s comment, preferring initialization to be handled in the constructer or in some separate initialization method. You should always try and create objects in their fully constructed state. There is no sense in constructing this object if the Kafka server is not available. In the constructor you can initialize the client, and if it fails have it raise an exception in the constructor which is caught by the main program. Then you can make a decision on whether you want to catch that exception and retry, potentially in a while loop until success, or exit the program with an error and let upstart or something handle re-starting the service.","commit_id":"bb36f628e3f43a9ec5f0dc7c296b08aaf4c6ba90"},{"author":{"_account_id":8514,"name":"Yathiraj Udupi","email":"yudupi@cisco.com","username":"yudupi"},"change_message_id":"8d2615578d9b8a1b090e9c9b31843f8c87c7045b","unresolved":false,"context_lines":[{"line_number":134,"context_line":"            LOG.warn(_(\"Kafka Publisher max local queue length is exceeded, \""},{"line_number":135,"context_line":"                     \"dropping %d oldest samples\") % diff)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def _get_client(self):"},{"line_number":138,"context_line":"        if not self.kafka_client:"},{"line_number":139,"context_line":"            try:"},{"line_number":140,"context_line":"                self.kafka_client \u003d kafka.KafkaClient("}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_619f71b5","line":137,"in_reply_to":"1a930d6b_534461b6","updated":"2015-02-06 23:32:09.000000000","message":"It is good to try calling this during initialization, but it would be a best effort during _init_ just return catching the exception (when Kafka Client is not available) and logging the error message and not failing initialization. \n\nBut before each send message,  we will check if client is already initialized and available, or else retry getting a KafkaClient connection.  If unaivailable raise an exception saying Kafka Client is not available, please restart Kafka client. \n\nThis way we need not restart the Ceilometer service, but only try restarting the Kafka client to make it available for the next message.","commit_id":"bb36f628e3f43a9ec5f0dc7c296b08aaf4c6ba90"},{"author":{"_account_id":12850,"name":"Komei Shimamura","email":"komei.t.f@gmail.com","username":"kshimamu"},"change_message_id":"05bfa7ff3b9a29962a850e1a03b37970a3eb26ef","unresolved":false,"context_lines":[{"line_number":134,"context_line":"            LOG.warn(_(\"Kafka Publisher max local queue length is exceeded, \""},{"line_number":135,"context_line":"                     \"dropping %d oldest samples\") % diff)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def _get_client(self):"},{"line_number":138,"context_line":"        if not self.kafka_client:"},{"line_number":139,"context_line":"            try:"},{"line_number":140,"context_line":"                self.kafka_client \u003d kafka.KafkaClient("}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_3d3244f2","line":137,"in_reply_to":"1a930d6b_bacf1a28","updated":"2015-01-26 18:45:11.000000000","message":"To deal with the case kafka broker (the destination of this publisher) is launched after this publisher ran. And also, to prevent from _get_client is called two times at the initial publish.","commit_id":"bb36f628e3f43a9ec5f0dc7c296b08aaf4c6ba90"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"751ee63964ffdf3ba1828e07920d68796789bf95","unresolved":false,"context_lines":[{"line_number":141,"context_line":"                    \"%s:%s\" % (self.host, self.port))"},{"line_number":142,"context_line":"                self.kafka_producer \u003d kafka.SimpleProducer(self.kafka_client)"},{"line_number":143,"context_line":"            except Exception as e:"},{"line_number":144,"context_line":"                LOG.exception(_(\"Failed to connect to Kafka service: %s\"), e)"},{"line_number":145,"context_line":"                return"},{"line_number":146,"context_line":"        return self.kafka_client"},{"line_number":147,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_fa552250","line":144,"updated":"2015-01-26 18:26:19.000000000","message":"_LE","commit_id":"bb36f628e3f43a9ec5f0dc7c296b08aaf4c6ba90"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"1dadd7a21322ed1b0341384cf036b290143f9bec","unresolved":false,"context_lines":[{"line_number":148,"context_line":"    def _send(self, samples):"},{"line_number":149,"context_line":"        for s in samples:"},{"line_number":150,"context_line":"            self.kafka_producer.send_messages("},{"line_number":151,"context_line":"                self.topic, json.dumps(s.as_dict()))"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_938089c1","line":151,"updated":"2015-01-26 20:18:36.000000000","message":"Are are two exceptions that are possible at this point in the code. A json exception and a Kafka exception. Would you want to have some for of try/except block to log the exceptions at this point of failure and then raise the exception again potentially.","commit_id":"bb36f628e3f43a9ec5f0dc7c296b08aaf4c6ba90"},{"author":{"_account_id":8514,"name":"Yathiraj Udupi","email":"yudupi@cisco.com","username":"yudupi"},"change_message_id":"8d2615578d9b8a1b090e9c9b31843f8c87c7045b","unresolved":false,"context_lines":[{"line_number":148,"context_line":"    def _send(self, samples):"},{"line_number":149,"context_line":"        for s in samples:"},{"line_number":150,"context_line":"            self.kafka_producer.send_messages("},{"line_number":151,"context_line":"                self.topic, json.dumps(s.as_dict()))"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_2172d949","line":151,"in_reply_to":"1a930d6b_938089c1","updated":"2015-02-06 23:32:09.000000000","message":"Yeah we wil catch the exception and log an error message and raise the exception again.","commit_id":"bb36f628e3f43a9ec5f0dc7c296b08aaf4c6ba90"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"b29164fe650f00b0cb9c763e1ca7a0d1382e3673","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        try:"},{"line_number":91,"context_line":"            self._get_client()"},{"line_number":92,"context_line":"        except Exception:"},{"line_number":93,"context_line":"            raise Exception(\u0027KafkaServerNotFound\u0027)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def publish_samples(self, context, samples):"},{"line_number":96,"context_line":"        \"\"\"Send a metering message for kafka broker."}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_e6cc4e64","line":93,"updated":"2015-02-07 15:44:48.000000000","message":"this should be a human readable message... that said, i don\u0027t think this would ever be called because all errors  in _get_client are wrapped","commit_id":"3a827236adb2067bac9ffa3f724c321e57b21041"},{"author":{"_account_id":12850,"name":"Komei Shimamura","email":"komei.t.f@gmail.com","username":"kshimamu"},"change_message_id":"13170b908c8d97e6dadfcf8aa8e145b3d97fcc6d","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        try:"},{"line_number":91,"context_line":"            self._get_client()"},{"line_number":92,"context_line":"        except Exception:"},{"line_number":93,"context_line":"            raise Exception(\u0027KafkaServerNotFound\u0027)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def publish_samples(self, context, samples):"},{"line_number":96,"context_line":"        \"\"\"Send a metering message for kafka broker."}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_d10aa626","line":93,"in_reply_to":"da86d52c_e6cc4e64","updated":"2015-02-07 18:27:53.000000000","message":"Thanks. I missed to modify little about _get_client method. Will change.","commit_id":"3a827236adb2067bac9ffa3f724c321e57b21041"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"b29164fe650f00b0cb9c763e1ca7a0d1382e3673","unresolved":false,"context_lines":[{"line_number":92,"context_line":"        except Exception:"},{"line_number":93,"context_line":"            raise Exception(\u0027KafkaServerNotFound\u0027)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def publish_samples(self, context, samples):"},{"line_number":96,"context_line":"        \"\"\"Send a metering message for kafka broker."},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"        :param context: Execution context from the service or RPC call"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_86e632e7","line":95,"updated":"2015-02-07 15:44:48.000000000","message":"publishers need a \"publish_events\" method now too.\n\nif you don\u0027t intend on using it, just raise a notimplemented similart to UDP\nhttps://github.com/openstack/ceilometer/blob/master/ceilometer/publisher/udp.py#L66-L72","commit_id":"3a827236adb2067bac9ffa3f724c321e57b21041"},{"author":{"_account_id":12850,"name":"Komei Shimamura","email":"komei.t.f@gmail.com","username":"kshimamu"},"change_message_id":"13170b908c8d97e6dadfcf8aa8e145b3d97fcc6d","unresolved":false,"context_lines":[{"line_number":92,"context_line":"        except Exception:"},{"line_number":93,"context_line":"            raise Exception(\u0027KafkaServerNotFound\u0027)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def publish_samples(self, context, samples):"},{"line_number":96,"context_line":"        \"\"\"Send a metering message for kafka broker."},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"        :param context: Execution context from the service or RPC call"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_1180be8a","line":95,"in_reply_to":"da86d52c_86e632e7","updated":"2015-02-07 18:27:53.000000000","message":"I got it. I\u0027ll implement publish_event near day, and repush. Thank you!","commit_id":"3a827236adb2067bac9ffa3f724c321e57b21041"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"5430645b17fd6695f744293df377582252b95ea5","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        ev_list \u003d [utils.message_from_event("},{"line_number":138,"context_line":"            event, cfg.CONF.publisher.telemetry_secret) for event in events]"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        self.local_queue.append(ev_list)"},{"line_number":141,"context_line":"        self.flush()"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    def _process_queue(self, queue):"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_a1b4a435","line":140,"updated":"2015-02-10 15:12:07.000000000","message":"i would think you\u0027d need _get_client here as well... maybe create a decorator for both publish_* methods?...","commit_id":"fd246f647db13d920f603fa750fc0b8fa132a0a3"},{"author":{"_account_id":12850,"name":"Komei Shimamura","email":"komei.t.f@gmail.com","username":"kshimamu"},"change_message_id":"6ac1dce7bd78877344f12fb163be8f77b5205204","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        ev_list \u003d [utils.message_from_event("},{"line_number":138,"context_line":"            event, cfg.CONF.publisher.telemetry_secret) for event in events]"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        self.local_queue.append(ev_list)"},{"line_number":141,"context_line":"        self.flush()"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    def _process_queue(self, queue):"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_70c91d25","line":140,"in_reply_to":"da86d52c_a1b4a435","updated":"2015-02-12 22:45:13.000000000","message":"yes, we need the _get_kafka here, thank you suggestion:)\nNow we try to make function for _get_client and his exceptions, and called in publish_event and publish_sample. Tried to use decorator for this, but couldn\u0027t find how to (the problem is to make ev_list and meters, they call different function). Personally interested in how to do, so if you have good idea, plz advise me. Thank you.","commit_id":"fd246f647db13d920f603fa750fc0b8fa132a0a3"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"5430645b17fd6695f744293df377582252b95ea5","unresolved":false,"context_lines":[{"line_number":176,"context_line":"            self.kafka_client \u003d kafka.KafkaClient("},{"line_number":177,"context_line":"                \"%s:%s\" % (self.host, self.port))"},{"line_number":178,"context_line":"            self.kafka_producer \u003d kafka.SimpleProducer(self.kafka_client)"},{"line_number":179,"context_line":"        return self.kafka_client"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    def _send(self, meters):"},{"line_number":182,"context_line":"        for m in meters:"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_be95a3e5","line":179,"updated":"2015-02-10 15:12:07.000000000","message":"i\u0027m not sure why this returns client... it doesn\u0027t seem to be use anywhere.","commit_id":"fd246f647db13d920f603fa750fc0b8fa132a0a3"},{"author":{"_account_id":12850,"name":"Komei Shimamura","email":"komei.t.f@gmail.com","username":"kshimamu"},"change_message_id":"044da79ffd57cd6c38e2424772d951fb132a6502","unresolved":false,"context_lines":[{"line_number":176,"context_line":"            self.kafka_client \u003d kafka.KafkaClient("},{"line_number":177,"context_line":"                \"%s:%s\" % (self.host, self.port))"},{"line_number":178,"context_line":"            self.kafka_producer \u003d kafka.SimpleProducer(self.kafka_client)"},{"line_number":179,"context_line":"        return self.kafka_client"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    def _send(self, meters):"},{"line_number":182,"context_line":"        for m in meters:"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_fd7f1864","line":179,"in_reply_to":"da86d52c_be95a3e5","updated":"2015-02-10 18:15:12.000000000","message":"actually, the reason is we used kafka_client as a kind of flag to confirm whether connection is established or not (like if not self.kafka_client: make connection.) now the role is included in this function, so we don\u0027t need return value like you say. Thank you suggestion:)","commit_id":"fd246f647db13d920f603fa750fc0b8fa132a0a3"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"6716103a07b34d5682d0a73833771f14a75ec951","unresolved":false,"context_lines":[{"line_number":142,"context_line":"    def _process_queue(self, queue):"},{"line_number":143,"context_line":"        current_retry \u003d 0"},{"line_number":144,"context_line":"        while queue:"},{"line_number":145,"context_line":"            samples \u003d queue[0]"},{"line_number":146,"context_line":"            try:"},{"line_number":147,"context_line":"                self._send(samples)"},{"line_number":148,"context_line":"            except Exception:"}],"source_content_type":"text/x-python","patch_set":15,"id":"da86d52c_ab86a8b8","line":145,"updated":"2015-02-13 13:31:11.000000000","message":"not the end of the world but this should be named \"data\" or something generic since you implemented publish_events and therefore this will publish both events and samples\n\n...and accordingly for all samples/meter references in _process_queue, and _send","commit_id":"263b13fde2444bbd8ef2213ae835941adc65e9ff"},{"author":{"_account_id":12850,"name":"Komei Shimamura","email":"komei.t.f@gmail.com","username":"kshimamu"},"change_message_id":"ee06a268a533aacb4c9b99043c99e6c05b1ac428","unresolved":false,"context_lines":[{"line_number":142,"context_line":"    def _process_queue(self, queue):"},{"line_number":143,"context_line":"        current_retry \u003d 0"},{"line_number":144,"context_line":"        while queue:"},{"line_number":145,"context_line":"            samples \u003d queue[0]"},{"line_number":146,"context_line":"            try:"},{"line_number":147,"context_line":"                self._send(samples)"},{"line_number":148,"context_line":"            except Exception:"}],"source_content_type":"text/x-python","patch_set":15,"id":"da86d52c_43742736","line":145,"in_reply_to":"da86d52c_ab86a8b8","updated":"2015-02-13 18:19:02.000000000","message":"I got it. Thank you suggestion:)\nThanks to you, we improve our coding skills, and your saying is very helpful for us. I really appreciate to you.\nThank you again!:)","commit_id":"263b13fde2444bbd8ef2213ae835941adc65e9ff"}],"ceilometer/publisher/messaging_kafka.py":[{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"1b1671f65813a5a8bfe6555afb987a8153eee853","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from ceilometer.openstack.common import log"},{"line_number":25,"context_line":"from ceilometer import publisher"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"from kafka import KafkaClient, SimpleProducer"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":30,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_212e63fb","line":27,"updated":"2014-10-09 07:43:36.000000000","message":"Please split import packages in two lines, it should be one import module in one line. And take a look on your import modules json for ex. is not used and modules from oslo and six packages should be in one block.","commit_id":"b1e119e9dbecb3224ae0fd806219238e035abb59"},{"author":{"_account_id":12850,"name":"Komei Shimamura","email":"komei.t.f@gmail.com","username":"kshimamu"},"change_message_id":"3f75545852eb2b08ddbecd05cb9753666411840f","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from ceilometer.openstack.common import log"},{"line_number":25,"context_line":"from ceilometer import publisher"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"from kafka import KafkaClient, SimpleProducer"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":30,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_9a876ad7","line":27,"in_reply_to":"baa201ad_212e63fb","updated":"2014-10-09 15:37:01.000000000","message":"Thank you for your kindness! I modify next version.","commit_id":"b1e119e9dbecb3224ae0fd806219238e035abb59"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"f8e3026b9ed7f94e1a0cdcad281a21658961be3c","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from ceilometer.openstack.common import log"},{"line_number":21,"context_line":"from ceilometer import publisher"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"from kafka import KafkaClient"},{"line_number":24,"context_line":"from kafka import SimpleProducer"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"LOG \u003d log.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_5dc40a5f","line":23,"updated":"2014-10-10 09:18:28.000000000","message":"It is seems that KafkaClient and SimpleProducer are classes not modules, you should import only modules, so should import kafka, and use kafka.KafkaClient and kafka.SimpleProducer in code.","commit_id":"2bcb1935a086926ac1677f0dfbfc947898177ce0"},{"author":{"_account_id":12850,"name":"Komei Shimamura","email":"komei.t.f@gmail.com","username":"kshimamu"},"change_message_id":"2ed69de2cea2d01b1ef91caf00fc557a9706e89a","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from ceilometer.openstack.common import log"},{"line_number":21,"context_line":"from ceilometer import publisher"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"from kafka import KafkaClient"},{"line_number":24,"context_line":"from kafka import SimpleProducer"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"LOG \u003d log.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_96e80518","line":23,"in_reply_to":"baa201ad_5dc40a5f","updated":"2014-10-10 16:41:42.000000000","message":"Thank you for your kindness! I will modify this code. I still have other tests I have to pass, however they require the change of global-requirement.txt file of Openstack/requirement project. So I\u0027ll wait the approval of our commit for Openstack/requirement project, and next patch of this code will be committed after merged. Thank you.","commit_id":"2bcb1935a086926ac1677f0dfbfc947898177ce0"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"af6b875bdba3bf00dfda2b4e588cd3f47134c124","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    The ip address and port number of kafka broker should be configured in"},{"line_number":33,"context_line":"    ceilometer pipeline configuration file. If ip address is not specified,"},{"line_number":34,"context_line":"    this kafka publisher does not publish any meters. Also, kafka broker"},{"line_number":35,"context_line":"    has to be launched before the execution of this publisher."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    To enable this publisher, add the following section to the"},{"line_number":38,"context_line":"    /etc/ceilometer/publisher.yaml file or simply add it to an existing"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_5072dd7c","line":35,"updated":"2014-10-14 11:24:28.000000000","message":"btw, why? I\u0027m not Kafka expert, but I really supposed there is kind of reconnection opportunity to use here?","commit_id":"2bcb1935a086926ac1677f0dfbfc947898177ce0"},{"author":{"_account_id":12850,"name":"Komei Shimamura","email":"komei.t.f@gmail.com","username":"kshimamu"},"change_message_id":"14ce2b307d0382a1d6f3b936731a4b560f282374","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    The ip address and port number of kafka broker should be configured in"},{"line_number":33,"context_line":"    ceilometer pipeline configuration file. If ip address is not specified,"},{"line_number":34,"context_line":"    this kafka publisher does not publish any meters. Also, kafka broker"},{"line_number":35,"context_line":"    has to be launched before the execution of this publisher."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    To enable this publisher, add the following section to the"},{"line_number":38,"context_line":"    /etc/ceilometer/publisher.yaml file or simply add it to an existing"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_b38b091d","line":35,"in_reply_to":"baa201ad_5072dd7c","updated":"2014-10-14 16:23:53.000000000","message":"Thank you comments. Yes, your saying is right. I\u0027ll modify this behavior to deal with the reconnection to use this publisher comfortably.","commit_id":"2bcb1935a086926ac1677f0dfbfc947898177ce0"},{"author":{"_account_id":7729,"name":"Ilya Tyaptin","email":"ityaptin@mirantis.com","username":"ityaptin"},"change_message_id":"1101f9d6533e392412854b0c32c3bf6ae541d1c8","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    has to be launched before the execution of this publisher."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    To enable this publisher, add the following section to the"},{"line_number":38,"context_line":"    /etc/ceilometer/publisher.yaml file or simply add it to an existing"},{"line_number":39,"context_line":"    pipeline:"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        meter:"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_dfba60e0","line":38,"range":{"start_line":38,"start_character":20,"end_line":38,"end_character":29},"updated":"2014-10-14 10:05:37.000000000","message":"I think pipeline.yaml should be instead of publisher.yaml.","commit_id":"2bcb1935a086926ac1677f0dfbfc947898177ce0"},{"author":{"_account_id":12850,"name":"Komei Shimamura","email":"komei.t.f@gmail.com","username":"kshimamu"},"change_message_id":"14ce2b307d0382a1d6f3b936731a4b560f282374","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    has to be launched before the execution of this publisher."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    To enable this publisher, add the following section to the"},{"line_number":38,"context_line":"    /etc/ceilometer/publisher.yaml file or simply add it to an existing"},{"line_number":39,"context_line":"    pipeline:"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        meter:"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_4077653b","line":38,"in_reply_to":"baa201ad_dfba60e0","updated":"2014-10-14 16:23:53.000000000","message":"thank you comments, I\u0027ll fix this typo..","commit_id":"2bcb1935a086926ac1677f0dfbfc947898177ce0"},{"author":{"_account_id":7729,"name":"Ilya Tyaptin","email":"ityaptin@mirantis.com","username":"ityaptin"},"change_message_id":"1101f9d6533e392412854b0c32c3bf6ae541d1c8","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            - name: kafka_sink"},{"line_number":51,"context_line":"            transformers:"},{"line_number":52,"context_line":"            publishers:"},{"line_number":53,"context_line":"                - 192.168.33.10:9092?topic\u003dceilometer"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    Kafka topic name and broker\u0027s port are required for this publisher to work"},{"line_number":56,"context_line":"    properly. If topic parameter is missing, this kafka publisher publish"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_5fb0308b","line":53,"updated":"2014-10-14 10:05:37.000000000","message":"If it possible, may you use in comment url that looks like other publisher urls: \"notifier://\" or \"udp://localhost:12345\". Better to say - define publisher type in scheme field in url?","commit_id":"2bcb1935a086926ac1677f0dfbfc947898177ce0"},{"author":{"_account_id":12850,"name":"Komei Shimamura","email":"komei.t.f@gmail.com","username":"kshimamu"},"change_message_id":"14ce2b307d0382a1d6f3b936731a4b560f282374","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            - name: kafka_sink"},{"line_number":51,"context_line":"            transformers:"},{"line_number":52,"context_line":"            publishers:"},{"line_number":53,"context_line":"                - 192.168.33.10:9092?topic\u003dceilometer"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    Kafka topic name and broker\u0027s port are required for this publisher to work"},{"line_number":56,"context_line":"    properly. If topic parameter is missing, this kafka publisher publish"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_20f8a17b","line":53,"in_reply_to":"baa201ad_5fb0308b","updated":"2014-10-14 16:23:53.000000000","message":"I fogot to write \"kafka://\", so this line really is:\npublishers:\n    - kafka://192.168.33.10:9092?topic\u003dceilometer","commit_id":"2bcb1935a086926ac1677f0dfbfc947898177ce0"},{"author":{"_account_id":7729,"name":"Ilya Tyaptin","email":"ityaptin@mirantis.com","username":"ityaptin"},"change_message_id":"1101f9d6533e392412854b0c32c3bf6ae541d1c8","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        if parsed_url.query:"},{"line_number":67,"context_line":"            params \u003d urlparse.parse_qs(parsed_url.query)"},{"line_number":68,"context_line":"            if params.get(\u0027topic\u0027):"},{"line_number":69,"context_line":"                try:"},{"line_number":70,"context_line":"                    self.topic \u003d str(params.get(\u0027topic\u0027)[0])"},{"line_number":71,"context_line":"                except ValueError:"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_dad0ae55","line":68,"updated":"2014-10-14 10:05:37.000000000","message":"Maybe this topic should to add as option to oslo config? Same approach is used in rpc publisher. Otherwise, if we do not use this publisher for collector, different topics for different pipelines are more useful.","commit_id":"2bcb1935a086926ac1677f0dfbfc947898177ce0"},{"author":{"_account_id":12850,"name":"Komei Shimamura","email":"komei.t.f@gmail.com","username":"kshimamu"},"change_message_id":"6dbbb64a9c055db2d8d4403e32f8ae6181437726","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        if parsed_url.query:"},{"line_number":67,"context_line":"            params \u003d urlparse.parse_qs(parsed_url.query)"},{"line_number":68,"context_line":"            if params.get(\u0027topic\u0027):"},{"line_number":69,"context_line":"                try:"},{"line_number":70,"context_line":"                    self.topic \u003d str(params.get(\u0027topic\u0027)[0])"},{"line_number":71,"context_line":"                except ValueError:"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_20a41aa5","line":68,"in_reply_to":"baa201ad_13f935c8","updated":"2014-10-14 19:24:42.000000000","message":"One more things, about kafka publisher.  Kafka is distributed messaging system which enables applications to handle high-throughput real-time messages. Kafka also identifiy messages by topic, but this is not related with oslo\u0027s topic. Ceilometer\u0027s metering data has a big potential for analyzing. This implementation enables applications to directly consume  the ceilometer samples. For example monasca-project: https://github.com/stackforge/monasca-thresh can consume the ceilometer metrics, and this code enables out-side of Openstack applications to subscribe high-throughput real-time Ceilometer metrics.","commit_id":"2bcb1935a086926ac1677f0dfbfc947898177ce0"},{"author":{"_account_id":12850,"name":"Komei Shimamura","email":"komei.t.f@gmail.com","username":"kshimamu"},"change_message_id":"14ce2b307d0382a1d6f3b936731a4b560f282374","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        if parsed_url.query:"},{"line_number":67,"context_line":"            params \u003d urlparse.parse_qs(parsed_url.query)"},{"line_number":68,"context_line":"            if params.get(\u0027topic\u0027):"},{"line_number":69,"context_line":"                try:"},{"line_number":70,"context_line":"                    self.topic \u003d str(params.get(\u0027topic\u0027)[0])"},{"line_number":71,"context_line":"                except ValueError:"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_13f935c8","line":68,"in_reply_to":"baa201ad_dad0ae55","updated":"2014-10-14 16:23:53.000000000","message":"Thank you suggestion, now my source code use Kafka python client library,  this enable us to quickly start to use kafka broker. I\u0027ll look more detail of the rpc publisher approach, and reflect to this code or blueprints, or both.","commit_id":"2bcb1935a086926ac1677f0dfbfc947898177ce0"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"e2239a2757cc5ad005b837d959d5b5a2c9e5ad4d","unresolved":false,"context_lines":[{"line_number":22,"context_line":"from ceilometer.openstack.common import log"},{"line_number":23,"context_line":"from ceilometer import publisher"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"import kafka"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_e84b21ae","line":25,"updated":"2014-11-11 16:10:32.000000000","message":"-1: kafka is a third party module, place it before project module group","commit_id":"d74d93facb430cbb8d82e58439320baa29e0410a"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"dd277a45d9371020aef2105fdf1b8c920ba1e13a","unresolved":false,"context_lines":[{"line_number":68,"context_line":"            params \u003d urlparse.parse_qs(parsed_url.query)"},{"line_number":69,"context_line":"            if params.get(\u0027topic\u0027):"},{"line_number":70,"context_line":"                try:"},{"line_number":71,"context_line":"                    self.topic \u003d str(params.get(\u0027topic\u0027)[0])"},{"line_number":72,"context_line":"                except ValueError:"},{"line_number":73,"context_line":"                    LOG.error(_(\u0027topic should be specified correctly.\u0027))"},{"line_number":74,"context_line":"                    return"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_64aa031b","line":71,"updated":"2014-11-11 13:42:06.000000000","message":"could you clarify why do you use str operator here, do you expect that value of \u0027topic\u0027 could be not a string?","commit_id":"d74d93facb430cbb8d82e58439320baa29e0410a"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"d12c7fc8489a5f09ce1cad81b59e4aa1e83cc9b2","unresolved":false,"context_lines":[{"line_number":70,"context_line":"                try:"},{"line_number":71,"context_line":"                    self.topic \u003d str(params.get(\u0027topic\u0027)[0])"},{"line_number":72,"context_line":"                except ValueError:"},{"line_number":73,"context_line":"                    LOG.error(_(\u0027topic should be specified correctly.\u0027))"},{"line_number":74,"context_line":"                    return"},{"line_number":75,"context_line":"            else:"},{"line_number":76,"context_line":"                self.topic \u003d \"ceilometer\""}],"source_content_type":"text/x-python","patch_set":5,"id":"7a8c0949_233c872f","line":73,"updated":"2014-10-30 17:26:16.000000000","message":"better if: \u0027topic %s is not in correct format\u0027 % params.get(\u0027topic\u0027)","commit_id":"d74d93facb430cbb8d82e58439320baa29e0410a"},{"author":{"_account_id":12850,"name":"Komei Shimamura","email":"komei.t.f@gmail.com","username":"kshimamu"},"change_message_id":"8dea89a24e5c6cfacf0166d3c8895f06768aa5e7","unresolved":false,"context_lines":[{"line_number":70,"context_line":"                try:"},{"line_number":71,"context_line":"                    self.topic \u003d str(params.get(\u0027topic\u0027)[0])"},{"line_number":72,"context_line":"                except ValueError:"},{"line_number":73,"context_line":"                    LOG.error(_(\u0027topic should be specified correctly.\u0027))"},{"line_number":74,"context_line":"                    return"},{"line_number":75,"context_line":"            else:"},{"line_number":76,"context_line":"                self.topic \u003d \"ceilometer\""}],"source_content_type":"text/x-python","patch_set":5,"id":"7a8c0949_06b780d9","line":73,"in_reply_to":"7a8c0949_233c872f","updated":"2014-10-31 19:31:16.000000000","message":"Thank you for suggestions!","commit_id":"d74d93facb430cbb8d82e58439320baa29e0410a"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"d12c7fc8489a5f09ce1cad81b59e4aa1e83cc9b2","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        try:"},{"line_number":79,"context_line":"            self.kafka_client \u003d kafka.KafkaClient("},{"line_number":80,"context_line":"                str(self.host) + \":\" + str(self.port))"},{"line_number":81,"context_line":"            self.kafka_producer \u003d kafka.SimpleProducer(self.kafka_client)"},{"line_number":82,"context_line":"        except Exception as e:"},{"line_number":83,"context_line":"            LOG.error(_(\"kafka connection does not work.\"))"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a8c0949_036dcb32","line":80,"updated":"2014-10-30 17:26:16.000000000","message":"better if: \"%s:%s\" % (self.host, self.port)","commit_id":"d74d93facb430cbb8d82e58439320baa29e0410a"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"d12c7fc8489a5f09ce1cad81b59e4aa1e83cc9b2","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            self.kafka_producer \u003d kafka.SimpleProducer(self.kafka_client)"},{"line_number":82,"context_line":"        except Exception as e:"},{"line_number":83,"context_line":"            LOG.error(_(\"kafka connection does not work.\"))"},{"line_number":84,"context_line":"            LOG.exception(e)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def publish_samples(self, context, samples):"},{"line_number":87,"context_line":"        \"\"\"Send a metering message for kafka broker"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a8c0949_c3e8237f","line":84,"updated":"2014-10-30 17:26:16.000000000","message":"can just:\n\n    LOG.exception(_(\"Failed to connect to Kafka service because: %s\"), e)\n\n?","commit_id":"d74d93facb430cbb8d82e58439320baa29e0410a"},{"author":{"_account_id":12850,"name":"Komei Shimamura","email":"komei.t.f@gmail.com","username":"kshimamu"},"change_message_id":"8dea89a24e5c6cfacf0166d3c8895f06768aa5e7","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            self.kafka_producer \u003d kafka.SimpleProducer(self.kafka_client)"},{"line_number":82,"context_line":"        except Exception as e:"},{"line_number":83,"context_line":"            LOG.error(_(\"kafka connection does not work.\"))"},{"line_number":84,"context_line":"            LOG.exception(e)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def publish_samples(self, context, samples):"},{"line_number":87,"context_line":"        \"\"\"Send a metering message for kafka broker"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a8c0949_86d1b0fd","line":84,"in_reply_to":"7a8c0949_c3e8237f","updated":"2014-10-31 19:31:16.000000000","message":"pep8 test require us to fit a line to 80 characters, so I\u0027llmodify little about your message, and I\u0027ll use your syntax. Thank you!","commit_id":"d74d93facb430cbb8d82e58439320baa29e0410a"},{"author":{"_account_id":7729,"name":"Ilya Tyaptin","email":"ityaptin@mirantis.com","username":"ityaptin"},"change_message_id":"b0750ee61235e44babd2d051840c4851f5df4684","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            LOG.exception(e)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def publish_samples(self, context, samples):"},{"line_number":87,"context_line":"        \"\"\"Send a metering message for kafka broker"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        :param context: Execution context from the service or RPC call"},{"line_number":90,"context_line":"        :param samples: Samples from pipeline after transformation"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a8c0949_85bb86c3","line":87,"updated":"2014-10-30 14:28:04.000000000","message":"First line in docstring should to end with \".\".","commit_id":"d74d93facb430cbb8d82e58439320baa29e0410a"},{"author":{"_account_id":12850,"name":"Komei Shimamura","email":"komei.t.f@gmail.com","username":"kshimamu"},"change_message_id":"8dea89a24e5c6cfacf0166d3c8895f06768aa5e7","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            LOG.exception(e)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def publish_samples(self, context, samples):"},{"line_number":87,"context_line":"        \"\"\"Send a metering message for kafka broker"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        :param context: Execution context from the service or RPC call"},{"line_number":90,"context_line":"        :param samples: Samples from pipeline after transformation"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a8c0949_c6ad788a","line":87,"in_reply_to":"7a8c0949_85bb86c3","updated":"2014-10-31 19:31:16.000000000","message":"Thank you comment!","commit_id":"d74d93facb430cbb8d82e58439320baa29e0410a"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"d12c7fc8489a5f09ce1cad81b59e4aa1e83cc9b2","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        :param context: Execution context from the service or RPC call"},{"line_number":90,"context_line":"        :param samples: Samples from pipeline after transformation"},{"line_number":91,"context_line":"        \"\"\""},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        if self.kafka_client is None:"},{"line_number":94,"context_line":"            \"\"\" Try to reconnect to Kafka broker \"\"\""},{"line_number":95,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a8c0949_83bc5b6e","line":92,"updated":"2014-10-30 17:26:16.000000000","message":"blank line L92 is not needed","commit_id":"d74d93facb430cbb8d82e58439320baa29e0410a"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"d12c7fc8489a5f09ce1cad81b59e4aa1e83cc9b2","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        \"\"\""},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        if self.kafka_client is None:"},{"line_number":94,"context_line":"            \"\"\" Try to reconnect to Kafka broker \"\"\""},{"line_number":95,"context_line":"            try:"},{"line_number":96,"context_line":"                self.kafka_client \u003d kafka.KafkaClient("},{"line_number":97,"context_line":"                    str(self.host) + \":\" + str(self.port))"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a8c0949_e3bb5f70","line":94,"updated":"2014-10-30 17:26:16.000000000","message":"-1: use \u0027#\u0027 instead of pair of (\"\"\", \"\"\") in inline comment","commit_id":"d74d93facb430cbb8d82e58439320baa29e0410a"},{"author":{"_account_id":12850,"name":"Komei Shimamura","email":"komei.t.f@gmail.com","username":"kshimamu"},"change_message_id":"8dea89a24e5c6cfacf0166d3c8895f06768aa5e7","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        \"\"\""},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        if self.kafka_client is None:"},{"line_number":94,"context_line":"            \"\"\" Try to reconnect to Kafka broker \"\"\""},{"line_number":95,"context_line":"            try:"},{"line_number":96,"context_line":"                self.kafka_client \u003d kafka.KafkaClient("},{"line_number":97,"context_line":"                    str(self.host) + \":\" + str(self.port))"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a8c0949_260abc8a","line":94,"in_reply_to":"7a8c0949_e3bb5f70","updated":"2014-10-31 19:31:16.000000000","message":"Thanks!","commit_id":"d74d93facb430cbb8d82e58439320baa29e0410a"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"d12c7fc8489a5f09ce1cad81b59e4aa1e83cc9b2","unresolved":false,"context_lines":[{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        if self.kafka_client is None:"},{"line_number":94,"context_line":"            \"\"\" Try to reconnect to Kafka broker \"\"\""},{"line_number":95,"context_line":"            try:"},{"line_number":96,"context_line":"                self.kafka_client \u003d kafka.KafkaClient("},{"line_number":97,"context_line":"                    str(self.host) + \":\" + str(self.port))"},{"line_number":98,"context_line":"                self.kafka_producer \u003d kafka.SimpleProducer(self.kafka_client)"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a8c0949_030ceb41","line":95,"updated":"2014-10-30 17:26:16.000000000","message":"-1: if we need to do this in several places, we\u0027d better write a helper method, so we can just:\n\n    def _get_client():\n        if not self.client:\n            # do the initialization\n        return self.client\n\nthen in somewhere else:\n\n    if not self._get_client():\n        return","commit_id":"d74d93facb430cbb8d82e58439320baa29e0410a"},{"author":{"_account_id":12850,"name":"Komei Shimamura","email":"komei.t.f@gmail.com","username":"kshimamu"},"change_message_id":"8dea89a24e5c6cfacf0166d3c8895f06768aa5e7","unresolved":false,"context_lines":[{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        if self.kafka_client is None:"},{"line_number":94,"context_line":"            \"\"\" Try to reconnect to Kafka broker \"\"\""},{"line_number":95,"context_line":"            try:"},{"line_number":96,"context_line":"                self.kafka_client \u003d kafka.KafkaClient("},{"line_number":97,"context_line":"                    str(self.host) + \":\" + str(self.port))"},{"line_number":98,"context_line":"                self.kafka_producer \u003d kafka.SimpleProducer(self.kafka_client)"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a8c0949_668924eb","line":95,"in_reply_to":"7a8c0949_030ceb41","updated":"2014-10-31 19:31:16.000000000","message":"when I write this code, I face some design problem. but yur code solve my problem, thank you so much!","commit_id":"d74d93facb430cbb8d82e58439320baa29e0410a"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"d12c7fc8489a5f09ce1cad81b59e4aa1e83cc9b2","unresolved":false,"context_lines":[{"line_number":94,"context_line":"            \"\"\" Try to reconnect to Kafka broker \"\"\""},{"line_number":95,"context_line":"            try:"},{"line_number":96,"context_line":"                self.kafka_client \u003d kafka.KafkaClient("},{"line_number":97,"context_line":"                    str(self.host) + \":\" + str(self.port))"},{"line_number":98,"context_line":"                self.kafka_producer \u003d kafka.SimpleProducer(self.kafka_client)"},{"line_number":99,"context_line":"            except Exception as e:"},{"line_number":100,"context_line":"                LOG.error(_(\"kafka connection still does not work.\"))"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a8c0949_a36877f6","line":97,"updated":"2014-10-30 17:26:16.000000000","message":"ditto","commit_id":"d74d93facb430cbb8d82e58439320baa29e0410a"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"d12c7fc8489a5f09ce1cad81b59e4aa1e83cc9b2","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                self.kafka_producer \u003d kafka.SimpleProducer(self.kafka_client)"},{"line_number":99,"context_line":"            except Exception as e:"},{"line_number":100,"context_line":"                LOG.error(_(\"kafka connection still does not work.\"))"},{"line_number":101,"context_line":"                LOG.exception(e)"},{"line_number":102,"context_line":"                return"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        for sample in samples:"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a8c0949_6303ef0f","line":101,"updated":"2014-10-30 17:26:16.000000000","message":"ditto","commit_id":"d74d93facb430cbb8d82e58439320baa29e0410a"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"d12c7fc8489a5f09ce1cad81b59e4aa1e83cc9b2","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                    self.topic, str(sample.as_dict()))"},{"line_number":108,"context_line":"            except Exception as e:"},{"line_number":109,"context_line":"                LOG.error(_(\"kafka producer does not work properly.\"))"},{"line_number":110,"context_line":"                LOG.exception(e)"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a8c0949_a6040516","line":110,"updated":"2014-10-30 17:26:16.000000000","message":"ditto","commit_id":"d74d93facb430cbb8d82e58439320baa29e0410a"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"fca6e9c0369ff8b3366a1d04c4c2e4f36b76d485","unresolved":false,"context_lines":[{"line_number":15,"context_line":"# License for the specific language governing permissions and limitations"},{"line_number":16,"context_line":"# under the License."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"import kafka"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from oslo.utils import netutils"},{"line_number":21,"context_line":"from six.moves.urllib import parse as urlparse"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a890539_5056455d","line":18,"updated":"2014-11-14 02:24:45.000000000","message":"move L18 to L19, kafka is third-party module, it is not builtins","commit_id":"a0d05f2ef2f1092178559f11d05295fe2dfeb42c"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"fca6e9c0369ff8b3366a1d04c4c2e4f36b76d485","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    this kafka publisher does not publish any meters."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    To enable this publisher, add the following section to the"},{"line_number":38,"context_line":"    /etc/ceilometer/pipeline.yaml file or simply add it to an existing"},{"line_number":39,"context_line":"    pipeline::"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        meter:"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a890539_70018137","line":38,"updated":"2014-11-14 02:24:45.000000000","message":"How about create configuration options, just like what we have done for AMQP, kafka_host, kafka_port, kafka_topic, etc.","commit_id":"a0d05f2ef2f1092178559f11d05295fe2dfeb42c"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"fca6e9c0369ff8b3366a1d04c4c2e4f36b76d485","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            if params.get(\u0027topic\u0027):"},{"line_number":70,"context_line":"                try:"},{"line_number":71,"context_line":"                    self.topic \u003d params.get(\u0027topic\u0027)[0]"},{"line_number":72,"context_line":"                except ValueError:"},{"line_number":73,"context_line":"                    LOG.error(_(\u0027topic should be specified correctly.\u0027))"},{"line_number":74,"context_line":"                    return"},{"line_number":75,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a890539_7088a1c5","line":72,"updated":"2014-11-14 02:24:45.000000000","message":"Why there would be an ValueError? I think a get() definitely returns something, if there is not particular reason for this exception, I think we can refactor the code to self.topic \u003d params.get(\u0027topic\u0027, [\u0027ceilometer\u0027])[0] or [-1]","commit_id":"a0d05f2ef2f1092178559f11d05295fe2dfeb42c"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"50639c7f2961bca9acc54cb8413a7ed607e17422","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            if params.get(\u0027topic\u0027):"},{"line_number":70,"context_line":"                try:"},{"line_number":71,"context_line":"                    self.topic \u003d params.get(\u0027topic\u0027)[0]"},{"line_number":72,"context_line":"                except ValueError:"},{"line_number":73,"context_line":"                    LOG.error(_(\u0027topic should be specified correctly.\u0027))"},{"line_number":74,"context_line":"                    return"},{"line_number":75,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a890539_a73e3ad8","line":72,"in_reply_to":"5a890539_7088a1c5","updated":"2014-11-14 15:11:08.000000000","message":"Agree with ZhiQiang we do not need here try block","commit_id":"a0d05f2ef2f1092178559f11d05295fe2dfeb42c"},{"author":{"_account_id":7729,"name":"Ilya Tyaptin","email":"ityaptin@mirantis.com","username":"ityaptin"},"change_message_id":"713c2fe7fa8a199f78bb453210d86bb868ff727f","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        for sample in samples:"},{"line_number":88,"context_line":"            try:"},{"line_number":89,"context_line":"                self.kafka_producer.send_messages("},{"line_number":90,"context_line":"                    self.topic, str(sample.as_dict()))"},{"line_number":91,"context_line":"            except Exception as e:"},{"line_number":92,"context_line":"                LOG.exception(_(\"Kafka producer does not work because: %s\"), e)"},{"line_number":93,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"5a890539_411ae67d","line":90,"updated":"2014-11-14 14:21:44.000000000","message":"Maybe json.loads instead str is better in this case? I think we\u0027ll parse this message when receive it, and json parsing is easier than dict str.","commit_id":"a0d05f2ef2f1092178559f11d05295fe2dfeb42c"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"fca6e9c0369ff8b3366a1d04c4c2e4f36b76d485","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            try:"},{"line_number":89,"context_line":"                self.kafka_producer.send_messages("},{"line_number":90,"context_line":"                    self.topic, str(sample.as_dict()))"},{"line_number":91,"context_line":"            except Exception as e:"},{"line_number":92,"context_line":"                LOG.exception(_(\"Kafka producer does not work because: %s\"), e)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def _get_client(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a890539_f051f136","line":91,"updated":"2014-11-14 02:24:45.000000000","message":"As I said previously, we should let user choose, retry, cache or drop","commit_id":"a0d05f2ef2f1092178559f11d05295fe2dfeb42c"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"fca6e9c0369ff8b3366a1d04c4c2e4f36b76d485","unresolved":false,"context_lines":[{"line_number":99,"context_line":"                self.kafka_producer \u003d kafka.SimpleProducer(self.kafka_client)"},{"line_number":100,"context_line":"            except Exception as e:"},{"line_number":101,"context_line":"                LOG.exception(_(\"Failed to connect Kafka service: %s\"), e)"},{"line_number":102,"context_line":"                return None"},{"line_number":103,"context_line":"        return self.kafka_client"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a890539_5079e5c6","line":102,"updated":"2014-11-14 02:24:45.000000000","message":"`return` just returns None by default, so /return None/return/","commit_id":"a0d05f2ef2f1092178559f11d05295fe2dfeb42c"}],"ceilometer/tests/publisher/test_kafka_broker_publisher.py":[{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"bf2815a3ff4359413ce14d15976946e1dea4d9c6","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#"},{"line_number":2,"context_line":"# Copyright 2014 Cisco Inc."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"# Author: Komei Shimamura \u003ckomei.t.f@gmail.com\u003e"},{"line_number":5,"context_line":"#"},{"line_number":6,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":7,"context_line":"# not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_1ca61c54","line":4,"updated":"2015-02-07 00:25:29.000000000","message":"remove author tag","commit_id":"bb36f628e3f43a9ec5f0dc7c296b08aaf4c6ba90"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"62bb24ee93b3304e3f69fd78e0e9154bde724738","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#"},{"line_number":2,"context_line":"# Copyright 2014 Cisco Inc."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"# Author: Komei Shimamura \u003ckomei.t.f@gmail.com\u003e"},{"line_number":5,"context_line":"#"},{"line_number":6,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":7,"context_line":"# not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_a31c0379","line":4,"updated":"2015-02-09 16:55:39.000000000","message":"-1: remove the author tag, otherwise, it will not pass pep8","commit_id":"3a827236adb2067bac9ffa3f724c321e57b21041"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"62bb24ee93b3304e3f69fd78e0e9154bde724738","unresolved":false,"context_lines":[{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def test_publish(self):"},{"line_number":101,"context_line":"        publisher \u003d kafka_publisher.KafkaBrokerPublisher("},{"line_number":102,"context_line":"            netutils.urlsplit(\u0027kafka://192.168.33.10:9092?topic\u003dceilometer\u0027))"},{"line_number":103,"context_line":"        publisher._get_client \u003d mock.Mock(name\u003d\"_get_client\")"},{"line_number":104,"context_line":"        publisher._get_client.return_value \u003d mock.Mock()"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_f6115b54","line":102,"updated":"2015-02-09 16:55:39.000000000","message":"I think use real ip in test code is not a good idea, since _get_client is mocked, it is no matter what this ip is, so plz use 127.0.0.1","commit_id":"3a827236adb2067bac9ffa3f724c321e57b21041"},{"author":{"_account_id":12850,"name":"Komei Shimamura","email":"komei.t.f@gmail.com","username":"kshimamu"},"change_message_id":"c61884a6f5c3c2ea625b7dc1b8433274170673bc","unresolved":false,"context_lines":[{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def test_publish(self):"},{"line_number":101,"context_line":"        publisher \u003d kafka_publisher.KafkaBrokerPublisher("},{"line_number":102,"context_line":"            netutils.urlsplit(\u0027kafka://192.168.33.10:9092?topic\u003dceilometer\u0027))"},{"line_number":103,"context_line":"        publisher._get_client \u003d mock.Mock(name\u003d\"_get_client\")"},{"line_number":104,"context_line":"        publisher._get_client.return_value \u003d mock.Mock()"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_02711244","line":102,"in_reply_to":"da86d52c_f6115b54","updated":"2015-02-12 22:44:52.000000000","message":"I\u0027ll modify these as you say. sorry for late aware of these comments, and thank you!:)","commit_id":"3a827236adb2067bac9ffa3f724c321e57b21041"}],"setup.cfg":[{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"5430645b17fd6695f744293df377582252b95ea5","unresolved":false,"context_lines":[{"line_number":270,"context_line":"ceilometer.event.publisher \u003d"},{"line_number":271,"context_line":"    test \u003d ceilometer.publisher.test:TestPublisher"},{"line_number":272,"context_line":"    direct \u003d ceilometer.publisher.direct:DirectPublisher"},{"line_number":273,"context_line":"    notifier \u003d ceilometer.publisher.messaging:EventNotifierPublisher"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"ceilometer.alarm.rule \u003d"},{"line_number":276,"context_line":"    threshold \u003d ceilometer.api.controllers.v2.alarms:AlarmThresholdRule"}],"source_content_type":"text/x-ttcn-cfg","patch_set":13,"id":"da86d52c_a1b90417","line":273,"updated":"2015-02-10 15:12:07.000000000","message":"add kafka here if you intend to support it.","commit_id":"fd246f647db13d920f603fa750fc0b8fa132a0a3"}]}
