summaryrefslogtreecommitdiff
path: root/test/test_unit.py
Commit message (Collapse)AuthorAgeFilesLines
* Split test files, modify test_protocolMark Roberts2014-04-081-674/+0
|
* Merge pull request #109 from mrtheb/developDana Powers2014-03-211-19/+174
|\ | | | | TopicAndPartition fix when partition has no leader = -1
| * Fix py26 compatibility issue, add mock to toxMark Roberts2014-03-181-17/+15
| |
| * Merge branch 'master' into developmrtheb2014-03-171-17/+134
| |\ | | | | | | | | | | | | Conflicts: test/test_unit.py
| * | fixing _get_leader_for_partition unittestsmrtheb2014-02-151-6/+6
| | |
| * | Changes based on comments by @rdiomar, plus added LeaderUnavailableError for ↵mrtheb2014-02-151-4/+4
| | | | | | | | | | | | clarity
| * | check for broker None in send_broker_aware_request (added test for it)mrtheb2014-01-311-0/+28
| | |
| * | Handle cases for partition with leader=-1 (not defined)Marc Labbe2014-01-311-48/+65
| | |
| * | removed commented out linesmrtheb2014-01-191-3/+0
| | |
| * | added mockmrtheb2014-01-181-6/+129
| | |
* | | Check against basestring instead of str in collect.hosts.Saulius Zemaitaitis2014-03-171-0/+10
| |/ |/|
* | Merge pull request #122 from mrtheb/multihostsOmar2014-02-261-1/+83
|\ \ | | | | | | Support for multiple hosts on KafkaClient boostrap (improves on #70)
| * | clean up after comments from @rdiomarmrtheb2014-02-151-130/+6
| | |
| * | Support list (or comma-separated) of hosts (replaces host and port arguments)mrtheb2014-02-091-8/+32
| | |
| * | Merge branch 'master' into multihostsmrtheb2014-01-311-158/+318
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | 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-141-1/+186
| | |
* | | Make it possible to read and write xerial snappyGreg Bowyer2014-02-191-0/+43
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Skip snappy/gzip tests if they're not availableOmar Ghishan2014-01-071-4/+7
| |
* | Style fix for importsOmar Ghishan2014-01-061-6/+2
| |
* | Fix unit tests.Omar Ghishan2014-01-061-150/+314
|/ | | | | | This is pretty much a rewrite. The tests that involve offset requests/responses are not implemented since that API is not supported in kafka 0.8 yet. Only kafka.codec and kafka.protocol are currently tested, so there is more work to be done here.
* Test fixes after flake8 runmrtheb2013-10-031-2/+2
|
* Revert "Disable unit tests for 2.6, close #57"David Arthur2013-10-031-5/+0
| | | | This reverts commit e39e05f8a50b7528a22fed99dc67d561cbd79c41.
* Disable unit tests for 2.6, close #57David Arthur2013-10-031-0/+5
|
* toxify all the tests and use xfail marksIvan Pouzyrevsky2013-06-071-8/+38
|
* Adhere to common python naming conventionsIvan Pouzyrevsky2013-06-071-0/+191