The ceilometer.alarm.partition.coordination ModuleΒΆ

class ceilometer.alarm.partition.coordination.PartitionCoordinator[source]

Bases: object

Implements the alarm partition coordination protocol.

A simple protocol based on AMQP fanout RPC is used.

All available partitions report their presence periodically.

The priority of each partition in terms of assuming mastership is determined by earliest start-time (with a UUID-based tiebreaker in the unlikely event of a time clash).

A single partition assumes mastership at any given time, taking responsibility for allocating the alarms to be evaluated across the set of currently available partitions.

When a partition lifecycle event is detected (i.e. a pre-existing partition fails to report its presence, or a new one is started up), a complete rebalance of the alarms is initiated.

Individual alarm lifecycle events, on the other hand, do not require a full re-balance. Instead new alarms are allocated as they are detected, whereas deleted alarms are initially allowed to remain within the allocation (as the individual evaluators are tolerant of assigned alarms not existing, and the deleted alarms should be randomly distributed over the partitions). However once the number of alarms deleted since the last rebalance reaches a certain limit, a rebalance will be initiated to maintain equity.

As presence reports are received, each partition keeps track of the oldest partition it currently knows about, allowing an assumption of mastership to be aborted if an older partition belatedly reports.

allocate(uuid, alarms)[source]

Accept an incoming alarm allocation.

assign(uuid, alarms)[source]

Accept an incoming alarm assignment.

assigned_alarms(api_client)[source]

Return the alarms assigned to the current partition.

check_mastership(eval_interval, api_client)[source]

Periodically check if the mastership role should be assumed.

Parameters:
  • eval_interval – the alarm evaluation interval
  • api_client – the API client to use for alarms.
presence(uuid, priority)[source]

Accept an incoming report of presence.

report_presence()[source]

Report the presence of the current partition.

class ceilometer.alarm.partition.coordination.PartitionIdentity(uuid, priority)[source]

Bases: object

Representation of a partition’s identity for age comparison.

Previous topic

The ceilometer.alarm.partition Module

Next topic

The ceilometer.alarm.storage.impl_sqlalchemy Module

This Page