Class GcRule
- All Implemented Interfaces:
Serializable
This is the sink's own value type rather than the client's GCRules.GCRule because it
travels in the job graph: TableCreateOptions is serialized into the sink's configuration,
and the client's rule models are not Serializable. The translation happens where the
table is created.
A family declared without a rule keeps Bigtable's default of collecting nothing, which for
this sink is a decision, not an omission: the sink is at-least-once, a replay writes the same
cells again, and the garbage-collection policy is what decides whether those duplicate versions
accumulate forever. union(maxVersions(1), maxAge(...)) is the usual shape for keeping
only the latest cell.
Validation is shape-only (positivity, arity); nesting depth and any service-side limits are left to Bigtable, whose rejection names what it refused. Instances are immutable.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe rule shapes Bigtable's admin API takes. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetKind()Returns the rule's shape, deciding which of the other accessors is non-null.Returns the age cap of aGcRule.Kind.MAX_AGErule, ornullfor other kinds.Returns the version cap of aGcRule.Kind.MAX_VERSIONSrule, ornullfor other kinds.getRules()Returns the nested rules of aGcRule.Kind.UNIONorGcRule.Kind.INTERSECTIONrule, ornullfor the leaf kinds.inthashCode()static GcRuleintersection(GcRule... rules) A rule collecting only cells every one of the given rules would collect.static GcRuleA rule collecting cells older thanmaxAge.static GcRulemaxVersions(int maxVersions) A rule collecting all but the newestmaxVersionsversions of a cell.toString()static GcRuleA rule collecting cells any of the given rules would collect.
-
Method Details
-
maxVersions
A rule collecting all but the newestmaxVersionsversions of a cell.- Parameters:
maxVersions- the number of versions to keep, positive- Returns:
- the rule
-
maxAge
A rule collecting cells older thanmaxAge.- Parameters:
maxAge- the age past which cells are collected, positive- Returns:
- the rule
-
union
A rule collecting cells any of the given rules would collect.- Parameters:
rules- the rules to union, at least two- Returns:
- the rule
-
intersection
A rule collecting only cells every one of the given rules would collect.- Parameters:
rules- the rules to intersect, at least two- Returns:
- the rule
-
getKind
Returns the rule's shape, deciding which of the other accessors is non-null. -
getMaxVersions
Returns the version cap of aGcRule.Kind.MAX_VERSIONSrule, ornullfor other kinds. -
getMaxAge
Returns the age cap of aGcRule.Kind.MAX_AGErule, ornullfor other kinds. -
getRules
Returns the nested rules of aGcRule.Kind.UNIONorGcRule.Kind.INTERSECTIONrule, ornullfor the leaf kinds. -
equals
-
hashCode
public int hashCode() -
toString
-