The ceilometer.storage.impl_hbase ModuleΒΆ

HBase storage backend

class ceilometer.storage.impl_hbase.Connection(url)[source]

Bases: ceilometer.storage.base.Connection

Put the data into a HBase database

Collections:

  • meter (describes sample actually):

    • row-key: consists of reversed timestamp, meter and a message signature for purposes of uniqueness

    • Column Families:

      f: contains the following qualifiers:

      • counter_name: <name of counter>

      • counter_type: <type of counter>

      • counter_unit: <unit of counter>

      • counter_volume: <volume of counter>

      • message: <raw incoming data>

      • message_id: <id of message>

      • message_signature: <signature of message>

      • resource_metadata: raw metadata for corresponding resource of the meter

      • project_id: <id of project>

      • resource_id: <id of resource>

      • user_id: <id of user>

      • recorded_at: <datetime when sample has been recorded (utc.now)>

      • flattened metadata with prefix r_metadata. e.g.:

        f:r_metadata.display_name or f:r_metadata.tag
      • rts: <reversed timestamp of entry>

      • timestamp: <meter’s timestamp (came from message)>

      • source for meter with prefix ‘s’

  • resource:

    • row_key: uuid of resource

    • Column Families:

      f: contains the following qualifiers:

      • resource_metadata: raw metadata for corresponding resource

      • project_id: <id of project>

      • resource_id: <id of resource>

      • user_id: <id of user>

      • flattened metadata with prefix r_metadata. e.g.:

        f:r_metadata.display_name or f:r_metadata.tag
      • sources for all corresponding meters with prefix ‘s’

      • all meters for this resource in format:

        "%s+%s+%s!%s!%s" % (rts, source, counter_name, counter_type,
        counter_unit)
        
  • events:

    • row_key: timestamp of event’s generation + uuid of event in format: “%s+%s” % (ts, Event.message_id)

    • Column Families:

      f: contains the following qualifiers:

      • event_type: description of event’s type

      • timestamp: time stamp of event generation

      • all traits for this event in format:

        "%s+%s" % (trait_name, trait_type)
        
Connection.clear()[source]
Connection.get_event_types()[source]

Return all event types as an iterable of strings.

Connection.get_events(event_filter)[source]

Return an iter of models.Event objects.

Parameters:event_filter – storage.EventFilter object, consists of filters for events that are stored in database.
Connection.get_meter_statistics(sample_filter, period=None, groupby=None, aggregate=None)[source]

Return an iterable of models.Statistics instances.

Items are containing meter statistics described by the query parameters. The filter must have a meter value set.

Note

Due to HBase limitations the aggregations are implemented in the driver itself, therefore this method will be quite slow because of all the Thrift traffic it is going to create.

Connection.get_meters(user=None, project=None, resource=None, source=None, metaquery=None, pagination=None)[source]

Return an iterable of models.Meter instances

Parameters:
  • user – Optional ID for user that owns the resource.
  • project – Optional ID for project that owns the resource.
  • resource – Optional resource filter.
  • source – Optional source filter.
  • metaquery – Optional dict with metadata to match on.
  • pagination – Optional pagination query.
Connection.get_resources(user=None, project=None, source=None, start_timestamp=None, start_timestamp_op=None, end_timestamp=None, end_timestamp_op=None, metaquery=None, resource=None, pagination=None)[source]

Return an iterable of models.Resource instances

Parameters:
  • user – Optional ID for user that owns the resource.
  • project – Optional ID for project that owns the resource.
  • source – Optional source filter.
  • start_timestamp – Optional modified timestamp start range.
  • start_timestamp_op – Optional start time operator, like ge, gt.
  • end_timestamp – Optional modified timestamp end range.
  • end_timestamp_op – Optional end time operator, like lt, le.
  • metaquery – Optional dict with metadata to match on.
  • resource – Optional resource filter.
  • pagination – Optional pagination query.
Connection.get_samples(sample_filter, limit=None)[source]

Return an iterable of models.Sample instances.

Parameters:
  • sample_filter – Filter.
  • limit – Maximum number of results to return.
Connection.get_trait_types(event_type)[source]

Return a dictionary containing the name and data type of the trait.

Only trait types for the provided event_type are returned.

Parameters:event_type – the type of the Event
Connection.get_traits(event_type, trait_type=None)[source]

Return all trait instances associated with an event_type.

If trait_type is specified, only return instances of that trait type. :param event_type: the type of the Event to filter by :param trait_type: the name of the Trait to filter by

Connection.record_events(event_models)[source]

Write the events to Hbase.

Parameters:event_models – a list of models.Event objects.
Return problem_events:
 a list of events that could not be saved in a (reason, event) tuple. From the reasons that are enumerated in storage.models.Event only the UNKNOWN_PROBLEM is applicable here.
Connection.record_metering_data(data)[source]

Write the data to the backend storage system.

Parameters:data – a dictionary such as returned by ceilometer.meter.meter_message_from_counter
Connection.upgrade()[source]

Previous topic

The ceilometer.storage.pymongo_base Module

Next topic

The ceilometer.storage.impl_sqlalchemy Module

This Page