def __init__(self, kafka_url,
                 zookeeper_url, zookeeper_path,
                 group, topic,
                 fetch_size=1048576,
                 repartition_callback=None,
                 commit_callback=None,
                 commit_timeout=30):
        """Init

             kafka_url            - Kafka location
             zookeeper_url        - Zookeeper location
             zookeeper_path       - Zookeeper path used for partition
                                    negotiation
             group                - Kafka consumer group
             topic                - Kafka topic
             repartition_callback - Callback to run when the Kafka consumer
                                    group changes.  Repartitioning takes a
                                    relatively long time so this is a good
                                    time to flush and commit any data.
             commit_callback      - Callback to run when the commit_timeout
                                    has elapsed between commits.
             commit_timeout       - Timeout between commits.
        """

        self._kazoo_client = None
        self._set_partitioner = None

        self._repartition_callback = repartition_callback

        self._commit_callback = commit_callback
        self._commit_timeout = commit_timeout

        self._last_commit = 0

        self._partitions = []

        self._kafka_group = group
        self._kafka_topic = topic
        self._kafka_fetch_size = fetch_size

        self._zookeeper_url = zookeeper_url
        self._zookeeper_path = zookeeper_path

        self._kafka = kafka_client.KafkaClient(kafka_url)

        self._consumer = self._create_kafka_consumer()
def __init__ ( self , kafka_url , zookeeper_url , zookeeper_path , group , topic , fetch_size = 1048576 , repartition_callback = None , commit_callback = None , commit_timeout = 30 ) : self . _kazoo_client = None self . _set_partitioner = None self . _repartition_callback = repartition_callback self . _commit_callback = commit_callback self . _commit_timeout = commit_timeout self . _last_commit = 0 self . _partitions = [ ] self . _kafka_group = group self . _kafka_topic = topic self . _kafka_fetch_size = fetch_size self . _zookeeper_url = zookeeper_url self . _zookeeper_path = zookeeper_path self . _kafka = kafka_client . KafkaClient ( kafka_url ) self . _consumer = self . _create_kafka_consumer ( )
Init

             kafka_url            - Kafka location
             zookeeper_url        - Zookeeper location
             zookeeper_path       - Zookeeper path used for partition
                                    negotiation
             group                - Kafka consumer group
             topic                - Kafka topic
             repartition_callback - Callback to run when the Kafka consumer
                                    group changes.  Repartitioning takes a
                                    relatively long time so this is a good
                                    time to flush and commit any data.
             commit_callback      - Callback to run when the commit_timeout
                                    has elapsed between commits.
             commit_timeout       - Timeout between commits.