Google Cloud Bigtable C++ Client 2.13.0
A C++ Client Library for Google Cloud Bigtable
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
google::cloud::bigtable::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 &&)=default
 
GcRuleoperator= (GcRule &&)=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...
 

Friends

bool operator== (GcRule const &a, GcRule const &b) noexcept
 
bool operator!= (GcRule const &a, GcRule const &b) noexcept
 

Detailed Description

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

Provides functions to create GcRules in a convenient form.

Constructor & Destructor Documentation

◆ GcRule() [1/2]

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

◆ GcRule() [2/2]

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

Member Function Documentation

◆ as_proto() [1/2]

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

Move the internal proto out.

◆ as_proto() [2/2]

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

Convert to the proto form.

◆ Intersection()

template<typename... GcRuleTypes>
static GcRule google::cloud::bigtable::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.

◆ MaxAge()

template<typename Rep , typename Period >
static GcRule google::cloud::bigtable::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));
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.
Definition: column_family.h:73
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.

◆ MaxNumVersions()

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

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ Union()

template<typename... GcRuleTypes>
static GcRule google::cloud::bigtable::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.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( GcRule const &  a,
GcRule const &  b 
)
friend

◆ operator==

bool operator== ( GcRule const &  a,
GcRule const &  b 
)
friend