Class ReadRequest

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessageV3
com.google.spanner.v1.ReadRequest
All Implemented Interfaces:
com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, ReadRequestOrBuilder, Serializable

public final class ReadRequest extends com.google.protobuf.GeneratedMessageV3 implements ReadRequestOrBuilder
 The request for [Read][google.spanner.v1.Spanner.Read] and
 [StreamingRead][google.spanner.v1.Spanner.StreamingRead].
 
Protobuf type google.spanner.v1.ReadRequest
See Also:
  • Field Details

    • SESSION_FIELD_NUMBER

      public static final int SESSION_FIELD_NUMBER
      See Also:
    • TRANSACTION_FIELD_NUMBER

      public static final int TRANSACTION_FIELD_NUMBER
      See Also:
    • TABLE_FIELD_NUMBER

      public static final int TABLE_FIELD_NUMBER
      See Also:
    • INDEX_FIELD_NUMBER

      public static final int INDEX_FIELD_NUMBER
      See Also:
    • COLUMNS_FIELD_NUMBER

      public static final int COLUMNS_FIELD_NUMBER
      See Also:
    • KEY_SET_FIELD_NUMBER

      public static final int KEY_SET_FIELD_NUMBER
      See Also:
    • LIMIT_FIELD_NUMBER

      public static final int LIMIT_FIELD_NUMBER
      See Also:
    • RESUME_TOKEN_FIELD_NUMBER

      public static final int RESUME_TOKEN_FIELD_NUMBER
      See Also:
    • PARTITION_TOKEN_FIELD_NUMBER

      public static final int PARTITION_TOKEN_FIELD_NUMBER
      See Also:
    • REQUEST_OPTIONS_FIELD_NUMBER

      public static final int REQUEST_OPTIONS_FIELD_NUMBER
      See Also:
    • DIRECTED_READ_OPTIONS_FIELD_NUMBER

      public static final int DIRECTED_READ_OPTIONS_FIELD_NUMBER
      See Also:
    • DATA_BOOST_ENABLED_FIELD_NUMBER

      public static final int DATA_BOOST_ENABLED_FIELD_NUMBER
      See Also:
  • Method Details

    • newInstance

      protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
      Overrides:
      newInstance in class com.google.protobuf.GeneratedMessageV3
    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
    • getSession

      public String getSession()
       Required. The session in which the read should be performed.
       
      string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
      Specified by:
      getSession in interface ReadRequestOrBuilder
      Returns:
      The session.
    • getSessionBytes

      public com.google.protobuf.ByteString getSessionBytes()
       Required. The session in which the read should be performed.
       
      string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
      Specified by:
      getSessionBytes in interface ReadRequestOrBuilder
      Returns:
      The bytes for session.
    • hasTransaction

      public boolean hasTransaction()
       The transaction to use. If none is provided, the default is a
       temporary read-only transaction with strong concurrency.
       
      .google.spanner.v1.TransactionSelector transaction = 2;
      Specified by:
      hasTransaction in interface ReadRequestOrBuilder
      Returns:
      Whether the transaction field is set.
    • getTransaction

      public TransactionSelector getTransaction()
       The transaction to use. If none is provided, the default is a
       temporary read-only transaction with strong concurrency.
       
      .google.spanner.v1.TransactionSelector transaction = 2;
      Specified by:
      getTransaction in interface ReadRequestOrBuilder
      Returns:
      The transaction.
    • getTransactionOrBuilder

      public TransactionSelectorOrBuilder getTransactionOrBuilder()
       The transaction to use. If none is provided, the default is a
       temporary read-only transaction with strong concurrency.
       
      .google.spanner.v1.TransactionSelector transaction = 2;
      Specified by:
      getTransactionOrBuilder in interface ReadRequestOrBuilder
    • getTable

      public String getTable()
       Required. The name of the table in the database to be read.
       
      string table = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getTable in interface ReadRequestOrBuilder
      Returns:
      The table.
    • getTableBytes

      public com.google.protobuf.ByteString getTableBytes()
       Required. The name of the table in the database to be read.
       
      string table = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getTableBytes in interface ReadRequestOrBuilder
      Returns:
      The bytes for table.
    • getIndex

      public String getIndex()
       If non-empty, the name of an index on
       [table][google.spanner.v1.ReadRequest.table]. This index is used instead of
       the table primary key when interpreting
       [key_set][google.spanner.v1.ReadRequest.key_set] and sorting result rows.
       See [key_set][google.spanner.v1.ReadRequest.key_set] for further
       information.
       
      string index = 4;
      Specified by:
      getIndex in interface ReadRequestOrBuilder
      Returns:
      The index.
    • getIndexBytes

      public com.google.protobuf.ByteString getIndexBytes()
       If non-empty, the name of an index on
       [table][google.spanner.v1.ReadRequest.table]. This index is used instead of
       the table primary key when interpreting
       [key_set][google.spanner.v1.ReadRequest.key_set] and sorting result rows.
       See [key_set][google.spanner.v1.ReadRequest.key_set] for further
       information.
       
      string index = 4;
      Specified by:
      getIndexBytes in interface ReadRequestOrBuilder
      Returns:
      The bytes for index.
    • getColumnsList

      public com.google.protobuf.ProtocolStringList getColumnsList()
       Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be
       returned for each row matching this request.
       
      repeated string columns = 5 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getColumnsList in interface ReadRequestOrBuilder
      Returns:
      A list containing the columns.
    • getColumnsCount

      public int getColumnsCount()
       Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be
       returned for each row matching this request.
       
      repeated string columns = 5 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getColumnsCount in interface ReadRequestOrBuilder
      Returns:
      The count of columns.
    • getColumns

      public String getColumns(int index)
       Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be
       returned for each row matching this request.
       
      repeated string columns = 5 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getColumns in interface ReadRequestOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The columns at the given index.
    • getColumnsBytes

      public com.google.protobuf.ByteString getColumnsBytes(int index)
       Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be
       returned for each row matching this request.
       
      repeated string columns = 5 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getColumnsBytes in interface ReadRequestOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the columns at the given index.
    • hasKeySet

      public boolean hasKeySet()
       Required. `key_set` identifies the rows to be yielded. `key_set` names the
       primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to
       be yielded, unless [index][google.spanner.v1.ReadRequest.index] is present.
       If [index][google.spanner.v1.ReadRequest.index] is present, then
       [key_set][google.spanner.v1.ReadRequest.key_set] instead names index keys
       in [index][google.spanner.v1.ReadRequest.index].
      
       If the [partition_token][google.spanner.v1.ReadRequest.partition_token]
       field is empty, rows are yielded in table primary key order (if
       [index][google.spanner.v1.ReadRequest.index] is empty) or index key order
       (if [index][google.spanner.v1.ReadRequest.index] is non-empty).  If the
       [partition_token][google.spanner.v1.ReadRequest.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];
      Specified by:
      hasKeySet in interface ReadRequestOrBuilder
      Returns:
      Whether the keySet field is set.
    • getKeySet

      public KeySet getKeySet()
       Required. `key_set` identifies the rows to be yielded. `key_set` names the
       primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to
       be yielded, unless [index][google.spanner.v1.ReadRequest.index] is present.
       If [index][google.spanner.v1.ReadRequest.index] is present, then
       [key_set][google.spanner.v1.ReadRequest.key_set] instead names index keys
       in [index][google.spanner.v1.ReadRequest.index].
      
       If the [partition_token][google.spanner.v1.ReadRequest.partition_token]
       field is empty, rows are yielded in table primary key order (if
       [index][google.spanner.v1.ReadRequest.index] is empty) or index key order
       (if [index][google.spanner.v1.ReadRequest.index] is non-empty).  If the
       [partition_token][google.spanner.v1.ReadRequest.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];
      Specified by:
      getKeySet in interface ReadRequestOrBuilder
      Returns:
      The keySet.
    • getKeySetOrBuilder

      public KeySetOrBuilder getKeySetOrBuilder()
       Required. `key_set` identifies the rows to be yielded. `key_set` names the
       primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to
       be yielded, unless [index][google.spanner.v1.ReadRequest.index] is present.
       If [index][google.spanner.v1.ReadRequest.index] is present, then
       [key_set][google.spanner.v1.ReadRequest.key_set] instead names index keys
       in [index][google.spanner.v1.ReadRequest.index].
      
       If the [partition_token][google.spanner.v1.ReadRequest.partition_token]
       field is empty, rows are yielded in table primary key order (if
       [index][google.spanner.v1.ReadRequest.index] is empty) or index key order
       (if [index][google.spanner.v1.ReadRequest.index] is non-empty).  If the
       [partition_token][google.spanner.v1.ReadRequest.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];
      Specified by:
      getKeySetOrBuilder in interface ReadRequestOrBuilder
    • getLimit

      public long getLimit()
       If greater than zero, only the first `limit` rows are yielded. If `limit`
       is zero, the default is no limit. A limit cannot be specified if
       `partition_token` is set.
       
      int64 limit = 8;
      Specified by:
      getLimit in interface ReadRequestOrBuilder
      Returns:
      The limit.
    • getResumeToken

      public com.google.protobuf.ByteString getResumeToken()
       If this request is resuming a previously interrupted read,
       `resume_token` should be copied from the last
       [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the
       interruption. Doing this enables the new read to resume where the last read
       left off. The rest of the request parameters must exactly match the request
       that yielded this token.
       
      bytes resume_token = 9;
      Specified by:
      getResumeToken in interface ReadRequestOrBuilder
      Returns:
      The resumeToken.
    • getPartitionToken

      public com.google.protobuf.ByteString getPartitionToken()
       If present, results will be restricted to the specified partition
       previously created using PartitionRead().    There must be an exact
       match for the values of fields common to this message and the
       PartitionReadRequest message used to create this partition_token.
       
      bytes partition_token = 10;
      Specified by:
      getPartitionToken in interface ReadRequestOrBuilder
      Returns:
      The partitionToken.
    • hasRequestOptions

      public boolean hasRequestOptions()
       Common options for this request.
       
      .google.spanner.v1.RequestOptions request_options = 11;
      Specified by:
      hasRequestOptions in interface ReadRequestOrBuilder
      Returns:
      Whether the requestOptions field is set.
    • getRequestOptions

      public RequestOptions getRequestOptions()
       Common options for this request.
       
      .google.spanner.v1.RequestOptions request_options = 11;
      Specified by:
      getRequestOptions in interface ReadRequestOrBuilder
      Returns:
      The requestOptions.
    • getRequestOptionsOrBuilder

      public RequestOptionsOrBuilder getRequestOptionsOrBuilder()
       Common options for this request.
       
      .google.spanner.v1.RequestOptions request_options = 11;
      Specified by:
      getRequestOptionsOrBuilder in interface ReadRequestOrBuilder
    • hasDirectedReadOptions

      public boolean hasDirectedReadOptions()
       Directed read options for this request.
       
      .google.spanner.v1.DirectedReadOptions directed_read_options = 14;
      Specified by:
      hasDirectedReadOptions in interface ReadRequestOrBuilder
      Returns:
      Whether the directedReadOptions field is set.
    • getDirectedReadOptions

      public DirectedReadOptions getDirectedReadOptions()
       Directed read options for this request.
       
      .google.spanner.v1.DirectedReadOptions directed_read_options = 14;
      Specified by:
      getDirectedReadOptions in interface ReadRequestOrBuilder
      Returns:
      The directedReadOptions.
    • getDirectedReadOptionsOrBuilder

      public DirectedReadOptionsOrBuilder getDirectedReadOptionsOrBuilder()
       Directed read options for this request.
       
      .google.spanner.v1.DirectedReadOptions directed_read_options = 14;
      Specified by:
      getDirectedReadOptionsOrBuilder in interface ReadRequestOrBuilder
    • getDataBoostEnabled

      public boolean getDataBoostEnabled()
       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;
      Specified by:
      getDataBoostEnabled in interface ReadRequestOrBuilder
      Returns:
      The dataBoostEnabled.
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessageV3
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessageV3
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.google.protobuf.AbstractMessage
    • parseFrom

      public static ReadRequest parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static ReadRequest parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static ReadRequest parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static ReadRequest parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static ReadRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static ReadRequest parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static ReadRequest parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static ReadRequest parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static ReadRequest parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static ReadRequest parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static ReadRequest parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static ReadRequest parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilderForType

      public ReadRequest.Builder newBuilderForType()
      Specified by:
      newBuilderForType in interface com.google.protobuf.Message
      Specified by:
      newBuilderForType in interface com.google.protobuf.MessageLite
    • newBuilder

      public static ReadRequest.Builder newBuilder()
    • newBuilder

      public static ReadRequest.Builder newBuilder(ReadRequest prototype)
    • toBuilder

      public ReadRequest.Builder toBuilder()
      Specified by:
      toBuilder in interface com.google.protobuf.Message
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite
    • newBuilderForType

      protected ReadRequest.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
      Specified by:
      newBuilderForType in class com.google.protobuf.GeneratedMessageV3
    • getDefaultInstance

      public static ReadRequest getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<ReadRequest> parser()
    • getParserForType

      public com.google.protobuf.Parser<ReadRequest> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessageV3
    • getDefaultInstanceForType

      public ReadRequest getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder