Class ReadRequest.Builder (6.74.0)

public static final class ReadRequest.Builder extends GeneratedMessageV3.Builder<ReadRequest.Builder> implements ReadRequestOrBuilder

The request for Read and StreamingRead.

Protobuf type google.spanner.v1.ReadRequest

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllColumns(Iterable<String> values)

public ReadRequest.Builder addAllColumns(Iterable<String> values)

Required. The columns of table to be returned for each row matching this request.

repeated string columns = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
values Iterable<String>

The columns to add.

Returns
Type Description
ReadRequest.Builder

This builder for chaining.

addColumns(String value)

public ReadRequest.Builder addColumns(String value)

Required. The columns of table to be returned for each row matching this request.

repeated string columns = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value String

The columns to add.

Returns
Type Description
ReadRequest.Builder

This builder for chaining.

addColumnsBytes(ByteString value)

public ReadRequest.Builder addColumnsBytes(ByteString value)

Required. The columns of table to be returned for each row matching this request.

repeated string columns = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value ByteString

The bytes of the columns to add.

Returns
Type Description
ReadRequest.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public ReadRequest.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
ReadRequest.Builder
Overrides

build()

public ReadRequest build()
Returns
Type Description
ReadRequest

buildPartial()

public ReadRequest buildPartial()
Returns
Type Description
ReadRequest

clear()

public ReadRequest.Builder clear()
Returns
Type Description
ReadRequest.Builder
Overrides

clearColumns()

public ReadRequest.Builder clearColumns()

Required. The columns of table to be returned for each row matching this request.

repeated string columns = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ReadRequest.Builder

This builder for chaining.

clearDataBoostEnabled()

public ReadRequest.Builder clearDataBoostEnabled()

If this is for a partitioned read and this field is set to true, the request is executed with Spanner Data Boost independent compute resources.

If the field is set to true but the request does not set partition_token, the API returns an INVALID_ARGUMENT error.

bool data_boost_enabled = 15;

Returns
Type Description
ReadRequest.Builder

This builder for chaining.

clearDirectedReadOptions()

public ReadRequest.Builder clearDirectedReadOptions()

Directed read options for this request.

.google.spanner.v1.DirectedReadOptions directed_read_options = 14;

Returns
Type Description
ReadRequest.Builder

clearField(Descriptors.FieldDescriptor field)

public ReadRequest.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
ReadRequest.Builder
Overrides

clearIndex()

public ReadRequest.Builder clearIndex()

If non-empty, the name of an index on table. This index is used instead of the table primary key when interpreting key_set and sorting result rows. See key_set for further information.

string index = 4;

Returns
Type Description
ReadRequest.Builder

This builder for chaining.

clearKeySet()

public ReadRequest.Builder clearKeySet()

Required. key_set identifies the rows to be yielded. key_set names the primary keys of the rows in table to be yielded, unless index is present. If index is present, then key_set instead names index keys in index.

If the partition_token field is empty, rows are yielded in table primary key order (if index is empty) or index key order (if index is non-empty). If the partition_token field is not empty, rows will be yielded in an unspecified order.

It is not an error for the key_set to name rows that do not exist in the database. Read yields nothing for nonexistent rows.

.google.spanner.v1.KeySet key_set = 6 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description