diff options
Diffstat (limited to 'kafka/protocol/fetch.py')
-rw-r--r-- | kafka/protocol/fetch.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/kafka/protocol/fetch.py b/kafka/protocol/fetch.py index c6d60cc..e00c9ab 100644 --- a/kafka/protocol/fetch.py +++ b/kafka/protocol/fetch.py @@ -3,9 +3,22 @@ from .struct import Struct from .types import Array, Int16, Int32, Int64, Schema, String +class FetchResponse(Struct): + SCHEMA = Schema( + ('topics', Array( + ('topics', String('utf-8')), + ('partitions', Array( + ('partition', Int32), + ('error_code', Int16), + ('highwater_offset', Int64), + ('message_set', MessageSet))))) + ) + + class FetchRequest(Struct): API_KEY = 1 API_VERSION = 0 + RESPONSE_TYPE = FetchResponse SCHEMA = Schema( ('replica_id', Int32), ('max_wait_time', Int32), @@ -17,14 +30,3 @@ class FetchRequest(Struct): ('offset', Int64), ('max_bytes', Int32))))) ) - -class FetchResponse(Struct): - SCHEMA = Schema( - ('topics', Array( - ('topics', String('utf-8')), - ('partitions', Array( - ('partition', Int32), - ('error_code', Int16), - ('highwater_offset', Int64), - ('message_set', MessageSet))))) - ) |