Class TransactionOptions.ReadOnly

    • Field Detail

      • MIN_READ_TIMESTAMP_FIELD_NUMBER

        public static final int MIN_READ_TIMESTAMP_FIELD_NUMBER
        See Also:
        Constant Field Values
      • MAX_STALENESS_FIELD_NUMBER

        public static final int MAX_STALENESS_FIELD_NUMBER
        See Also:
        Constant Field Values
      • READ_TIMESTAMP_FIELD_NUMBER

        public static final int READ_TIMESTAMP_FIELD_NUMBER
        See Also:
        Constant Field Values
      • EXACT_STALENESS_FIELD_NUMBER

        public static final int EXACT_STALENESS_FIELD_NUMBER
        See Also:
        Constant Field Values
      • RETURN_READ_TIMESTAMP_FIELD_NUMBER

        public static final int RETURN_READ_TIMESTAMP_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • 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
      • hasStrong

        public boolean hasStrong()
         Read at a timestamp where all previously committed transactions
         are visible.
         
        bool strong = 1;
        Specified by:
        hasStrong in interface TransactionOptions.ReadOnlyOrBuilder
        Returns:
        Whether the strong field is set.
      • getStrong

        public boolean getStrong()
         Read at a timestamp where all previously committed transactions
         are visible.
         
        bool strong = 1;
        Specified by:
        getStrong in interface TransactionOptions.ReadOnlyOrBuilder
        Returns:
        The strong.
      • hasMinReadTimestamp

        public boolean hasMinReadTimestamp()
         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.
        
         A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds.
         Example: `"2014-10-02T15:01:23.045123456Z"`.
         
        .google.protobuf.Timestamp min_read_timestamp = 2;
        Specified by:
        hasMinReadTimestamp in interface TransactionOptions.ReadOnlyOrBuilder
        Returns:
        Whether the minReadTimestamp field is set.
      • getMinReadTimestamp

        public com.google.protobuf.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.
        
         A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds.
         Example: `"2014-10-02T15:01:23.045123456Z"`.
         
        .google.protobuf.Timestamp min_read_timestamp = 2;
        Specified by:
        getMinReadTimestamp in interface TransactionOptions.ReadOnlyOrBuilder
        Returns:
        The minReadTimestamp.
      • getMinReadTimestampOrBuilder

        public com.google.protobuf.TimestampOrBuilder getMinReadTimestampOrBuilder()
         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.
        
         A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds.
         Example: `"2014-10-02T15:01:23.045123456Z"`.
         
        .google.protobuf.Timestamp min_read_timestamp = 2;
        Specified by:
        getMinReadTimestampOrBuilder in interface TransactionOptions.ReadOnlyOrBuilder
      • hasMaxStaleness

        public boolean hasMaxStaleness()
         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.
         
        .google.protobuf.Duration max_staleness = 3;
        Specified by:
        hasMaxStaleness in interface TransactionOptions.ReadOnlyOrBuilder
        Returns:
        Whether the maxStaleness field is set.
      • getMaxStaleness

        public com.google.protobuf.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.
         
        .google.protobuf.Duration max_staleness = 3;
        Specified by:
        getMaxStaleness in interface TransactionOptions.ReadOnlyOrBuilder
        Returns:
        The maxStaleness.
      • getMaxStalenessOrBuilder

        public com.google.protobuf.DurationOrBuilder getMaxStalenessOrBuilder()
         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.
         
        .google.protobuf.Duration max_staleness = 3;
        Specified by:
        getMaxStalenessOrBuilder in interface TransactionOptions.ReadOnlyOrBuilder
      • hasReadTimestamp

        public boolean hasReadTimestamp()
         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.
        
         A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds.
         Example: `"2014-10-02T15:01:23.045123456Z"`.
         
        .google.protobuf.Timestamp read_timestamp = 4;
        Specified by:
        hasReadTimestamp in interface TransactionOptions.ReadOnlyOrBuilder
        Returns:
        Whether the readTimestamp field is set.
      • getReadTimestamp

        public com.google.protobuf.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.
        
         A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds.
         Example: `"2014-10-02T15:01:23.045123456Z"`.
         
        .google.protobuf.Timestamp read_timestamp = 4;
        Specified by:
        getReadTimestamp in interface TransactionOptions.ReadOnlyOrBuilder
        Returns:
        The readTimestamp.
      • getReadTimestampOrBuilder

        public com.google.protobuf.TimestampOrBuilder getReadTimestampOrBuilder()
         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.
        
         A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds.
         Example: `"2014-10-02T15:01:23.045123456Z"`.
         
        .google.protobuf.Timestamp read_timestamp = 4;
        Specified by:
        getReadTimestampOrBuilder in interface TransactionOptions.ReadOnlyOrBuilder
      • hasExactStaleness

        public boolean hasExactStaleness()
         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`.
         
        .google.protobuf.Duration exact_staleness = 5;
        Specified by:
        hasExactStaleness in interface TransactionOptions.ReadOnlyOrBuilder
        Returns:
        Whether the exactStaleness field is set.
      • getExactStaleness

        public com.google.protobuf.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`.
         
        .google.protobuf.Duration exact_staleness = 5;
        Specified by:
        getExactStaleness in interface TransactionOptions.ReadOnlyOrBuilder
        Returns:
        The exactStaleness.
      • getExactStalenessOrBuilder

        public com.google.protobuf.DurationOrBuilder getExactStalenessOrBuilder()
         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`.
         
        .google.protobuf.Duration exact_staleness = 5;
        Specified by:
        getExactStalenessOrBuilder in interface TransactionOptions.ReadOnlyOrBuilder
      • getReturnReadTimestamp

        public boolean getReturnReadTimestamp()
         If true, the Cloud Spanner-selected read timestamp is included in
         the [Transaction][google.spanner.v1.Transaction] message that describes
         the transaction.
         
        bool return_read_timestamp = 6;
        Specified by:
        getReturnReadTimestamp in interface TransactionOptions.ReadOnlyOrBuilder
        Returns:
        The returnReadTimestamp.
      • 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 TransactionOptions.ReadOnly parseFrom​(ByteBuffer data)
                                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

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

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

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

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

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

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

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

        protected TransactionOptions.ReadOnly.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getParserForType

        public com.google.protobuf.Parser<TransactionOptions.ReadOnly> 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 TransactionOptions.ReadOnly getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder