if (modeCase_ == 3 && mode_ != com.google.spanner.v1.TransactionOptions.PartitionedDml.getDefaultInstance()) { mode_ = com.google.spanner.v1.TransactionOptions.PartitionedDml.newBuilder( (com.google.spanner.v1.TransactionOptions.PartitionedDml) mode_) .mergeFrom(value)
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); switch (modeCase_) { case 1: hash = (37 * hash) + READ_WRITE_FIELD_NUMBER; hash = (53 * hash) + getReadWrite().hashCode(); break; case 3: hash = (37 * hash) + PARTITIONED_DML_FIELD_NUMBER; hash = (53 * hash) + getPartitionedDml().hashCode(); break; case 2: hash = (37 * hash) + READ_ONLY_FIELD_NUMBER; hash = (53 * hash) + getReadOnly().hashCode(); break; case 0: default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
ByteString initTransaction() { final BeginTransactionRequest request = BeginTransactionRequest.newBuilder() .setSession(session.getName()) .setOptions( TransactionOptions.newBuilder() .setPartitionedDml(TransactionOptions.PartitionedDml.getDefaultInstance())) .build(); Transaction txn = runWithRetries( new Callable<Transaction>() { @Override public Transaction call() throws Exception { return rpc.beginTransaction(request, session.options); } }); if (txn.getId().isEmpty()) { throw SpannerExceptionFactory.newSpannerException( ErrorCode.INTERNAL, "Failed to init transaction, missing transaction id\n" + session.getName()); } return txn.getId(); }
if (partitionedDmlBuilder_ == null) { if (!(modeCase_ == 3)) { mode_ = com.google.spanner.v1.TransactionOptions.PartitionedDml.getDefaultInstance();
default: if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.spanner.v1.TransactionOptions)) { return super.equals(obj); } com.google.spanner.v1.TransactionOptions other = (com.google.spanner.v1.TransactionOptions) obj; boolean result = true; result = result && getModeCase().equals(other.getModeCase()); if (!result) return false; switch (modeCase_) { case 1: result = result && getReadWrite().equals(other.getReadWrite()); break; case 3: result = result && getPartitionedDml().equals(other.getPartitionedDml()); break; case 2: result = result && getReadOnly().equals(other.getReadOnly()); break; case 0: default: } result = result && unknownFields.equals(other.unknownFields); return result; }
/** * * * <pre> * Partitioned DML transaction. * Authorization to begin a Partitioned DML transaction requires * `spanner.databases.beginPartitionedDmlTransaction` permission * on the `session` resource. * </pre> * * <code>.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;</code> */ public com.google.spanner.v1.TransactionOptions.PartitionedDml getPartitionedDml() { if (partitionedDmlBuilder_ == null) { if (modeCase_ == 3) { return (com.google.spanner.v1.TransactionOptions.PartitionedDml) mode_; } return com.google.spanner.v1.TransactionOptions.PartitionedDml.getDefaultInstance(); } else { if (modeCase_ == 3) { return partitionedDmlBuilder_.getMessage(); } return com.google.spanner.v1.TransactionOptions.PartitionedDml.getDefaultInstance(); } } /**
/** * * * <pre> * Partitioned DML transaction. * Authorization to begin a Partitioned DML transaction requires * `spanner.databases.beginPartitionedDmlTransaction` permission * on the `session` resource. * </pre> * * <code>.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;</code> */ public com.google.spanner.v1.TransactionOptions.PartitionedDmlOrBuilder getPartitionedDmlOrBuilder() { if ((modeCase_ == 3) && (partitionedDmlBuilder_ != null)) { return partitionedDmlBuilder_.getMessageOrBuilder(); } else { if (modeCase_ == 3) { return (com.google.spanner.v1.TransactionOptions.PartitionedDml) mode_; } return com.google.spanner.v1.TransactionOptions.PartitionedDml.getDefaultInstance(); } } /**
ByteString initTransaction() { final BeginTransactionRequest request = BeginTransactionRequest.newBuilder() .setSession(session.getName()) .setOptions( TransactionOptions.newBuilder() .setPartitionedDml(TransactionOptions.PartitionedDml.getDefaultInstance())) .build(); Transaction txn = runWithRetries( new Callable<Transaction>() { @Override public Transaction call() throws Exception { return rpc.beginTransaction(request, session.options); } }); if (txn.getId().isEmpty()) { throw SpannerExceptionFactory.newSpannerException( ErrorCode.INTERNAL, "Failed to init transaction, missing transaction id\n" + session.getName()); } return txn.getId(); }
/** * * * <pre> * Partitioned DML transaction. * Authorization to begin a Partitioned DML transaction requires * `spanner.databases.beginPartitionedDmlTransaction` permission * on the `session` resource. * </pre> * * <code>.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;</code> */ public com.google.spanner.v1.TransactionOptions.PartitionedDml getPartitionedDml() { if (modeCase_ == 3) { return (com.google.spanner.v1.TransactionOptions.PartitionedDml) mode_; } return com.google.spanner.v1.TransactionOptions.PartitionedDml.getDefaultInstance(); } /**
/** * * * <pre> * Partitioned DML transaction. * Authorization to begin a Partitioned DML transaction requires * `spanner.databases.beginPartitionedDmlTransaction` permission * on the `session` resource. * </pre> * * <code>.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;</code> */ public com.google.spanner.v1.TransactionOptions.PartitionedDmlOrBuilder getPartitionedDmlOrBuilder() { if (modeCase_ == 3) { return (com.google.spanner.v1.TransactionOptions.PartitionedDml) mode_; } return com.google.spanner.v1.TransactionOptions.PartitionedDml.getDefaultInstance(); }
@java.lang.Override public com.google.spanner.v1.TransactionOptions.PartitionedDml getDefaultInstanceForType() { return com.google.spanner.v1.TransactionOptions.PartitionedDml.getDefaultInstance(); }
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
@java.lang.Override public com.google.spanner.v1.TransactionOptions.PartitionedDml buildPartial() { com.google.spanner.v1.TransactionOptions.PartitionedDml result = new com.google.spanner.v1.TransactionOptions.PartitionedDml(this); onBuilt(); return result; }
public Builder mergeFrom(com.google.spanner.v1.TransactionOptions.PartitionedDml other) { if (other == com.google.spanner.v1.TransactionOptions.PartitionedDml.getDefaultInstance()) return this; this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public com.google.spanner.v1.TransactionOptions.PartitionedDml build() { com.google.spanner.v1.TransactionOptions.PartitionedDml result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }