Module column_family (1.5.1)

User friendly container for Google Cloud Bigtable Column Family.

Classes

ColumnFamily

ColumnFamily(column_family_id, table, gc_rule=None)

Representation of a Google Cloud Bigtable Column Family.

We can use a ColumnFamily to:

  • create itself
  • update itself
  • delete itself
Parameters
NameDescription
column_family_id str

The ID of the column family. Must be of the form <code>_a-zA-Z0-9][-_.a-zA-Z0-9]</code>*.

table Table

The table that owns the column family.

gc_rule GarbageCollectionRule

(Optional) The garbage collection settings for this column family.

GCRuleIntersection

GCRuleIntersection(rules)

Intersection of garbage collection rules.

For example:

.. literalinclude:: snippets_table.py :start-after: [START bigtable_create_family_gc_intersection] :end-before: [END bigtable_create_family_gc_intersection] :dedent: 4

Parameter
NameDescription
rules list

List of GarbageCollectionRule.

GCRuleUnion

GCRuleUnion(rules)

Union of garbage collection rules.

For example:

.. literalinclude:: snippets_table.py :start-after: [START bigtable_create_family_gc_union] :end-before: [END bigtable_create_family_gc_union] :dedent: 4

Parameter
NameDescription
rules list

List of GarbageCollectionRule.

GarbageCollectionRule

GarbageCollectionRule()

Garbage collection rule for column families within a table.

Cells in the column family (within a table) fitting the rule will be deleted during garbage collection.

A string gc_expression can also be used with API requests, but that value would be superceded by a gc_rule. As a result, we don't support that feature and instead support via native classes.

MaxAgeGCRule

MaxAgeGCRule(max_age)

Garbage collection limiting the age of a cell.

For example:

.. literalinclude:: snippets_table.py :start-after: [START bigtable_create_family_gc_max_age] :end-before: [END bigtable_create_family_gc_max_age] :dedent: 4

Parameter
NameDescription
max_age datetime.timedelta

The maximum age allowed for a cell in the table.

MaxVersionsGCRule

MaxVersionsGCRule(max_num_versions)

Garbage collection limiting the number of versions of a cell.

For example:

.. literalinclude:: snippets_table.py :start-after: [START bigtable_create_family_gc_max_versions] :end-before: [END bigtable_create_family_gc_max_versions] :dedent: 4

Parameter
NameDescription
max_num_versions int

The maximum number of versions