kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkr...@apache.org
Subject svn commit: r1186535 - /incubator/kafka/trunk/clients/python/kafka.py
Date Wed, 19 Oct 2011 22:14:50 GMT
Author: jkreps
Date: Wed Oct 19 22:14:50 2011
New Revision: 1186535

URL: http://svn.apache.org/viewvc?rev=1186535&view=rev
Log:
KAFKA-162 Upgrade the python client to use the new message format.


Modified:
    incubator/kafka/trunk/clients/python/kafka.py

Modified: incubator/kafka/trunk/clients/python/kafka.py
URL: http://svn.apache.org/viewvc/incubator/kafka/trunk/clients/python/kafka.py?rev=1186535&r1=1186534&r2=1186535&view=diff
==============================================================================
--- incubator/kafka/trunk/clients/python/kafka.py (original)
+++ incubator/kafka/trunk/clients/python/kafka.py Wed Oct 19 22:14:50 2011
@@ -24,8 +24,9 @@ import sys
 PRODUCE_REQUEST_ID = 0
 
 def encode_message(message):
-    # <MAGIC_BYTE: char> <CRC32: int> <PAYLOAD: bytes>
-    return struct.pack('>B', 0) + \
+    # <MAGIC_BYTE: char> <COMPRESSION_ALGO: char> <CRC32: int> <PAYLOAD:
bytes>
+    return struct.pack('>B', 1) + \
+           struct.pack('>B', 0) + \
            struct.pack('>i', binascii.crc32(message)) + \
            message
 



Mime
View raw message