class TransactionOptions_ReadOnly extends Message

Options for read-only transactions.

Protobuf type Google\Spanner\V1\TransactionOptions\ReadOnly

Properties

protected $timestamp_bound

Methods

__construct()

No description

bool
getStrong()

Read at a timestamp where all previously committed transactions are visible.

setStrong(bool $var)

Read at a timestamp where all previously committed transactions are visible.

getMinReadTimestamp()

Executes all reads at a timestamp >= min_read_timestamp.

setMinReadTimestamp(Timestamp $var)

Executes all reads at a timestamp >= min_read_timestamp.

getMaxStaleness()

Read data at a timestamp >= NOW - max_staleness seconds. Guarantees that all writes that have committed more than the specified number of seconds ago are visible. Because Cloud Spanner chooses the exact timestamp, this mode works even if the client's local clock is substantially skewed from Cloud Spanner commit timestamps.

setMaxStaleness(Duration $var)

Read data at a timestamp >= NOW - max_staleness seconds. Guarantees that all writes that have committed more than the specified number of seconds ago are visible. Because Cloud Spanner chooses the exact timestamp, this mode works even if the client's local clock is substantially skewed from Cloud Spanner commit timestamps.

getReadTimestamp()

Executes all reads at the given timestamp. Unlike other modes, reads at a specific timestamp are repeatable; the same read at the same timestamp always returns the same data. If the timestamp is in the future, the read will block until the specified timestamp, modulo the read's deadline.

setReadTimestamp(Timestamp $var)

Executes all reads at the given timestamp. Unlike other modes, reads at a specific timestamp are repeatable; the same read at the same timestamp always returns the same data. If the timestamp is in the future, the read will block until the specified timestamp, modulo the read's deadline.

getExactStaleness()

Executes all reads at a timestamp that is exact_staleness old. The timestamp is chosen soon after the read is started.

setExactStaleness(Duration $var)

Executes all reads at a timestamp that is exact_staleness old. The timestamp is chosen soon after the read is started.

bool
getReturnReadTimestamp()

If true, the Cloud Spanner-selected read timestamp is included in the [Transaction][google.spanner.v1.Transaction] message that describes the transaction.

setReturnReadTimestamp(bool $var)

If true, the Cloud Spanner-selected read timestamp is included in the [Transaction][google.spanner.v1.Transaction] message that describes the transaction.

string
getTimestampBound()

No description

Details

at line 27
__construct()

at line 39
bool getStrong()

Read at a timestamp where all previously committed transactions are visible.

Generated from protobuf field bool strong = 1;

Return Value

bool

at line 51
setStrong(bool $var)

Read at a timestamp where all previously committed transactions are visible.

Generated from protobuf field bool strong = 1;

Parameters

bool $var

at line 67
Timestamp getMinReadTimestamp()

Executes all reads at a timestamp >= min_read_timestamp.

This is useful for requesting fresher data than some previous read, or data that is fresh enough to observe the effects of some previously committed transaction whose timestamp is known. Note that this option can only be used in single-use transactions.

Generated from protobuf field .google.protobuf.Timestamp min_read_timestamp = 2;

Return Value

Timestamp

at line 82
setMinReadTimestamp(Timestamp $var)

Executes all reads at a timestamp >= min_read_timestamp.

This is useful for requesting fresher data than some previous read, or data that is fresh enough to observe the effects of some previously committed transaction whose timestamp is known. Note that this option can only be used in single-use transactions.

Generated from protobuf field .google.protobuf.Timestamp min_read_timestamp = 2;

Parameters

Timestamp $var

at line 104
Duration getMaxStaleness()

Read data at a timestamp >= NOW - max_staleness seconds. Guarantees that all writes that have committed more than the specified number of seconds ago are visible. Because Cloud Spanner chooses the exact timestamp, this mode works even if the client's local clock is substantially skewed from Cloud Spanner commit timestamps.

Useful for reading the freshest data available at a nearby replica, while bounding the possible staleness if the local replica has fallen behind. Note that this option can only be used in single-use transactions.

Generated from protobuf field .google.protobuf.Duration max_staleness = 3;

Return Value

Duration

at line 125
setMaxStaleness(Duration $var)

Read data at a timestamp >= NOW - max_staleness seconds. Guarantees that all writes that have committed more than the specified number of seconds ago are visible. Because Cloud Spanner chooses the exact timestamp, this mode works even if the client's local clock is substantially skewed from Cloud Spanner commit timestamps.

Useful for reading the freshest data available at a nearby replica, while bounding the possible staleness if the local replica has fallen behind. Note that this option can only be used in single-use transactions.

Generated from protobuf field .google.protobuf.Duration max_staleness = 3;

Parameters

Duration $var

at line 144
Timestamp getReadTimestamp()

Executes all reads at the given timestamp. Unlike other modes, reads at a specific timestamp are repeatable; the same read at the same timestamp always returns the same data. If the timestamp is in the future, the read will block until the specified timestamp, modulo the read's deadline.

Useful for large scale consistent reads such as mapreduces, or for coordinating many reads against a consistent snapshot of the data.

Generated from protobuf field .google.protobuf.Timestamp read_timestamp = 4;

Return Value

Timestamp

at line 162
setReadTimestamp(Timestamp $var)

Executes all reads at the given timestamp. Unlike other modes, reads at a specific timestamp are repeatable; the same read at the same timestamp always returns the same data. If the timestamp is in the future, the read will block until the specified timestamp, modulo the read's deadline.

Useful for large scale consistent reads such as mapreduces, or for coordinating many reads against a consistent snapshot of the data.

Generated from protobuf field .google.protobuf.Timestamp read_timestamp = 4;

Parameters

Timestamp $var

at line 182
Duration getExactStaleness()

Executes all reads at a timestamp that is exact_staleness old. The timestamp is chosen soon after the read is started.

Guarantees that all writes that have committed more than the specified number of seconds ago are visible. Because Cloud Spanner chooses the exact timestamp, this mode works even if the client's local clock is substantially skewed from Cloud Spanner commit timestamps. Useful for reading at nearby replicas without the distributed timestamp negotiation overhead of max_staleness.

Generated from protobuf field .google.protobuf.Duration exact_staleness = 5;

Return Value

Duration

at line 201
setExactStaleness(Duration $var)

Executes all reads at a timestamp that is exact_staleness old. The timestamp is chosen soon after the read is started.

Guarantees that all writes that have committed more than the specified number of seconds ago are visible. Because Cloud Spanner chooses the exact timestamp, this mode works even if the client's local clock is substantially skewed from Cloud Spanner commit timestamps. Useful for reading at nearby replicas without the distributed timestamp negotiation overhead of max_staleness.

Generated from protobuf field .google.protobuf.Duration exact_staleness = 5;

Parameters

Duration $var

at line 214
bool getReturnReadTimestamp()

If true, the Cloud Spanner-selected read timestamp is included in the [Transaction][google.spanner.v1.Transaction] message that describes the transaction.

Generated from protobuf field bool return_read_timestamp = 6;

Return Value

bool

at line 226
setReturnReadTimestamp(bool $var)

If true, the Cloud Spanner-selected read timestamp is included in the [Transaction][google.spanner.v1.Transaction] message that describes the transaction.

Generated from protobuf field bool return_read_timestamp = 6;

Parameters

bool $var

at line 235
string getTimestampBound()

Return Value

string