Google Cloud Bigtable C++ Client  0.11.0
A C++ Client Library for Google Cloud Bigtable
Public Member Functions | Static Public Member Functions | List of all members
google::cloud::bigtable::v0::GcRule Class Reference

Implement a thin wrapper around google::bigtable::admin::v2::GcRule. More...

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

Public Member Functions

google::bigtable::admin::v2::GcRule const & as_proto () const &
 Convert to the proto form. More...
 
google::bigtable::admin::v2::GcRule && as_proto () &&
 Move the internal proto out. More...
 
Use default constructors and assignments.
 GcRule (GcRule &&) noexcept=default
 
GcRuleoperator= (GcRule &&) noexcept=default
 
 GcRule (GcRule const &)=default
 
GcRuleoperator= (GcRule const &)=default
 

Static Public Member Functions

static GcRule MaxNumVersions (std::int32_t n)
 Create a garbage collection rule that keeps the last n versions. More...
 
template<typename Rep , typename Period >
static GcRule MaxAge (std::chrono::duration< Rep, Period > duration)
 Return a garbage collection rule that deletes cells in a column older than the given duration. More...
 
template<typename... GcRuleTypes>
static GcRule Intersection (GcRuleTypes &&... gc_rules)
 Return a GcRule that deletes cells if all the rules passed in would delete the cells. More...
 
template<typename... GcRuleTypes>
static GcRule Union (GcRuleTypes &&... gc_rules)
 Return a GcRule that deletes cells if any the rules passed in would delete the cells. More...
 

Detailed Description

Implement a thin wrapper around google::bigtable::admin::v2::GcRule.

Provides functions to create GcRules in a convenient form.

Definition at line 34 of file column_family.h.

Constructor & Destructor Documentation

◆ GcRule() [1/2]

google::cloud::bigtable::v0::GcRule::GcRule ( GcRule &&  )
defaultnoexcept

◆ GcRule() [2/2]

google::cloud::bigtable::v0::GcRule::GcRule ( GcRule const &  )
default

Member Function Documentation

◆ as_proto() [1/2]

google::bigtable::admin::v2::GcRule const& google::cloud::bigtable::v0::GcRule::as_proto ( ) const &
inline

Convert to the proto form.

Definition at line 135 of file column_family.h.

◆ as_proto() [2/2]

google::bigtable::admin::v2::GcRule&& google::cloud::bigtable::v0::GcRule::as_proto ( ) &&
inline

Move the internal proto out.

Definition at line 140 of file column_family.h.

◆ Intersection()

template<typename... GcRuleTypes>
static GcRule google::cloud::bigtable::v0::GcRule::Intersection ( GcRuleTypes &&...  gc_rules)
inlinestatic

Return a GcRule that deletes cells if all the rules passed in would delete the cells.

Template Parameters
GcRuleTypesthe type of the GC rule arguments. They must all be convertible to GcRule.
Parameters
gc_rulesthe set of GC rules.

Definition at line 92 of file column_family.h.

◆ MaxAge()

template<typename Rep , typename Period >
static GcRule google::cloud::bigtable::v0::GcRule::MaxAge ( std::chrono::duration< Rep, Period >  duration)
inlinestatic

Return a garbage collection rule that deletes cells in a column older than the given duration.

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

auto rule1 = bigtable::GcRule::MaxAge(std::chrono::hours(48));
auto rule2 = bigtable::GcRule::MaxAge(std::chrono::seconds(48 * 3600));
Template Parameters
Repa placeholder to match the Rep tparam for duration 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.
Perioda placeholder to match the Period tparam for duration 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.
See also
std::chrono::duration<> for more details.

Definition at line 71 of file column_family.h.

◆ MaxNumVersions()

static GcRule google::cloud::bigtable::v0::GcRule::MaxNumVersions ( std::int32_t  n)
inlinestatic

Create a garbage collection rule that keeps the last n versions.

Definition at line 37 of file column_family.h.

◆ operator=() [1/2]

GcRule& google::cloud::bigtable::v0::GcRule::operator= ( GcRule &&  )
defaultnoexcept

◆ operator=() [2/2]

GcRule& google::cloud::bigtable::v0::GcRule::operator= ( GcRule const &  )
default

◆ Union()

template<typename... GcRuleTypes>
static GcRule google::cloud::bigtable::v0::GcRule::Union ( GcRuleTypes &&...  gc_rules)
inlinestatic

Return a GcRule that deletes cells if any the rules passed in would delete the cells.

Template Parameters
GcRuleTypesthe type of the GC rule arguments. They must all be convertible to GcRule.
Parameters
gc_rulesthe set of GC rules.

Definition at line 118 of file column_family.h.