Module row (2.3.3)

User-friendly container for Google Cloud Bigtable Row.

Classes

AppendRow

AppendRow(row_key, table)

Google Cloud Bigtable Row for sending append mutations.

These mutations are intended to augment the value of an existing cell and uses the methods:

  • append_cell_value
  • increment_cell_value

The first works by appending bytes and the second by incrementing an integer (stored in the cell as 8 bytes). In either case, if the cell is empty, assumes the default empty value (empty string for bytes or 0 for integer).

Parameters
NameDescription
row_key bytes

The key for the current row.

table Table

The table that owns the row.

ConditionalRow

ConditionalRow(row_key, table, filter_)

Google Cloud Bigtable Row for sending mutations conditionally.

Each mutation has an associated state: :data:True or :data:False. When commit-ed, the mutations for the :data:True state will be applied if the filter matches any cells in the row, otherwise the :data:False state will be applied.

A ConditionalRow accumulates mutations in the same way a DirectRow does:

  • set_cell
  • delete
  • delete_cell
  • delete_cells

with the only change the extra state parameter::

row_cond = table.row(b'row-key2', filter_=row_filter) row_cond.set_cell(u'fam', b'col', b'cell-val', state=True) row_cond.delete_cell(u'fam', b'col', state=False)

Parameters
NameDescription
row_key bytes

The key for the current row.

table Table

The table that owns the row.

filter_ .RowFilter

Filter to be used for conditional mutations.

DirectRow

DirectRow(row_key, table=None)

Google Cloud Bigtable Row for sending "direct" mutations.

These mutations directly set or delete cell contents:

  • set_cell
  • delete
  • delete_cell
  • delete_cells

These methods can be used directly::

row = table.row(b'row-key1') row.set_cell(u'fam', b'col1', b'cell-val') row.delete_cell(u'fam', b'col2')

Parameters
NameDescription
row_key bytes

The key for the current row.

table Table

(Optional) The table that owns the row. This is used for the :meth: commit only. Alternatively, DirectRows can be persisted via mutate_rows.

Row

Row(row_key, table=None)

Base representation of a Google Cloud Bigtable Row.

This class has three subclasses corresponding to the three RPC methods for sending row mutations:

  • DirectRow for MutateRow
  • ConditionalRow for CheckAndMutateRow
  • AppendRow for ReadModifyWriteRow
Parameters
NameDescription
row_key bytes

The key for the current row.

table Table

(Optional) The table that owns the row.