Class UpdateDatabaseDdlRequest.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessageV3.Builder<UpdateDatabaseDdlRequest.Builder>
com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.Builder
- All Implemented Interfaces:
com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,UpdateDatabaseDdlRequestOrBuilder,Cloneable
- Enclosing class:
- UpdateDatabaseDdlRequest
public static final class UpdateDatabaseDdlRequest.Builder
extends com.google.protobuf.GeneratedMessageV3.Builder<UpdateDatabaseDdlRequest.Builder>
implements UpdateDatabaseDdlRequestOrBuilder
Enqueues the given DDL statements to be applied, in order but not necessarily all at once, to the database schema at some point (or points) in the future. The server checks that the statements are executable (syntactically valid, name tables that exist, etc.) before enqueueing them, but they may still fail upon later execution (e.g., if a statement from another batch of statements is applied first and it conflicts in some way, or if there is some data-related problem like a `NULL` value in a column to which `NOT NULL` would be added). If a statement fails, all subsequent statements in the batch are automatically cancelled. Each batch of statements is assigned a name which can be used with the [Operations][google.longrunning.Operations] API to monitor progress. See the [operation_id][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.operation_id] field for more details.Protobuf type
google.spanner.admin.database.v1.UpdateDatabaseDdlRequest-
Method Summary
Modifier and TypeMethodDescriptionaddAllStatements(Iterable<String> values) Required.addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) addStatements(String value) Required.addStatementsBytes(com.google.protobuf.ByteString value) Required.build()clear()Required.clearField(com.google.protobuf.Descriptors.FieldDescriptor field) clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) If empty, the new update request is assigned an automatically-generated operation ID.Optional.Required.Optional.clone()Required.com.google.protobuf.ByteStringRequired.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorIf empty, the new update request is assigned an automatically-generated operation ID.com.google.protobuf.ByteStringIf empty, the new update request is assigned an automatically-generated operation ID.com.google.protobuf.ByteStringOptional.getStatements(int index) Required.com.google.protobuf.ByteStringgetStatementsBytes(int index) Required.intRequired.com.google.protobuf.ProtocolStringListRequired.booleanOptional.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTablefinal booleanmergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) setDatabase(String value) Required.setDatabaseBytes(com.google.protobuf.ByteString value) Required.setOperationId(String value) If empty, the new update request is assigned an automatically-generated operation ID.setOperationIdBytes(com.google.protobuf.ByteString value) If empty, the new update request is assigned an automatically-generated operation ID.setProtoDescriptors(com.google.protobuf.ByteString value) Optional.setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) setStatements(int index, String value) Required.setThroughputMode(boolean value) Optional.setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3.Builder<UpdateDatabaseDdlRequest.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessageV3.Builder<UpdateDatabaseDdlRequest.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessageV3.Builder<UpdateDatabaseDdlRequest.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
- Specified by:
clonein interfacecom.google.protobuf.Message.Builder- Specified by:
clonein interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clonein classcom.google.protobuf.GeneratedMessageV3.Builder<UpdateDatabaseDdlRequest.Builder>
-
setField
public UpdateDatabaseDdlRequest.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - Specified by:
setFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<UpdateDatabaseDdlRequest.Builder>
-
clearField
public UpdateDatabaseDdlRequest.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) - Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<UpdateDatabaseDdlRequest.Builder>
-
clearOneof
public UpdateDatabaseDdlRequest.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) - Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<UpdateDatabaseDdlRequest.Builder>
-
setRepeatedField
public UpdateDatabaseDdlRequest.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) - Specified by:
setRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<UpdateDatabaseDdlRequest.Builder>
-
addRepeatedField
public UpdateDatabaseDdlRequest.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - Specified by:
addRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
addRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<UpdateDatabaseDdlRequest.Builder>
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<UpdateDatabaseDdlRequest.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3.Builder<UpdateDatabaseDdlRequest.Builder>
-
mergeFrom
public UpdateDatabaseDdlRequest.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<UpdateDatabaseDdlRequest.Builder>- Throws:
IOException
-
getDatabase
Required. The database to update.
string database = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }- Specified by:
getDatabasein interfaceUpdateDatabaseDdlRequestOrBuilder- Returns:
- The database.
-
getDatabaseBytes
public com.google.protobuf.ByteString getDatabaseBytes()Required. The database to update.
string database = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }- Specified by:
getDatabaseBytesin interfaceUpdateDatabaseDdlRequestOrBuilder- Returns:
- The bytes for database.
-
setDatabase
Required. The database to update.
string database = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }- Parameters:
value- The database to set.- Returns:
- This builder for chaining.
-
clearDatabase
Required. The database to update.
string database = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }- Returns:
- This builder for chaining.
-
setDatabaseBytes
Required. The database to update.
string database = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }- Parameters:
value- The bytes for database to set.- Returns:
- This builder for chaining.
-
getStatementsList
public com.google.protobuf.ProtocolStringList getStatementsList()Required. DDL statements to be applied to the database.
repeated string statements = 2 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getStatementsListin interfaceUpdateDatabaseDdlRequestOrBuilder- Returns:
- A list containing the statements.
-
getStatementsCount
public int getStatementsCount()Required. DDL statements to be applied to the database.
repeated string statements = 2 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getStatementsCountin interfaceUpdateDatabaseDdlRequestOrBuilder- Returns:
- The count of statements.
-
getStatements
Required. DDL statements to be applied to the database.
repeated string statements = 2 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getStatementsin interfaceUpdateDatabaseDdlRequestOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The statements at the given index.
-
getStatementsBytes
public com.google.protobuf.ByteString getStatementsBytes(int index) Required. DDL statements to be applied to the database.
repeated string statements = 2 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getStatementsBytesin interfaceUpdateDatabaseDdlRequestOrBuilder- Parameters:
index- The index of the value to return.- Returns:
- The bytes of the statements at the given index.
-
setStatements
Required. DDL statements to be applied to the database.
repeated string statements = 2 [(.google.api.field_behavior) = REQUIRED];- Parameters:
index- The index to set the value at.value- The statements to set.- Returns:
- This builder for chaining.
-
addStatements
Required. DDL statements to be applied to the database.
repeated string statements = 2 [(.google.api.field_behavior) = REQUIRED];- Parameters:
value- The statements to add.- Returns:
- This builder for chaining.
-
addAllStatements
Required. DDL statements to be applied to the database.
repeated string statements = 2 [(.google.api.field_behavior) = REQUIRED];- Parameters:
values- The statements to add.- Returns:
- This builder for chaining.
-
clearStatements
Required. DDL statements to be applied to the database.
repeated string statements = 2 [(.google.api.field_behavior) = REQUIRED];- Returns:
- This builder for chaining.
-
addStatementsBytes
Required. DDL statements to be applied to the database.
repeated string statements = 2 [(.google.api.field_behavior) = REQUIRED];- Parameters:
value- The bytes of the statements to add.- Returns:
- This builder for chaining.
-
getOperationId
If empty, the new update request is assigned an automatically-generated operation ID. Otherwise, `operation_id` is used to construct the name of the resulting [Operation][google.longrunning.Operation]. Specifying an explicit operation ID simplifies determining whether the statements were executed in the event that the [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed, or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and `operation_id` fields can be combined to form the [name][google.longrunning.Operation.name] of the resulting [longrunning.Operation][google.longrunning.Operation]: `<database>/operations/<operation_id>`. `operation_id` should be unique within the database, and must be a valid identifier: `[a-z][a-z0-9_]*`. Note that automatically-generated operation IDs always begin with an underscore. If the named operation already exists, [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns `ALREADY_EXISTS`.
string operation_id = 3;- Specified by:
getOperationIdin interfaceUpdateDatabaseDdlRequestOrBuilder- Returns:
- The operationId.
-
getOperationIdBytes
public com.google.protobuf.ByteString getOperationIdBytes()If empty, the new update request is assigned an automatically-generated operation ID. Otherwise, `operation_id` is used to construct the name of the resulting [Operation][google.longrunning.Operation]. Specifying an explicit operation ID simplifies determining whether the statements were executed in the event that the [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed, or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and `operation_id` fields can be combined to form the [name][google.longrunning.Operation.name] of the resulting [longrunning.Operation][google.longrunning.Operation]: `<database>/operations/<operation_id>`. `operation_id` should be unique within the database, and must be a valid identifier: `[a-z][a-z0-9_]*`. Note that automatically-generated operation IDs always begin with an underscore. If the named operation already exists, [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns `ALREADY_EXISTS`.
string operation_id = 3;- Specified by:
getOperationIdBytesin interfaceUpdateDatabaseDdlRequestOrBuilder- Returns:
- The bytes for operationId.
-
setOperationId
If empty, the new update request is assigned an automatically-generated operation ID. Otherwise, `operation_id` is used to construct the name of the resulting [Operation][google.longrunning.Operation]. Specifying an explicit operation ID simplifies determining whether the statements were executed in the event that the [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed, or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and `operation_id` fields can be combined to form the [name][google.longrunning.Operation.name] of the resulting [longrunning.Operation][google.longrunning.Operation]: `<database>/operations/<operation_id>`. `operation_id` should be unique within the database, and must be a valid identifier: `[a-z][a-z0-9_]*`. Note that automatically-generated operation IDs always begin with an underscore. If the named operation already exists, [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns `ALREADY_EXISTS`.
string operation_id = 3;- Parameters:
value- The operationId to set.- Returns:
- This builder for chaining.
-
clearOperationId
If empty, the new update request is assigned an automatically-generated operation ID. Otherwise, `operation_id` is used to construct the name of the resulting [Operation][google.longrunning.Operation]. Specifying an explicit operation ID simplifies determining whether the statements were executed in the event that the [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed, or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and `operation_id` fields can be combined to form the [name][google.longrunning.Operation.name] of the resulting [longrunning.Operation][google.longrunning.Operation]: `<database>/operations/<operation_id>`. `operation_id` should be unique within the database, and must be a valid identifier: `[a-z][a-z0-9_]*`. Note that automatically-generated operation IDs always begin with an underscore. If the named operation already exists, [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns `ALREADY_EXISTS`.
string operation_id = 3;- Returns:
- This builder for chaining.
-
setOperationIdBytes
If empty, the new update request is assigned an automatically-generated operation ID. Otherwise, `operation_id` is used to construct the name of the resulting [Operation][google.longrunning.Operation]. Specifying an explicit operation ID simplifies determining whether the statements were executed in the event that the [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed, or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and `operation_id` fields can be combined to form the [name][google.longrunning.Operation.name] of the resulting [longrunning.Operation][google.longrunning.Operation]: `<database>/operations/<operation_id>`. `operation_id` should be unique within the database, and must be a valid identifier: `[a-z][a-z0-9_]*`. Note that automatically-generated operation IDs always begin with an underscore. If the named operation already exists, [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns `ALREADY_EXISTS`.
string operation_id = 3;- Parameters:
value- The bytes for operationId to set.- Returns:
- This builder for chaining.
-
getProtoDescriptors
public com.google.protobuf.ByteString getProtoDescriptors()Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements. Contains a protobuf-serialized [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). To generate it, [install](https://grpc.io/docs/protoc-installation/) and run `protoc` with --include_imports and --descriptor_set_out. For example, to generate for moon/shot/app.proto, run ``` $protoc --proto_path=/app_path --proto_path=/lib_path \ --include_imports \ --descriptor_set_out=descriptors.data \ moon/shot/app.proto ``` For more details, see protobuffer [self description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).bytes proto_descriptors = 4 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getProtoDescriptorsin interfaceUpdateDatabaseDdlRequestOrBuilder- Returns:
- The protoDescriptors.
-
setProtoDescriptors
Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements. Contains a protobuf-serialized [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). To generate it, [install](https://grpc.io/docs/protoc-installation/) and run `protoc` with --include_imports and --descriptor_set_out. For example, to generate for moon/shot/app.proto, run ``` $protoc --proto_path=/app_path --proto_path=/lib_path \ --include_imports \ --descriptor_set_out=descriptors.data \ moon/shot/app.proto ``` For more details, see protobuffer [self description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).bytes proto_descriptors = 4 [(.google.api.field_behavior) = OPTIONAL];- Parameters:
value- The protoDescriptors to set.- Returns:
- This builder for chaining.
-
clearProtoDescriptors
Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements. Contains a protobuf-serialized [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto). To generate it, [install](https://grpc.io/docs/protoc-installation/) and run `protoc` with --include_imports and --descriptor_set_out. For example, to generate for moon/shot/app.proto, run ``` $protoc --proto_path=/app_path --proto_path=/lib_path \ --include_imports \ --descriptor_set_out=descriptors.data \ moon/shot/app.proto ``` For more details, see protobuffer [self description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).bytes proto_descriptors = 4 [(.google.api.field_behavior) = OPTIONAL];- Returns:
- This builder for chaining.
-
getThroughputMode
public boolean getThroughputMode()Optional. This field is exposed to be used by the Spanner Migration Tool. For more details, see [SMT](https://github.com/GoogleCloudPlatform/spanner-migration-tool).
bool throughput_mode = 5 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getThroughputModein interfaceUpdateDatabaseDdlRequestOrBuilder- Returns:
- The throughputMode.
-
setThroughputMode
Optional. This field is exposed to be used by the Spanner Migration Tool. For more details, see [SMT](https://github.com/GoogleCloudPlatform/spanner-migration-tool).
bool throughput_mode = 5 [(.google.api.field_behavior) = OPTIONAL];- Parameters:
value- The throughputMode to set.- Returns:
- This builder for chaining.
-
clearThroughputMode
Optional. This field is exposed to be used by the Spanner Migration Tool. For more details, see [SMT](https://github.com/GoogleCloudPlatform/spanner-migration-tool).
bool throughput_mode = 5 [(.google.api.field_behavior) = OPTIONAL];- Returns:
- This builder for chaining.
-
setUnknownFields
public final UpdateDatabaseDdlRequest.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) - Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<UpdateDatabaseDdlRequest.Builder>
-
mergeUnknownFields
public final UpdateDatabaseDdlRequest.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) - Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<UpdateDatabaseDdlRequest.Builder>
-