Google Cloud Bigtable C++ Client 2.13.0
A C++ Client Library for Google Cloud Bigtable
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
google::cloud::bigtable::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 >
 Cell (KeyType &&row_key, std::string family_name, ColumnType &&column_qualifier, std::int64_t timestamp, ValueType &&value, std::vector< std::string > labels)
 Creates 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.

Constructor & Destructor Documentation

◆ Cell() [1/3]

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

Creates a Cell and fill it with data.

This function does not participate in overload resolution if ValueType is not an integral type. The case for integral types is handled by a separate overload.

◆ Cell() [2/3]

template<typename KeyType , typename ColumnType >
google::cloud::bigtable::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.

◆ Cell() [3/3]

template<typename KeyType , typename ColumnType , typename ValueType >
google::cloud::bigtable::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.

Member Function Documentation

◆ column_qualifier()

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

Return the column this cell belongs to.

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

◆ decode_big_endian_integer()

template<typename T >
StatusOr< T > google::cloud::bigtable::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.

◆ family_name()

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

Return the family this cell belongs to.

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

◆ labels()

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

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

◆ row_key()

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

Return the row key this cell belongs to.

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

◆ timestamp()

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

Return the timestamp of this cell.

◆ value() [1/2]

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

Return the contents of this cell.

◆ value() [2/2]

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

Return the contents of this cell.

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

Friends And Related Function Documentation

◆ SetCell

Mutation SetCell ( 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.