summaryrefslogtreecommitdiff
path: root/kafka
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | Reinstate test_integrate, make test_protocol more explicit, create testutilMark Roberts2014-04-081-1/+1
| | | |
* | | | Explicit testing of protocol errors. Make tests more explicit, and start ↵Mark Roberts2014-04-082-4/+7
|/ / / | | | | | | | | | working on intermittent failures in test_encode_fetch_request and test_encode_produc_request
* | | Merge pull request #134 from wizzat/conn_refactorv0.9.0Dana Powers2014-03-213-26/+35
|\ \ \ | | | | | | | | conn.py performance improvements, make examples work, add another example
| * \ \ Merge branch 'master' into conn_refactorMark Roberts2014-03-182-5/+5
| |\ \ \
| * \ \ \ Merge branch 'master' into conn_refactorMark Roberts2014-02-263-9/+46
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: example.py
| * | | | | Fix grammar in error stringMark Roberts2014-02-251-1/+1
| | | | | |
| * | | | | Minor refactor in conn.py, update version in __init__.py, add ErrorStringMark Roberts2014-02-253-26/+35
| | | | | |
* | | | | | Merge pull request #109 from mrtheb/developDana Powers2014-03-212-10/+29
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | TopicAndPartition fix when partition has no leader = -1
| * | | | | Merge branch 'master' into developmrtheb2014-03-175-15/+144
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: test/test_unit.py
| * | | | | | Changes based on comments by @rdiomar, plus added LeaderUnavailableError for ↵mrtheb2014-02-152-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | clarity
| * | | | | | check for broker None in send_broker_aware_request (added test for it)mrtheb2014-01-311-5/+14
| | | | | | |
| * | | | | | Merge branch 'master' into developmrtheb2014-01-312-74/+114
| |\ \ \ \ \ \ | | | |_|_|_|/ | | |/| | | |
| * | | | | | Handle cases for partition with leader=-1 (not defined)Marc Labbe2014-01-312-10/+12
| | | | | | |
| * | | | | | added mockmrtheb2014-01-181-3/+4
| | | | | | |
* | | | | | | Check against basestring instead of str in collect.hosts.Saulius Zemaitaitis2014-03-171-1/+1
| |_|/ / / / |/| | | | |
* | | | | | If a broker refuses the connection, try the nextstephenarmstrong2014-03-131-3/+3
| |_|_|_|/ |/| | | |
* | | | | nit: fixed misspellingZack Dever2014-03-031-1/+1
| |_|_|/ |/| | |
* | | | Merge pull request #122 from mrtheb/multihostsOmar2014-02-263-9/+46
|\ \ \ \ | |_|_|/ |/| | | Support for multiple hosts on KafkaClient boostrap (improves on #70)
| * | | clean up after comments from @rdiomarmrtheb2014-02-151-3/+5
| | | |
| * | | Support list (or comma-separated) of hosts (replaces host and port arguments)mrtheb2014-02-092-7/+11
| | | |
| * | | Merge branch 'master' into multihostsmrtheb2014-01-317-341/+471
| |\ \ \ | | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: kafka/client.py kafka/conn.py setup.py test/test_integration.py test/test_unit.py
| * | | Allow KafkaClient to take in a list of brokers for bootstrappingMarc Labbe2013-11-143-22/+48
| | | |
* | | | Fix version in __init__.py to match setup.pyDavid Arthur2014-02-251-1/+1
| | | |
* | | | Make it possible to read and write xerial snappyGreg Bowyer2014-02-191-3/+95
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes mumrah/kafka-python#126 TL;DR ===== This makes it possible to read and write snappy compressed streams that are compatible with the java and scala kafka clients (the xerial blocking format)) Xerial Details ============== Kafka supports transparent compression of data (both in transit and at rest) of messages, one of the allowable compression algorithms is Google's snappy, an algorithm which has excellent performance at the cost of efficiency. The specific implementation of snappy used in kafka is the xerial-snappy implementation, this is a readily available java library for snappy. As part of this implementation, there is a specialised blocking format that is somewhat none standard in the snappy world. Xerial Format ------------- The blocking mode of the xerial snappy library is fairly simple, using a magic header to identify itself and then a size + block scheme, unless otherwise noted all items in xerials blocking format are assumed to be big-endian. A block size (```xerial_blocksize``` in implementation) controls how frequent the blocking occurs 32k is the default in the xerial library, this blocking controls the size of the uncompressed chunks that will be fed to snappy to be compressed. The format winds up being | Header | Block1 len | Block1 data | Blockn len | Blockn data | | ----------- | ---------- | ------------ | ---------- | ------------ | | 16 bytes | BE int32 | snappy bytes | BE int32 | snappy bytes | It is important to not that the blocksize is the amount of uncompressed data presented to snappy at each block, whereas the blocklen is the number of bytes that will be present in the stream, that is the length will always be <= blocksize. Xerial blocking header ---------------------- Marker | Magic String | Null / Pad | Version | Compat ------ | ------------ | ---------- | -------- | -------- byte | c-string | byte | int32 | int32 ------ | ------------ | ---------- | -------- | -------- -126 | 'SNAPPY' | \0 | variable | variable The pad appears to be to ensure that SNAPPY is a valid cstring, and to align the header on a word boundary. The version is the version of this format as written by xerial, in the wild this is currently 1 as such we only support v1. Compat is there to claim the minimum supported version that can read a xerial block stream, presently in the wild this is 1. Implementation specific details =============================== The implementation presented here follows the Xerial implementation as of its v1 blocking format, no attempts are made to check for future versions. Since none-xerial aware clients might have persisted snappy compressed messages to kafka brokers we allow clients to turn on xerial compatibility for message sending, and perform header sniffing to detect xerial vs plain snappy payloads.
* | | Merge pull request #111 from rdiomar/multitopic_producersDana Powers2014-01-301-35/+44
|\ \ \ | | | | | | | | Make producers take a topic argument at send rather than init time -- fixes Issue #110, but breaks backwards compatibility with previous Producer interface.
| * | | Use TopicAndPartition when producing async messagesOmar Ghishan2014-01-271-8/+11
| | | |
| * | | Make producers take a topic argument at send rather than init timeOmar Ghishan2014-01-231-34/+40
| | |/ | |/| | | | | | | This allows a single producer to be used to send to multiple topics. See https://github.com/mumrah/kafka-python/issues/110
* | | Resolve conflicts for #106Omar Ghishan2014-01-281-39/+70
|\ \ \ | |/ / |/| |
| * | Add doc string for SimpleConsumer._get_message()Omar Ghishan2014-01-201-0/+6
| | |
| * | Make get_messages() update and commit offsets just before returningOmar Ghishan2014-01-151-16/+35
| | |
| * | Only use timeout if it's not NoneOmar Ghishan2014-01-151-4/+5
| | |
| * | Store fetched offsets separately.Omar Ghishan2014-01-151-10/+14
| | | | | | | | | | | | | | | | | | | | | Fetch requests can be repeated if we get a ConsumerFetchSizeTooSmall or if _fetch() is called multiple times for some reason. We don't want to re-fetch messages that are already in our queue, so store the offsets of the last enqueued messages from each partition.
| * | Fix offset increments:Omar Ghishan2014-01-151-16/+17
| | | | | | | | | | | | | | | * Increment the offset before returning a message rather than when putting it in the internal queue. This prevents committing the wrong offsets. * In MultiProcessConsumer, store the offset of the next message
* | | Merge pull request #107 from rdiomar/fix_default_timeoutsMarc Labbé2014-01-162-3/+13
|\ \ \ | | | | | | | | Increase default connection timeout
| * | | Change default socket timeout to 120 seconds in both the client and connectionOmar Ghishan2014-01-162-5/+10
| | | |
| * | | Make the default connection timeout NoneOmar Ghishan2014-01-161-1/+6
| |/ / | | | | | | | | | This fixes the default behavior, which used to cause a socket timeout when waiting for 10 seconds for a message to be produced.
* | | Merge pull request #98 from waliaashish85/devOmar2014-01-161-4/+2
|\ \ \ | | | | | | | | Changes for aligning code with offset fetch and commit APIs (Kafka 0.8.1)
| * | | Deleting client_id from offset commit and fetch response as per Kafka trunk codeAshish Walia2014-01-131-2/+0
| | | |
| * | | Syncing offset commit and fetch api keys with Kafka trunk codeAshish Walia2014-01-131-2/+2
| | | |
* | | | Merge branch 'repr' of https://github.com/mahendra/kafka-python into ↵mrtheb2014-01-144-1/+18
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | mahendra-repr Conflicts: kafka/client.py kafka/consumer.py
| * | | Add proper string representations for each classMahendra M2013-10-084-2/+19
| | | |
* | | | Merge pull request #100 from cosbynator/no_infinite_loops_realOmar2014-01-144-95/+125
|\ \ \ \ | | | | | | | | | | Branch fix: No infinite loops during metadata requests, invalidate metadata more, exception hierarchy
| * | | | Throw KafkaUnavailableError when no brokers availableThomas Dimson2014-01-132-2/+6
| | | | |
| * | | | Exception hierarchy, invalidate more md on errorsThomas Dimson2014-01-134-95/+121
| | | | |
* | | | | remove zero length field name in format string, to work in Python 2.6Vadim Graboys2014-01-131-1/+1
|/ / / /
* | | | Merge pull request #88 from rdiomar/rdiomar_changesOmar2014-01-135-190/+216
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various changes/fixes, including: * Allow customizing socket timeouts * Read the correct number of bytes from kafka * Guarantee reading the expected number of bytes from the socket every time * Remove bufsize from client and conn * SimpleConsumer flow changes * Fix some error handling * Add optional upper limit to consumer fetch buffer size * Add and fix unit and integration tests
| * | | Change log.error() back to log.exception()Omar Ghishan2014-01-082-8/+8
| | | |
| * | | Change BufferUnderflowError to ConnectionError in conn._read_bytes()Omar Ghishan2014-01-082-6/+4
| | | | | | | | | | | | Both errors are handled the same way when raised and caught, so this makes sense.
| * | | Remove unnecessary methodOmar Ghishan2014-01-071-17/+8
| | | |
| * | | Handle dirty flag in conn.recv()Omar Ghishan2014-01-071-1/+3
| | | | | | | | | | | | | | | | | | | | * If the connection is dirty, reinit * If we get a BufferUnderflowError, the server could have gone away, so mark it dirty