diff options
Diffstat (limited to 'kafka/protocol/message.py')
-rw-r--r-- | kafka/protocol/message.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/kafka/protocol/message.py b/kafka/protocol/message.py index 36f03ca..bfad127 100644 --- a/kafka/protocol/message.py +++ b/kafka/protocol/message.py @@ -6,7 +6,6 @@ import time from ..codec import (has_gzip, has_snappy, has_lz4, gzip_decode, snappy_decode, lz4_decode, lz4_decode_old_kafka) -from . import pickle from .struct import Struct from .types import ( Int8, Int32, Int64, Bytes, Schema, AbstractType @@ -36,7 +35,7 @@ class Message(Struct): CODEC_SNAPPY = 0x02 CODEC_LZ4 = 0x03 TIMESTAMP_TYPE_MASK = 0x08 - HEADER_SIZE = 22 # crc(4), magic(1), attributes(1), timestamp(8), key+value size(4*2) + HEADER_SIZE = 22 # crc(4), magic(1), attributes(1), timestamp(8), key+value size(4*2) def __init__(self, value, key=None, magic=0, attributes=0, crc=0, timestamp=None): @@ -127,7 +126,7 @@ class Message(Struct): else: raw_bytes = lz4_decode(self.value) else: - raise Exception('This should be impossible') + raise Exception('This should be impossible') return MessageSet.decode(raw_bytes, bytes_to_read=len(raw_bytes)) @@ -145,7 +144,7 @@ class MessageSet(AbstractType): ('offset', Int64), ('message', Bytes) ) - HEADER_SIZE = 12 # offset + message_size + HEADER_SIZE = 12 # offset + message_size @classmethod def encode(cls, items): |