google-cloud-bigtable - Class Google::Cloud::Bigtable::ReadModifyWriteRule (v2.6.5)

Reference documentation and code samples for the google-cloud-bigtable class Google::Cloud::Bigtable::ReadModifyWriteRule.

ReadModifyWriteRule

Specifies an atomic read/modify/write operation on the latest value of the specified column.

Inherits

  • Object

Examples

Append value rule

rule = Google::Cloud::Bigtable::ReadModifyWriteRule.append(
  "cf", "field01", "append-xyz"
)

increment value rule

rule = Google::Cloud::Bigtable::ReadModifyWriteRule.increment(
  "cf", "field01", 1
)

Methods

.append

def self.append(family, qualifier, value) -> Google::Cloud::Bigtable::ReadModifyWriteRule

Creates an instance of an append-value rule.

Parameters
  • family (String) — The name of the family to which the read/modify/write should be applied.
  • qualifier (String) — The qualifier of the column to which the read/modify/write should be applied.
  • value (String) — Rule specifying that append_value be appended to the existing value. If the targeted cell is unset, it will be treated as if it contains an empty string.
Example

Append value rule

rule = Google::Cloud::Bigtable::ReadModifyWriteRule.append(
  "cf", "field01", "append-xyz"
)

.increment

def self.increment(family, qualifier, amount) -> Google::Cloud::Bigtable::ReadModifyWriteRule

Creates an instance of an increment-amount rule.

Parameters
  • family (String) — The name of the family to which the read/modify/write should be applied.
  • qualifier (String) — The qualifier of the column to which the read/modify/write should be applied.
  • amount (String) — Rule specifying that increment_amount be added to the existing value. If the targeted cell is unset, it will be treated as if it contains a zero. Otherwise, the targeted cell must contain an 8-byte value (interpreted as a 64-bit big-endian signed integer), or the entire request will fail.
Example
rule = Google::Cloud::Bigtable::ReadModifyWriteRule.increment(
  "cf", "field01", 1
)

#append

def append(value) -> Google::Cloud::Bigtable::ReadModifyWriteRule

Sets the append value.

Parameter
  • value (String)

#increment

def increment(amount) -> Google::Cloud::Bigtable::ReadModifyWriteRule

Sets the increment amount.

Parameter
  • amount (Integer)