diff options
| author | Dana Powers <dana.powers@rd.io> | 2015-11-29 10:00:50 +0800 | 
|---|---|---|
| committer | Zack Dever <zack.dever@rd.io> | 2015-12-04 11:25:40 -0800 | 
| commit | 058567912e8d82c1da5e5ead9e30be532573a173 (patch) | |
| tree | eb5cdd9d7c25729441cfa097772ca0623e4cbfe0 /kafka/protocol/offset.py | |
| parent | a85e09df89a43de5b659a0fa4ed35bec37c60e04 (diff) | |
| download | kafka-python-058567912e8d82c1da5e5ead9e30be532573a173.tar.gz | |
Add simple BrokerConnection class; add request.RESPONSE_TYPE class vars
Diffstat (limited to 'kafka/protocol/offset.py')
| -rw-r--r-- | kafka/protocol/offset.py | 23 | 
1 files changed, 11 insertions, 12 deletions
diff --git a/kafka/protocol/offset.py b/kafka/protocol/offset.py index 942bdbf..776de39 100644 --- a/kafka/protocol/offset.py +++ b/kafka/protocol/offset.py @@ -2,31 +2,30 @@ from .struct import Struct  from .types import Array, Int16, Int32, Int64, Schema, String -class OffsetRequest(Struct): -    API_KEY = 2 -    API_VERSION = 0 +class OffsetResponse(Struct):      SCHEMA = Schema( -        ('replica_id', Int32),          ('topics', Array(              ('topic', String('utf-8')),              ('partitions', Array(                  ('partition', Int32), -                ('time', Int64), -                ('max_offsets', Int32))))) +                ('error_code', Int16), +                ('offsets', Array(Int64))))))      ) -    DEFAULTS = { -        'replica_id': -1 -    } -class OffsetResponse(Struct): +class OffsetRequest(Struct):      API_KEY = 2      API_VERSION = 0 +    RESPONSE_TYPE = OffsetResponse      SCHEMA = Schema( +        ('replica_id', Int32),          ('topics', Array(              ('topic', String('utf-8')),              ('partitions', Array(                  ('partition', Int32), -                ('error_code', Int16), -                ('offsets', Array(Int64)))))) +                ('time', Int64), +                ('max_offsets', Int32)))))      ) +    DEFAULTS = { +        'replica_id': -1 +    }  | 
