Google Cloud Bigtable C++ Client  1.32.1
A C++ Client Library for Google Cloud Bigtable
Public Member Functions | Friends | List of all members
google::cloud::bigtable::v1::Cell Class Reference

The in-memory representation of a Bigtable cell. More...

#include <google/cloud/bigtable/cell.h>

Public Member Functions

template<typename KeyType , typename ColumnType , typename ValueType , typename std::enable_if<!std::is_integral< ValueType >::value, int >::type = 0>
 Cell (KeyType &&row_key, std::string family_name, ColumnType &&column_qualifier, std::int64_t timestamp, ValueType &&value, std::vector< std::string > labels)
 Create a Cell and fill it with data. More...
 
template<typename KeyType , typename ColumnType >
 Cell (KeyType &&row_key, std::string family_name, ColumnType &&column_qualifier, std::int64_t timestamp, std::int64_t value, std::vector< std::string > labels)
 Create a Cell and fill it with a 64-bit value encoded as big endian. More...
 
template<typename KeyType , typename ColumnType , typename ValueType >
 Cell (KeyType &&row_key, std::string family_name, ColumnType &&column_qualifier, std::int64_t timestamp, ValueType &&value)
 Create a cell and fill it with data, but with empty labels. More...
 
RowKeyType const & row_key () const
 Return the row key this cell belongs to. More...
 
std::string const & family_name () const
 Return the family this cell belongs to. More...
 
ColumnQualifierType const & column_qualifier () const
 Return the column this cell belongs to. More...
 
std::chrono::microseconds timestamp () const
 Return the timestamp of this cell. More...
 
CellValueType const & value () const &
 Return the contents of this cell. More...
 
CellValueType && value () &&
 Return the contents of this cell. More...
 
template<typename T >
StatusOr< T > decode_big_endian_integer () const
 Interpret the value as a big-endian encoded T and return it. More...
 
std::vector< std::string > const & labels () const
 Return the labels applied to this cell by label transformer read filters. More...
 

Friends

Mutation SetCell (Cell)
 Create a mutation to set a cell value based on a bigtable::Cell. More...
 

Detailed Description

The in-memory representation of a Bigtable cell.

Bigtable stores data in rows, indexes by row keys. Each row may contain multiple column families, each column family might contain multiple columns, and each column has multiple cells indexed by timestamp. Notice that the storage is sparse, column families, columns, and timestamps might contain zero cells.

The Cell class owns all its data.

Definition at line 90 of file cell.h.

Constructor & Destructor Documentation

◆ Cell() [1/3]

template<typename KeyType , typename ColumnType , typename ValueType , typename std::enable_if<!std::is_integral< ValueType >::value, int >::type = 0>
google::cloud::bigtable::v1::Cell::Cell ( KeyType &&  row_key,
std::string  family_name,
ColumnType &&  column_qualifier,
std::int64_t  timestamp,
ValueType &&  value,
std::vector< std::string >  labels 
)
inline

Create a Cell and fill it with data.

Definition at line 100 of file cell.h.

◆ Cell() [2/3]

template<typename KeyType , typename ColumnType >
google::cloud::bigtable::v1::Cell::Cell ( KeyType &&  row_key,
std::string  family_name,
ColumnType &&  column_qualifier,
std::int64_t  timestamp,
std::int64_t  value,
std::vector< std::string >  labels 
)
inline

Create a Cell and fill it with a 64-bit value encoded as big endian.

Definition at line 112 of file cell.h.

◆ Cell() [3/3]

template<typename KeyType , typename ColumnType , typename ValueType >
google::cloud::bigtable::v1::Cell::Cell ( KeyType &&  row_key,
std::string  family_name,
ColumnType &&  column_qualifier,
std::int64_t  timestamp,
ValueType &&  value 
)
inline

Create a cell and fill it with data, but with empty labels.

Definition at line 122 of file cell.h.

Member Function Documentation

◆ column_qualifier()

ColumnQualifierType const& google::cloud::bigtable::v1::Cell::column_qualifier ( ) const
inline

Return the column this cell belongs to.

The returned value is not valid after this object is deleted.

Definition at line 138 of file cell.h.

◆ decode_big_endian_integer()

template<typename T >
StatusOr<T> google::cloud::bigtable::v1::Cell::decode_big_endian_integer ( ) const
inline

Interpret the value as a big-endian encoded T and return it.

Google Cloud Bigtable stores arbitrary blobs in each cell. Some applications interpret these blobs as strings, other as encoded protos, and sometimes as big-endian integers. This is a helper function to convert the blob into a T value.

Definition at line 162 of file cell.h.

◆ family_name()

std::string const& google::cloud::bigtable::v1::Cell::family_name ( ) const
inline

Return the family this cell belongs to.

The returned value is not valid after this object is deleted.

Definition at line 134 of file cell.h.

◆ labels()

std::vector<std::string> const& google::cloud::bigtable::v1::Cell::labels ( ) const
inline

Return the labels applied to this cell by label transformer read filters.

Definition at line 167 of file cell.h.

◆ row_key()

RowKeyType const& google::cloud::bigtable::v1::Cell::row_key ( ) const
inline

Return the row key this cell belongs to.

The returned value is not valid after this object is deleted.

Definition at line 130 of file cell.h.

◆ timestamp()

std::chrono::microseconds google::cloud::bigtable::v1::Cell::timestamp ( ) const
inline

Return the timestamp of this cell.

Definition at line 143 of file cell.h.

◆ value() [1/2]

CellValueType&& google::cloud::bigtable::v1::Cell::value ( ) &&
inline

Return the contents of this cell.

Definition at line 151 of file cell.h.

◆ value() [2/2]

CellValueType const& google::cloud::bigtable::v1::Cell::value ( ) const &
inline

Return the contents of this cell.

The returned value is not valid after this object is deleted.

Definition at line 149 of file cell.h.

Friends And Related Function Documentation

◆ SetCell

Mutation SetCell ( Cell  cell)
friend

Create a mutation to set a cell value based on a bigtable::Cell.

These mutations are not idempotent and not retried by default.

Definition at line 35 of file mutations.cc.