Author: Keith Bourgoin, Emmett Butler
Partition(topic, id_, leader, replicas, isr)¶
A Partition is an abstraction over the kafka concept of a partition. A kafka partition is a logical division of the logs for a topic. Its messages are totally ordered.
x.__eq__(y) <==> x==y
__hash__() <==> hash(x)¶
__init__(topic, id_, leader, replicas, isr)¶
Instantiate a new Partition
- topic (
pykafka.topic.Topic) – The topic to which this Partition belongs
- id (int) – The identifier for this partition
- leader (
pykafka.broker.Broker) – The broker that is currently acting as the leader for this partition.
- replicas (Iterable of
pykafka.broker.Broker) – A list of brokers containing this partition’s replicas
- isr (
pykafka.broker.Broker) – The current set of in-sync replicas for this partition
- topic (
x.__lt__(y) <==> x<y
x.__ne__(y) <==> x!=y
__repr__() <==> repr(x)¶
list of weak references to the object (if defined)
Get the earliest offset for this partition.
- Use the Offset API to find a limit of valid offsets
- for this partition.
- offsets_before (int) – Return an offset from before this timestamp (in milliseconds)
- max_offsets (int) – The maximum number of offsets to return
The identifying int for this partition, unique within its topic
The current list of in-sync replicas for this partition
Get the offset of the next message that would be appended to this partition
The broker currently acting as leader for this partition
The list of brokers currently holding replicas of this partition
The topic to which this partition belongs