1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 // Generated by the protocol buffer compiler. DO NOT EDIT! 17 // source: google/cloud/aiplatform/v1/machine_resources.proto 18 19 package com.google.cloud.aiplatform.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * Specification of a single machine. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.aiplatform.v1.MachineSpec} 29 */ 30 public final class MachineSpec extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.MachineSpec) 33 MachineSpecOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use MachineSpec.newBuilder() to construct. MachineSpec(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private MachineSpec(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 MachineSpec()40 private MachineSpec() { 41 machineType_ = ""; 42 acceleratorType_ = 0; 43 } 44 45 @java.lang.Override 46 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)47 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 48 return new MachineSpec(); 49 } 50 51 @java.lang.Override getUnknownFields()52 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 53 return this.unknownFields; 54 } 55 getDescriptor()56 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 57 return com.google.cloud.aiplatform.v1.MachineResourcesProto 58 .internal_static_google_cloud_aiplatform_v1_MachineSpec_descriptor; 59 } 60 61 @java.lang.Override 62 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()63 internalGetFieldAccessorTable() { 64 return com.google.cloud.aiplatform.v1.MachineResourcesProto 65 .internal_static_google_cloud_aiplatform_v1_MachineSpec_fieldAccessorTable 66 .ensureFieldAccessorsInitialized( 67 com.google.cloud.aiplatform.v1.MachineSpec.class, 68 com.google.cloud.aiplatform.v1.MachineSpec.Builder.class); 69 } 70 71 public static final int MACHINE_TYPE_FIELD_NUMBER = 1; 72 73 @SuppressWarnings("serial") 74 private volatile java.lang.Object machineType_ = ""; 75 /** 76 * 77 * 78 * <pre> 79 * Immutable. The type of the machine. 80 * See the [list of machine types supported for 81 * prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types) 82 * See the [list of machine types supported for custom 83 * training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types). 84 * For [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] this field is 85 * optional, and the default value is `n1-standard-2`. For 86 * [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob] or as 87 * part of [WorkerPoolSpec][google.cloud.aiplatform.v1.WorkerPoolSpec] this 88 * field is required. 89 * </pre> 90 * 91 * <code>string machine_type = 1 [(.google.api.field_behavior) = IMMUTABLE];</code> 92 * 93 * @return The machineType. 94 */ 95 @java.lang.Override getMachineType()96 public java.lang.String getMachineType() { 97 java.lang.Object ref = machineType_; 98 if (ref instanceof java.lang.String) { 99 return (java.lang.String) ref; 100 } else { 101 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 102 java.lang.String s = bs.toStringUtf8(); 103 machineType_ = s; 104 return s; 105 } 106 } 107 /** 108 * 109 * 110 * <pre> 111 * Immutable. The type of the machine. 112 * See the [list of machine types supported for 113 * prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types) 114 * See the [list of machine types supported for custom 115 * training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types). 116 * For [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] this field is 117 * optional, and the default value is `n1-standard-2`. For 118 * [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob] or as 119 * part of [WorkerPoolSpec][google.cloud.aiplatform.v1.WorkerPoolSpec] this 120 * field is required. 121 * </pre> 122 * 123 * <code>string machine_type = 1 [(.google.api.field_behavior) = IMMUTABLE];</code> 124 * 125 * @return The bytes for machineType. 126 */ 127 @java.lang.Override getMachineTypeBytes()128 public com.google.protobuf.ByteString getMachineTypeBytes() { 129 java.lang.Object ref = machineType_; 130 if (ref instanceof java.lang.String) { 131 com.google.protobuf.ByteString b = 132 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 133 machineType_ = b; 134 return b; 135 } else { 136 return (com.google.protobuf.ByteString) ref; 137 } 138 } 139 140 public static final int ACCELERATOR_TYPE_FIELD_NUMBER = 2; 141 private int acceleratorType_ = 0; 142 /** 143 * 144 * 145 * <pre> 146 * Immutable. The type of accelerator(s) that may be attached to the machine 147 * as per 148 * [accelerator_count][google.cloud.aiplatform.v1.MachineSpec.accelerator_count]. 149 * </pre> 150 * 151 * <code> 152 * .google.cloud.aiplatform.v1.AcceleratorType accelerator_type = 2 [(.google.api.field_behavior) = IMMUTABLE]; 153 * </code> 154 * 155 * @return The enum numeric value on the wire for acceleratorType. 156 */ 157 @java.lang.Override getAcceleratorTypeValue()158 public int getAcceleratorTypeValue() { 159 return acceleratorType_; 160 } 161 /** 162 * 163 * 164 * <pre> 165 * Immutable. The type of accelerator(s) that may be attached to the machine 166 * as per 167 * [accelerator_count][google.cloud.aiplatform.v1.MachineSpec.accelerator_count]. 168 * </pre> 169 * 170 * <code> 171 * .google.cloud.aiplatform.v1.AcceleratorType accelerator_type = 2 [(.google.api.field_behavior) = IMMUTABLE]; 172 * </code> 173 * 174 * @return The acceleratorType. 175 */ 176 @java.lang.Override getAcceleratorType()177 public com.google.cloud.aiplatform.v1.AcceleratorType getAcceleratorType() { 178 com.google.cloud.aiplatform.v1.AcceleratorType result = 179 com.google.cloud.aiplatform.v1.AcceleratorType.forNumber(acceleratorType_); 180 return result == null ? com.google.cloud.aiplatform.v1.AcceleratorType.UNRECOGNIZED : result; 181 } 182 183 public static final int ACCELERATOR_COUNT_FIELD_NUMBER = 3; 184 private int acceleratorCount_ = 0; 185 /** 186 * 187 * 188 * <pre> 189 * The number of accelerators to attach to the machine. 190 * </pre> 191 * 192 * <code>int32 accelerator_count = 3;</code> 193 * 194 * @return The acceleratorCount. 195 */ 196 @java.lang.Override getAcceleratorCount()197 public int getAcceleratorCount() { 198 return acceleratorCount_; 199 } 200 201 private byte memoizedIsInitialized = -1; 202 203 @java.lang.Override isInitialized()204 public final boolean isInitialized() { 205 byte isInitialized = memoizedIsInitialized; 206 if (isInitialized == 1) return true; 207 if (isInitialized == 0) return false; 208 209 memoizedIsInitialized = 1; 210 return true; 211 } 212 213 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)214 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 215 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(machineType_)) { 216 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, machineType_); 217 } 218 if (acceleratorType_ 219 != com.google.cloud.aiplatform.v1.AcceleratorType.ACCELERATOR_TYPE_UNSPECIFIED 220 .getNumber()) { 221 output.writeEnum(2, acceleratorType_); 222 } 223 if (acceleratorCount_ != 0) { 224 output.writeInt32(3, acceleratorCount_); 225 } 226 getUnknownFields().writeTo(output); 227 } 228 229 @java.lang.Override getSerializedSize()230 public int getSerializedSize() { 231 int size = memoizedSize; 232 if (size != -1) return size; 233 234 size = 0; 235 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(machineType_)) { 236 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, machineType_); 237 } 238 if (acceleratorType_ 239 != com.google.cloud.aiplatform.v1.AcceleratorType.ACCELERATOR_TYPE_UNSPECIFIED 240 .getNumber()) { 241 size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, acceleratorType_); 242 } 243 if (acceleratorCount_ != 0) { 244 size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, acceleratorCount_); 245 } 246 size += getUnknownFields().getSerializedSize(); 247 memoizedSize = size; 248 return size; 249 } 250 251 @java.lang.Override equals(final java.lang.Object obj)252 public boolean equals(final java.lang.Object obj) { 253 if (obj == this) { 254 return true; 255 } 256 if (!(obj instanceof com.google.cloud.aiplatform.v1.MachineSpec)) { 257 return super.equals(obj); 258 } 259 com.google.cloud.aiplatform.v1.MachineSpec other = 260 (com.google.cloud.aiplatform.v1.MachineSpec) obj; 261 262 if (!getMachineType().equals(other.getMachineType())) return false; 263 if (acceleratorType_ != other.acceleratorType_) return false; 264 if (getAcceleratorCount() != other.getAcceleratorCount()) return false; 265 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 266 return true; 267 } 268 269 @java.lang.Override hashCode()270 public int hashCode() { 271 if (memoizedHashCode != 0) { 272 return memoizedHashCode; 273 } 274 int hash = 41; 275 hash = (19 * hash) + getDescriptor().hashCode(); 276 hash = (37 * hash) + MACHINE_TYPE_FIELD_NUMBER; 277 hash = (53 * hash) + getMachineType().hashCode(); 278 hash = (37 * hash) + ACCELERATOR_TYPE_FIELD_NUMBER; 279 hash = (53 * hash) + acceleratorType_; 280 hash = (37 * hash) + ACCELERATOR_COUNT_FIELD_NUMBER; 281 hash = (53 * hash) + getAcceleratorCount(); 282 hash = (29 * hash) + getUnknownFields().hashCode(); 283 memoizedHashCode = hash; 284 return hash; 285 } 286 parseFrom(java.nio.ByteBuffer data)287 public static com.google.cloud.aiplatform.v1.MachineSpec parseFrom(java.nio.ByteBuffer data) 288 throws com.google.protobuf.InvalidProtocolBufferException { 289 return PARSER.parseFrom(data); 290 } 291 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)292 public static com.google.cloud.aiplatform.v1.MachineSpec parseFrom( 293 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 294 throws com.google.protobuf.InvalidProtocolBufferException { 295 return PARSER.parseFrom(data, extensionRegistry); 296 } 297 parseFrom( com.google.protobuf.ByteString data)298 public static com.google.cloud.aiplatform.v1.MachineSpec parseFrom( 299 com.google.protobuf.ByteString data) 300 throws com.google.protobuf.InvalidProtocolBufferException { 301 return PARSER.parseFrom(data); 302 } 303 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)304 public static com.google.cloud.aiplatform.v1.MachineSpec parseFrom( 305 com.google.protobuf.ByteString data, 306 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 307 throws com.google.protobuf.InvalidProtocolBufferException { 308 return PARSER.parseFrom(data, extensionRegistry); 309 } 310 parseFrom(byte[] data)311 public static com.google.cloud.aiplatform.v1.MachineSpec parseFrom(byte[] data) 312 throws com.google.protobuf.InvalidProtocolBufferException { 313 return PARSER.parseFrom(data); 314 } 315 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)316 public static com.google.cloud.aiplatform.v1.MachineSpec parseFrom( 317 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 318 throws com.google.protobuf.InvalidProtocolBufferException { 319 return PARSER.parseFrom(data, extensionRegistry); 320 } 321 parseFrom(java.io.InputStream input)322 public static com.google.cloud.aiplatform.v1.MachineSpec parseFrom(java.io.InputStream input) 323 throws java.io.IOException { 324 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 325 } 326 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)327 public static com.google.cloud.aiplatform.v1.MachineSpec parseFrom( 328 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 329 throws java.io.IOException { 330 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 331 PARSER, input, extensionRegistry); 332 } 333 parseDelimitedFrom( java.io.InputStream input)334 public static com.google.cloud.aiplatform.v1.MachineSpec parseDelimitedFrom( 335 java.io.InputStream input) throws java.io.IOException { 336 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 337 } 338 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)339 public static com.google.cloud.aiplatform.v1.MachineSpec parseDelimitedFrom( 340 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 341 throws java.io.IOException { 342 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 343 PARSER, input, extensionRegistry); 344 } 345 parseFrom( com.google.protobuf.CodedInputStream input)346 public static com.google.cloud.aiplatform.v1.MachineSpec parseFrom( 347 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 348 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 349 } 350 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)351 public static com.google.cloud.aiplatform.v1.MachineSpec parseFrom( 352 com.google.protobuf.CodedInputStream input, 353 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 354 throws java.io.IOException { 355 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 356 PARSER, input, extensionRegistry); 357 } 358 359 @java.lang.Override newBuilderForType()360 public Builder newBuilderForType() { 361 return newBuilder(); 362 } 363 newBuilder()364 public static Builder newBuilder() { 365 return DEFAULT_INSTANCE.toBuilder(); 366 } 367 newBuilder(com.google.cloud.aiplatform.v1.MachineSpec prototype)368 public static Builder newBuilder(com.google.cloud.aiplatform.v1.MachineSpec prototype) { 369 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 370 } 371 372 @java.lang.Override toBuilder()373 public Builder toBuilder() { 374 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 375 } 376 377 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)378 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 379 Builder builder = new Builder(parent); 380 return builder; 381 } 382 /** 383 * 384 * 385 * <pre> 386 * Specification of a single machine. 387 * </pre> 388 * 389 * Protobuf type {@code google.cloud.aiplatform.v1.MachineSpec} 390 */ 391 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 392 implements 393 // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.MachineSpec) 394 com.google.cloud.aiplatform.v1.MachineSpecOrBuilder { getDescriptor()395 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 396 return com.google.cloud.aiplatform.v1.MachineResourcesProto 397 .internal_static_google_cloud_aiplatform_v1_MachineSpec_descriptor; 398 } 399 400 @java.lang.Override 401 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()402 internalGetFieldAccessorTable() { 403 return com.google.cloud.aiplatform.v1.MachineResourcesProto 404 .internal_static_google_cloud_aiplatform_v1_MachineSpec_fieldAccessorTable 405 .ensureFieldAccessorsInitialized( 406 com.google.cloud.aiplatform.v1.MachineSpec.class, 407 com.google.cloud.aiplatform.v1.MachineSpec.Builder.class); 408 } 409 410 // Construct using com.google.cloud.aiplatform.v1.MachineSpec.newBuilder() Builder()411 private Builder() {} 412 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)413 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 414 super(parent); 415 } 416 417 @java.lang.Override clear()418 public Builder clear() { 419 super.clear(); 420 bitField0_ = 0; 421 machineType_ = ""; 422 acceleratorType_ = 0; 423 acceleratorCount_ = 0; 424 return this; 425 } 426 427 @java.lang.Override getDescriptorForType()428 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 429 return com.google.cloud.aiplatform.v1.MachineResourcesProto 430 .internal_static_google_cloud_aiplatform_v1_MachineSpec_descriptor; 431 } 432 433 @java.lang.Override getDefaultInstanceForType()434 public com.google.cloud.aiplatform.v1.MachineSpec getDefaultInstanceForType() { 435 return com.google.cloud.aiplatform.v1.MachineSpec.getDefaultInstance(); 436 } 437 438 @java.lang.Override build()439 public com.google.cloud.aiplatform.v1.MachineSpec build() { 440 com.google.cloud.aiplatform.v1.MachineSpec result = buildPartial(); 441 if (!result.isInitialized()) { 442 throw newUninitializedMessageException(result); 443 } 444 return result; 445 } 446 447 @java.lang.Override buildPartial()448 public com.google.cloud.aiplatform.v1.MachineSpec buildPartial() { 449 com.google.cloud.aiplatform.v1.MachineSpec result = 450 new com.google.cloud.aiplatform.v1.MachineSpec(this); 451 if (bitField0_ != 0) { 452 buildPartial0(result); 453 } 454 onBuilt(); 455 return result; 456 } 457 buildPartial0(com.google.cloud.aiplatform.v1.MachineSpec result)458 private void buildPartial0(com.google.cloud.aiplatform.v1.MachineSpec result) { 459 int from_bitField0_ = bitField0_; 460 if (((from_bitField0_ & 0x00000001) != 0)) { 461 result.machineType_ = machineType_; 462 } 463 if (((from_bitField0_ & 0x00000002) != 0)) { 464 result.acceleratorType_ = acceleratorType_; 465 } 466 if (((from_bitField0_ & 0x00000004) != 0)) { 467 result.acceleratorCount_ = acceleratorCount_; 468 } 469 } 470 471 @java.lang.Override clone()472 public Builder clone() { 473 return super.clone(); 474 } 475 476 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)477 public Builder setField( 478 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 479 return super.setField(field, value); 480 } 481 482 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)483 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 484 return super.clearField(field); 485 } 486 487 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)488 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 489 return super.clearOneof(oneof); 490 } 491 492 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)493 public Builder setRepeatedField( 494 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 495 return super.setRepeatedField(field, index, value); 496 } 497 498 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)499 public Builder addRepeatedField( 500 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 501 return super.addRepeatedField(field, value); 502 } 503 504 @java.lang.Override mergeFrom(com.google.protobuf.Message other)505 public Builder mergeFrom(com.google.protobuf.Message other) { 506 if (other instanceof com.google.cloud.aiplatform.v1.MachineSpec) { 507 return mergeFrom((com.google.cloud.aiplatform.v1.MachineSpec) other); 508 } else { 509 super.mergeFrom(other); 510 return this; 511 } 512 } 513 mergeFrom(com.google.cloud.aiplatform.v1.MachineSpec other)514 public Builder mergeFrom(com.google.cloud.aiplatform.v1.MachineSpec other) { 515 if (other == com.google.cloud.aiplatform.v1.MachineSpec.getDefaultInstance()) return this; 516 if (!other.getMachineType().isEmpty()) { 517 machineType_ = other.machineType_; 518 bitField0_ |= 0x00000001; 519 onChanged(); 520 } 521 if (other.acceleratorType_ != 0) { 522 setAcceleratorTypeValue(other.getAcceleratorTypeValue()); 523 } 524 if (other.getAcceleratorCount() != 0) { 525 setAcceleratorCount(other.getAcceleratorCount()); 526 } 527 this.mergeUnknownFields(other.getUnknownFields()); 528 onChanged(); 529 return this; 530 } 531 532 @java.lang.Override isInitialized()533 public final boolean isInitialized() { 534 return true; 535 } 536 537 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)538 public Builder mergeFrom( 539 com.google.protobuf.CodedInputStream input, 540 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 541 throws java.io.IOException { 542 if (extensionRegistry == null) { 543 throw new java.lang.NullPointerException(); 544 } 545 try { 546 boolean done = false; 547 while (!done) { 548 int tag = input.readTag(); 549 switch (tag) { 550 case 0: 551 done = true; 552 break; 553 case 10: 554 { 555 machineType_ = input.readStringRequireUtf8(); 556 bitField0_ |= 0x00000001; 557 break; 558 } // case 10 559 case 16: 560 { 561 acceleratorType_ = input.readEnum(); 562 bitField0_ |= 0x00000002; 563 break; 564 } // case 16 565 case 24: 566 { 567 acceleratorCount_ = input.readInt32(); 568 bitField0_ |= 0x00000004; 569 break; 570 } // case 24 571 default: 572 { 573 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 574 done = true; // was an endgroup tag 575 } 576 break; 577 } // default: 578 } // switch (tag) 579 } // while (!done) 580 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 581 throw e.unwrapIOException(); 582 } finally { 583 onChanged(); 584 } // finally 585 return this; 586 } 587 588 private int bitField0_; 589 590 private java.lang.Object machineType_ = ""; 591 /** 592 * 593 * 594 * <pre> 595 * Immutable. The type of the machine. 596 * See the [list of machine types supported for 597 * prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types) 598 * See the [list of machine types supported for custom 599 * training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types). 600 * For [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] this field is 601 * optional, and the default value is `n1-standard-2`. For 602 * [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob] or as 603 * part of [WorkerPoolSpec][google.cloud.aiplatform.v1.WorkerPoolSpec] this 604 * field is required. 605 * </pre> 606 * 607 * <code>string machine_type = 1 [(.google.api.field_behavior) = IMMUTABLE];</code> 608 * 609 * @return The machineType. 610 */ getMachineType()611 public java.lang.String getMachineType() { 612 java.lang.Object ref = machineType_; 613 if (!(ref instanceof java.lang.String)) { 614 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 615 java.lang.String s = bs.toStringUtf8(); 616 machineType_ = s; 617 return s; 618 } else { 619 return (java.lang.String) ref; 620 } 621 } 622 /** 623 * 624 * 625 * <pre> 626 * Immutable. The type of the machine. 627 * See the [list of machine types supported for 628 * prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types) 629 * See the [list of machine types supported for custom 630 * training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types). 631 * For [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] this field is 632 * optional, and the default value is `n1-standard-2`. For 633 * [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob] or as 634 * part of [WorkerPoolSpec][google.cloud.aiplatform.v1.WorkerPoolSpec] this 635 * field is required. 636 * </pre> 637 * 638 * <code>string machine_type = 1 [(.google.api.field_behavior) = IMMUTABLE];</code> 639 * 640 * @return The bytes for machineType. 641 */ getMachineTypeBytes()642 public com.google.protobuf.ByteString getMachineTypeBytes() { 643 java.lang.Object ref = machineType_; 644 if (ref instanceof String) { 645 com.google.protobuf.ByteString b = 646 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 647 machineType_ = b; 648 return b; 649 } else { 650 return (com.google.protobuf.ByteString) ref; 651 } 652 } 653 /** 654 * 655 * 656 * <pre> 657 * Immutable. The type of the machine. 658 * See the [list of machine types supported for 659 * prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types) 660 * See the [list of machine types supported for custom 661 * training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types). 662 * For [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] this field is 663 * optional, and the default value is `n1-standard-2`. For 664 * [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob] or as 665 * part of [WorkerPoolSpec][google.cloud.aiplatform.v1.WorkerPoolSpec] this 666 * field is required. 667 * </pre> 668 * 669 * <code>string machine_type = 1 [(.google.api.field_behavior) = IMMUTABLE];</code> 670 * 671 * @param value The machineType to set. 672 * @return This builder for chaining. 673 */ setMachineType(java.lang.String value)674 public Builder setMachineType(java.lang.String value) { 675 if (value == null) { 676 throw new NullPointerException(); 677 } 678 machineType_ = value; 679 bitField0_ |= 0x00000001; 680 onChanged(); 681 return this; 682 } 683 /** 684 * 685 * 686 * <pre> 687 * Immutable. The type of the machine. 688 * See the [list of machine types supported for 689 * prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types) 690 * See the [list of machine types supported for custom 691 * training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types). 692 * For [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] this field is 693 * optional, and the default value is `n1-standard-2`. For 694 * [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob] or as 695 * part of [WorkerPoolSpec][google.cloud.aiplatform.v1.WorkerPoolSpec] this 696 * field is required. 697 * </pre> 698 * 699 * <code>string machine_type = 1 [(.google.api.field_behavior) = IMMUTABLE];</code> 700 * 701 * @return This builder for chaining. 702 */ clearMachineType()703 public Builder clearMachineType() { 704 machineType_ = getDefaultInstance().getMachineType(); 705 bitField0_ = (bitField0_ & ~0x00000001); 706 onChanged(); 707 return this; 708 } 709 /** 710 * 711 * 712 * <pre> 713 * Immutable. The type of the machine. 714 * See the [list of machine types supported for 715 * prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types) 716 * See the [list of machine types supported for custom 717 * training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types). 718 * For [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] this field is 719 * optional, and the default value is `n1-standard-2`. For 720 * [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob] or as 721 * part of [WorkerPoolSpec][google.cloud.aiplatform.v1.WorkerPoolSpec] this 722 * field is required. 723 * </pre> 724 * 725 * <code>string machine_type = 1 [(.google.api.field_behavior) = IMMUTABLE];</code> 726 * 727 * @param value The bytes for machineType to set. 728 * @return This builder for chaining. 729 */ setMachineTypeBytes(com.google.protobuf.ByteString value)730 public Builder setMachineTypeBytes(com.google.protobuf.ByteString value) { 731 if (value == null) { 732 throw new NullPointerException(); 733 } 734 checkByteStringIsUtf8(value); 735 machineType_ = value; 736 bitField0_ |= 0x00000001; 737 onChanged(); 738 return this; 739 } 740 741 private int acceleratorType_ = 0; 742 /** 743 * 744 * 745 * <pre> 746 * Immutable. The type of accelerator(s) that may be attached to the machine 747 * as per 748 * [accelerator_count][google.cloud.aiplatform.v1.MachineSpec.accelerator_count]. 749 * </pre> 750 * 751 * <code> 752 * .google.cloud.aiplatform.v1.AcceleratorType accelerator_type = 2 [(.google.api.field_behavior) = IMMUTABLE]; 753 * </code> 754 * 755 * @return The enum numeric value on the wire for acceleratorType. 756 */ 757 @java.lang.Override getAcceleratorTypeValue()758 public int getAcceleratorTypeValue() { 759 return acceleratorType_; 760 } 761 /** 762 * 763 * 764 * <pre> 765 * Immutable. The type of accelerator(s) that may be attached to the machine 766 * as per 767 * [accelerator_count][google.cloud.aiplatform.v1.MachineSpec.accelerator_count]. 768 * </pre> 769 * 770 * <code> 771 * .google.cloud.aiplatform.v1.AcceleratorType accelerator_type = 2 [(.google.api.field_behavior) = IMMUTABLE]; 772 * </code> 773 * 774 * @param value The enum numeric value on the wire for acceleratorType to set. 775 * @return This builder for chaining. 776 */ setAcceleratorTypeValue(int value)777 public Builder setAcceleratorTypeValue(int value) { 778 acceleratorType_ = value; 779 bitField0_ |= 0x00000002; 780 onChanged(); 781 return this; 782 } 783 /** 784 * 785 * 786 * <pre> 787 * Immutable. The type of accelerator(s) that may be attached to the machine 788 * as per 789 * [accelerator_count][google.cloud.aiplatform.v1.MachineSpec.accelerator_count]. 790 * </pre> 791 * 792 * <code> 793 * .google.cloud.aiplatform.v1.AcceleratorType accelerator_type = 2 [(.google.api.field_behavior) = IMMUTABLE]; 794 * </code> 795 * 796 * @return The acceleratorType. 797 */ 798 @java.lang.Override getAcceleratorType()799 public com.google.cloud.aiplatform.v1.AcceleratorType getAcceleratorType() { 800 com.google.cloud.aiplatform.v1.AcceleratorType result = 801 com.google.cloud.aiplatform.v1.AcceleratorType.forNumber(acceleratorType_); 802 return result == null ? com.google.cloud.aiplatform.v1.AcceleratorType.UNRECOGNIZED : result; 803 } 804 /** 805 * 806 * 807 * <pre> 808 * Immutable. The type of accelerator(s) that may be attached to the machine 809 * as per 810 * [accelerator_count][google.cloud.aiplatform.v1.MachineSpec.accelerator_count]. 811 * </pre> 812 * 813 * <code> 814 * .google.cloud.aiplatform.v1.AcceleratorType accelerator_type = 2 [(.google.api.field_behavior) = IMMUTABLE]; 815 * </code> 816 * 817 * @param value The acceleratorType to set. 818 * @return This builder for chaining. 819 */ setAcceleratorType(com.google.cloud.aiplatform.v1.AcceleratorType value)820 public Builder setAcceleratorType(com.google.cloud.aiplatform.v1.AcceleratorType value) { 821 if (value == null) { 822 throw new NullPointerException(); 823 } 824 bitField0_ |= 0x00000002; 825 acceleratorType_ = value.getNumber(); 826 onChanged(); 827 return this; 828 } 829 /** 830 * 831 * 832 * <pre> 833 * Immutable. The type of accelerator(s) that may be attached to the machine 834 * as per 835 * [accelerator_count][google.cloud.aiplatform.v1.MachineSpec.accelerator_count]. 836 * </pre> 837 * 838 * <code> 839 * .google.cloud.aiplatform.v1.AcceleratorType accelerator_type = 2 [(.google.api.field_behavior) = IMMUTABLE]; 840 * </code> 841 * 842 * @return This builder for chaining. 843 */ clearAcceleratorType()844 public Builder clearAcceleratorType() { 845 bitField0_ = (bitField0_ & ~0x00000002); 846 acceleratorType_ = 0; 847 onChanged(); 848 return this; 849 } 850 851 private int acceleratorCount_; 852 /** 853 * 854 * 855 * <pre> 856 * The number of accelerators to attach to the machine. 857 * </pre> 858 * 859 * <code>int32 accelerator_count = 3;</code> 860 * 861 * @return The acceleratorCount. 862 */ 863 @java.lang.Override getAcceleratorCount()864 public int getAcceleratorCount() { 865 return acceleratorCount_; 866 } 867 /** 868 * 869 * 870 * <pre> 871 * The number of accelerators to attach to the machine. 872 * </pre> 873 * 874 * <code>int32 accelerator_count = 3;</code> 875 * 876 * @param value The acceleratorCount to set. 877 * @return This builder for chaining. 878 */ setAcceleratorCount(int value)879 public Builder setAcceleratorCount(int value) { 880 881 acceleratorCount_ = value; 882 bitField0_ |= 0x00000004; 883 onChanged(); 884 return this; 885 } 886 /** 887 * 888 * 889 * <pre> 890 * The number of accelerators to attach to the machine. 891 * </pre> 892 * 893 * <code>int32 accelerator_count = 3;</code> 894 * 895 * @return This builder for chaining. 896 */ clearAcceleratorCount()897 public Builder clearAcceleratorCount() { 898 bitField0_ = (bitField0_ & ~0x00000004); 899 acceleratorCount_ = 0; 900 onChanged(); 901 return this; 902 } 903 904 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)905 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 906 return super.setUnknownFields(unknownFields); 907 } 908 909 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)910 public final Builder mergeUnknownFields( 911 final com.google.protobuf.UnknownFieldSet unknownFields) { 912 return super.mergeUnknownFields(unknownFields); 913 } 914 915 // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1.MachineSpec) 916 } 917 918 // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.MachineSpec) 919 private static final com.google.cloud.aiplatform.v1.MachineSpec DEFAULT_INSTANCE; 920 921 static { 922 DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.MachineSpec(); 923 } 924 getDefaultInstance()925 public static com.google.cloud.aiplatform.v1.MachineSpec getDefaultInstance() { 926 return DEFAULT_INSTANCE; 927 } 928 929 private static final com.google.protobuf.Parser<MachineSpec> PARSER = 930 new com.google.protobuf.AbstractParser<MachineSpec>() { 931 @java.lang.Override 932 public MachineSpec parsePartialFrom( 933 com.google.protobuf.CodedInputStream input, 934 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 935 throws com.google.protobuf.InvalidProtocolBufferException { 936 Builder builder = newBuilder(); 937 try { 938 builder.mergeFrom(input, extensionRegistry); 939 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 940 throw e.setUnfinishedMessage(builder.buildPartial()); 941 } catch (com.google.protobuf.UninitializedMessageException e) { 942 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 943 } catch (java.io.IOException e) { 944 throw new com.google.protobuf.InvalidProtocolBufferException(e) 945 .setUnfinishedMessage(builder.buildPartial()); 946 } 947 return builder.buildPartial(); 948 } 949 }; 950 parser()951 public static com.google.protobuf.Parser<MachineSpec> parser() { 952 return PARSER; 953 } 954 955 @java.lang.Override getParserForType()956 public com.google.protobuf.Parser<MachineSpec> getParserForType() { 957 return PARSER; 958 } 959 960 @java.lang.Override getDefaultInstanceForType()961 public com.google.cloud.aiplatform.v1.MachineSpec getDefaultInstanceForType() { 962 return DEFAULT_INSTANCE; 963 } 964 } 965