Skip to content

gufo.liftbridge.types

Types definitions.

AckPolicy

Bases: IntEnum

Publish acknowledgment policy.

Attributes:

Name Type Description
LEADER

Wait for acknowledgment from a leader.

ALL

Wait for acknowledgment from all cluster members.

NONE

Do not wait for an acknowledgment.

Broker dataclass

Bases: object

Broker node metadata.

Attributes:

Name Type Description
id str

Broker id.

host str

Broker host.

port int

Broker port.

Message dataclass

Bases: object

Liftbridge message.

Parameters:

Name Type Description Default
value bytes

Message body.

required
subject str

Message stream.

required
offset int

Message offset.

required
timestamp int

Message timestamp in UNIX format.

required
key bytes

Message key.

required
partition int

stream partition.

required
headers Dict[str, bytes]

Additional message headers.

required

Metadata dataclass

Bases: object

Liftbridge cluster metadata.

Attributes:

Name Type Description
brockers

List of brokers.

metadata List[StreamMetadata]

List of stream's metadata.

PartitionMetadata dataclass

Bases: object

Partition metadata.

Attributes:

Name Type Description
id int

Partition id.

leader str

Leader broker id.

replicas List[str]

Replica nodes.

isr List[str]
high_watermark int

Highest uncommited offset in partition.

newest_offset int

Offset for the next record.

paused bool

Partition is paused.

RetentionPolicy dataclass

Bases: object

Partition's retention policy.

Attributes:

Name Type Description
retention_bytes int

Keep up to retention_bytes in a partition.

segment_bytes int
retention_ages int
segment_ages int

StartPosition

Bases: IntEnum

Subscriber's start position.

Attributes:

Name Type Description
NEW_ONLY

Start from new messages beyond the latest published.

OFFSET

Start at a specified offset.

EARLIEST

Start at the oldest message remaining in a partition.

LATEST

Start with the newest message.

TIMESTAMP

Start from a specified timestamp.

RESUME

Non-standard. Resume from next to last processed.

StreamMetadata dataclass

Bases: object

Stream metadata.

Attributes:

Name Type Description
name str

Stream name.

subject str

Stream subject.

partitions Dict[int, PartitionMetadata]

List of partitions metadata.