Google Cloud Bigtable C++ Client  1.34.0
A C++ Client Library for Google Cloud Bigtable
Classes | Namespaces | Functions
mutations.h File Reference
#include "google/cloud/bigtable/cell.h"
#include "google/cloud/bigtable/row_key.h"
#include "google/cloud/bigtable/version.h"
#include "google/cloud/grpc_error_delegate.h"
#include "google/cloud/internal/big_endian.h"
#include "google/cloud/status.h"
#include "google/cloud/status_or.h"
#include "absl/meta/type_traits.h"
#include <google/bigtable/v2/bigtable.pb.h>
#include <google/bigtable/v2/data.pb.h>
#include <grpcpp/grpcpp.h>
#include <chrono>
#include <string>
#include <type_traits>
#include <vector>

Go to the source code of this file.

Classes

struct  google::cloud::bigtable::Mutation
 Represent a single change to a specific row in a Table. More...
 
class  google::cloud::bigtable::SingleRowMutation
 Represent a single row mutation. More...
 
class  google::cloud::bigtable::FailedMutation
 A SingleRowMutation that failed. More...
 
class  google::cloud::bigtable::PermanentMutationFailure
 Report unrecoverable errors in a partially completed mutation. More...
 
class  google::cloud::bigtable::BulkMutation
 Represent a set of mutations across multiple rows. More...
 

Namespaces

 google
 
 google::cloud
 
 google::cloud::bigtable
 Contains all the Cloud Bigtable C++ client APIs.
 

Functions

constexpr std::int64_t google::cloud::bigtable::ServerSetTimestamp ()
 A magic value where the server sets the timestamp. More...
 
template<typename ColumnType , typename ValueType >
Mutation google::cloud::bigtable::SetCell (std::string family, ColumnType &&column, std::chrono::milliseconds timestamp, ValueType &&value)
 Create a mutation to set a cell value. More...
 
template<typename ColumnType >
Mutation google::cloud::bigtable::SetCell (std::string family, ColumnType &&column, std::chrono::milliseconds timestamp, std::int64_t value)
 Create a mutation to store a 64-bit big endian integer value. More...
 
template<typename ColumnType , typename ValueType >
Mutation google::cloud::bigtable::SetCell (std::string family, ColumnType &&column, ValueType &&value)
 Create a mutation to set a cell value where the server sets the time. More...
 
template<typename ColumnType >
Mutation google::cloud::bigtable::SetCell (std::string family, ColumnType &&column, std::int64_t value)
 Create a mutation to store a 64-bit big endian integer value. More...
 
Mutation google::cloud::bigtable::SetCell (Cell cell)
 Create a mutation to set a cell value based on a bigtable::Cell. More...
 
Create mutations to delete a range of cells from a column.

The following functions create a mutation that deletes all the cells in the given column family and, column within the given timestamp in the range.

The function accepts any instantiation of std::chrono::duration<> for the timestamp_begin and timestamp_end parameters. For example:

using namespace std::chrono_literals; // C++14
bigtable::DeleteFromColumn("fam", "col", 0us, 10us)
Mutation DeleteFromColumn(std::string family, ColumnType &&column, std::chrono::duration< Rep1, Period1 > timestamp_begin, std::chrono::duration< Rep2, Period2 > timestamp_end)
Definition: mutations.h:168

The ending timestamp is exclusive, while the beginning timestamp is inclusive. That is, the interval is [timestamp_begin, timestamp_end). The value 0 is special and treated as "unbounded" for both the begin and end endpoints of the time range. The Cloud Bigtable server rejects invalid and empty ranges, i.e., any range where the endpoint is smaller or equal than to the initial endpoint unless either endpoint is 0.

Template Parameters
Rep1a placeholder to match the Rep tparam for timestamp_begin type. The semantics of this template parameter are documented in std::chrono::duration<>` (in brief, the underlying arithmetic type used to store the number of ticks), for our purposes it is simply a formal parameter.
Rep2similar formal parameter for the type of timestamp_end.
Period1a placeholder to match the Period tparam for timestamp_begin type. The semantics of this template parameter are documented in std::chrono::duration<> (in brief, the length of the tick in seconds,vexpressed as a std::ratio<>), for our purposes it is simply a formal parameter.
Period2similar formal parameter for the type of timestamp_end.
ColumnTypethe type of the column qualifier. It should satisfy std::is_constructible<ColumnQualifierType, ColumnType>.
template<typename Rep1 , typename Period1 , typename Rep2 , typename Period2 , typename ColumnType >
Mutation google::cloud::bigtable::DeleteFromColumn (std::string family, ColumnType &&column, std::chrono::duration< Rep1, Period1 > timestamp_begin, std::chrono::duration< Rep2, Period2 > timestamp_end)
 
The following functions create a mutation that deletes all the

cells in the given column family and column, Delete up to timestamp_end, but excluding, timestamp_end.

The function accepts any instantiation of std::chrono::duration<> for the timestamp_end For example:

using namespace std::chrono_literals; // C++14
bigtable::DeleteFromColumn("fam", "col", 10us)
Template Parameters
Rep2a placeholder to match the Rep tparam for timestamp_end type. The semantics of this template parameter are documented in std::chrono::duration<> (in brief, the underlying arithmetic type used to store the number of ticks), for our purposes it is simply a formal parameter.
Period2a placeholder to match the Period tparam for timestamp_end type. The semantics of this template parameter are documented in std::chrono::duration<> (in brief, the length of the tick in seconds, expressed as a std::ratio<>), for our purposes it is simply a formal parameter.
ColumnTypethe type of the column qualifier. It should satisfy std::is_constructible<ColumnQualifierType, ColumnType>.
template<typename Rep1 , typename Period1 , typename ColumnType >
Mutation google::cloud::bigtable::DeleteFromColumnStartingFrom (std::string family, ColumnType &&column, std::chrono::duration< Rep1, Period1 > timestamp_begin)
 Delete all the values for the column. More...
 
template<typename Rep2 , typename Period2 , typename ColumnType >
Mutation google::cloud::bigtable::DeleteFromColumnEndingAt (std::string family, ColumnType &&column, std::chrono::duration< Rep2, Period2 > timestamp_end)
 Delete all the values for the column. More...
 
template<typename ColumnType >
Mutation google::cloud::bigtable::DeleteFromColumn (std::string family, ColumnType &&column)
 Delete all the values for the column. More...
 
Mutation google::cloud::bigtable::DeleteFromFamily (std::string family)
 Create a mutation to delete all the cells in a column family. More...
 
Mutation google::cloud::bigtable::DeleteFromRow ()
 Create a mutation to delete all the cells in a row. More...