/** * * * <pre> * For snapshot read-only transactions, the read timestamp chosen * for the transaction. Not returned by default: see * [TransactionOptions.ReadOnly.return_read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.return_read_timestamp]. * A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. * Example: `"2014-10-02T15:01:23.045123456Z"`. * </pre> * * <code>.google.protobuf.Timestamp read_timestamp = 2;</code> */ public com.google.protobuf.TimestampOrBuilder getReadTimestampOrBuilder() { return getReadTimestamp(); }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!id_.isEmpty()) { output.writeBytes(1, id_); } if (readTimestamp_ != null) { output.writeMessage(2, getReadTimestamp()); } unknownFields.writeTo(output); }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!id_.isEmpty()) { size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, id_); } if (readTimestamp_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getReadTimestamp()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.spanner.v1.Transaction)) { return super.equals(obj); } com.google.spanner.v1.Transaction other = (com.google.spanner.v1.Transaction) obj; boolean result = true; result = result && getId().equals(other.getId()); result = result && (hasReadTimestamp() == other.hasReadTimestamp()); if (hasReadTimestamp()) { result = result && getReadTimestamp().equals(other.getReadTimestamp()); } result = result && unknownFields.equals(other.unknownFields); return result; }
static Map<String, AttributeValue> getTransactionAnnotations(Transaction t) { return ImmutableMap.of( "Id", AttributeValue.stringAttributeValue(t.getId().toStringUtf8()), "Timestamp", AttributeValue.stringAttributeValue(Timestamp.fromProto(t.getReadTimestamp()).toString())); }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + ID_FIELD_NUMBER; hash = (53 * hash) + getId().hashCode(); if (hasReadTimestamp()) { hash = (37 * hash) + READ_TIMESTAMP_FIELD_NUMBER; hash = (53 * hash) + getReadTimestamp().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@Override public void onTransactionMetadata(Transaction transaction) { synchronized (lock) { if (!transaction.hasReadTimestamp()) { throw newSpannerException( ErrorCode.INTERNAL, "Missing expected transaction.read_timestamp metadata field"); } try { timestamp = Timestamp.fromProto(transaction.getReadTimestamp()); } catch (IllegalArgumentException e) { throw newSpannerException( ErrorCode.INTERNAL, "Bad value in transaction.read_timestamp metadata field", e); } } } }
public Builder mergeFrom(com.google.spanner.v1.Transaction other) { if (other == com.google.spanner.v1.Transaction.getDefaultInstance()) return this; if (other.getId() != com.google.protobuf.ByteString.EMPTY) { setId(other.getId()); } if (other.hasReadTimestamp()) { mergeReadTimestamp(other.getReadTimestamp()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
timestamp = Timestamp.fromProto(transaction.getReadTimestamp()); } catch (IllegalArgumentException e) { throw SpannerExceptionFactory.newSpannerException(
static Map<String, AttributeValue> getTransactionAnnotations(Transaction t) { return ImmutableMap.of( "Id", AttributeValue.stringAttributeValue(t.getId().toStringUtf8()), "Timestamp", AttributeValue.stringAttributeValue(Timestamp.fromProto(t.getReadTimestamp()).toString())); }
@Override public void onTransactionMetadata(Transaction transaction) { synchronized (lock) { if (!transaction.hasReadTimestamp()) { throw newSpannerException( ErrorCode.INTERNAL, "Missing expected transaction.read_timestamp metadata field"); } try { timestamp = Timestamp.fromProto(transaction.getReadTimestamp()); } catch (IllegalArgumentException e) { throw newSpannerException( ErrorCode.INTERNAL, "Bad value in transaction.read_timestamp metadata field", e); } } } }
timestamp = Timestamp.fromProto(transaction.getReadTimestamp()); } catch (IllegalArgumentException e) { throw SpannerExceptionFactory.newSpannerException(