kiel.protocol.primitives
¶kiel.protocol.primitives.
Primitive
(value)[source]¶Bases: object
The most basic structure of the protocol. Subclassed, never used directly.
Used as a building block for the various actually-used primitives outlined in the Kafka wire protcol docs:
https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol
fmt
= None¶kiel.protocol.primitives.
VariablePrimitive
(value)[source]¶Bases: kiel.protocol.primitives.Primitive
Base primitive for variable-length scalar primitives (strings and bytes).
size_primitive
= None¶render
()[source]¶Returns the struct
format and list of the size and value.
The format is derived from the size primitive and the length of the resulting encoded value (e.g. the format for a string of ‘foo’ ends up as ‘h3s’.
Note
The value is expected to be string-able (wrapped in str()
) and is
then encoded as UTF-8.
kiel.protocol.primitives.
Int8
(value)[source]¶Bases: kiel.protocol.primitives.Primitive
Represents an 8-bit signed integer.
fmt
= 'b'¶kiel.protocol.primitives.
Int16
(value)[source]¶Bases: kiel.protocol.primitives.Primitive
Represents an 16-bit signed integer.
fmt
= 'h'¶kiel.protocol.primitives.
Int32
(value)[source]¶Bases: kiel.protocol.primitives.Primitive
Represents an 32-bit signed integer.
fmt
= 'i'¶kiel.protocol.primitives.
Int64
(value)[source]¶Bases: kiel.protocol.primitives.Primitive
Represents an 64-bit signed integer.
fmt
= 'q'¶kiel.protocol.primitives.
String
(value)[source]¶Bases: kiel.protocol.primitives.VariablePrimitive
Represents a string value, length denoted by a 16-bit signed integer.
kiel.protocol.primitives.
Bytes
(value)[source]¶Bases: kiel.protocol.primitives.VariablePrimitive
Represents a bytestring value, length denoted by a 32-bit signed integer.
kiel.protocol.primitives.
Array
(value)[source]¶Bases: kiel.protocol.primitives.Primitive
Represents an array of any arbitrary Primitive
or Part
.
Not used directly but rather by its of()
classmethod to denote an
Array.of(<something>)
.
item_class
= None¶