• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/dataproc/v1/clusters.proto
18 
19 package com.google.cloud.dataproc.v1;
20 
21 /**
22  *
23  *
24  * <pre>
25  * Specifies the type and number of accelerator cards attached to the instances
26  * of an instance. See [GPUs on Compute
27  * Engine](https://cloud.google.com/compute/docs/gpus/).
28  * </pre>
29  *
30  * Protobuf type {@code google.cloud.dataproc.v1.AcceleratorConfig}
31  */
32 public final class AcceleratorConfig extends com.google.protobuf.GeneratedMessageV3
33     implements
34     // @@protoc_insertion_point(message_implements:google.cloud.dataproc.v1.AcceleratorConfig)
35     AcceleratorConfigOrBuilder {
36   private static final long serialVersionUID = 0L;
37   // Use AcceleratorConfig.newBuilder() to construct.
AcceleratorConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)38   private AcceleratorConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
39     super(builder);
40   }
41 
AcceleratorConfig()42   private AcceleratorConfig() {
43     acceleratorTypeUri_ = "";
44   }
45 
46   @java.lang.Override
47   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)48   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
49     return new AcceleratorConfig();
50   }
51 
52   @java.lang.Override
getUnknownFields()53   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
54     return this.unknownFields;
55   }
56 
getDescriptor()57   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
58     return com.google.cloud.dataproc.v1.ClustersProto
59         .internal_static_google_cloud_dataproc_v1_AcceleratorConfig_descriptor;
60   }
61 
62   @java.lang.Override
63   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()64       internalGetFieldAccessorTable() {
65     return com.google.cloud.dataproc.v1.ClustersProto
66         .internal_static_google_cloud_dataproc_v1_AcceleratorConfig_fieldAccessorTable
67         .ensureFieldAccessorsInitialized(
68             com.google.cloud.dataproc.v1.AcceleratorConfig.class,
69             com.google.cloud.dataproc.v1.AcceleratorConfig.Builder.class);
70   }
71 
72   public static final int ACCELERATOR_TYPE_URI_FIELD_NUMBER = 1;
73 
74   @SuppressWarnings("serial")
75   private volatile java.lang.Object acceleratorTypeUri_ = "";
76   /**
77    *
78    *
79    * <pre>
80    * Full URL, partial URI, or short name of the accelerator type resource to
81    * expose to this instance. See
82    * [Compute Engine
83    * AcceleratorTypes](https://cloud.google.com/compute/docs/reference/v1/acceleratorTypes).
84    * Examples:
85    * * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-k80`
86    * * `projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-k80`
87    * * `nvidia-tesla-k80`
88    * **Auto Zone Exception**: If you are using the Dataproc
89    * [Auto Zone
90    * Placement](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement)
91    * feature, you must use the short name of the accelerator type
92    * resource, for example, `nvidia-tesla-k80`.
93    * </pre>
94    *
95    * <code>string accelerator_type_uri = 1;</code>
96    *
97    * @return The acceleratorTypeUri.
98    */
99   @java.lang.Override
getAcceleratorTypeUri()100   public java.lang.String getAcceleratorTypeUri() {
101     java.lang.Object ref = acceleratorTypeUri_;
102     if (ref instanceof java.lang.String) {
103       return (java.lang.String) ref;
104     } else {
105       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
106       java.lang.String s = bs.toStringUtf8();
107       acceleratorTypeUri_ = s;
108       return s;
109     }
110   }
111   /**
112    *
113    *
114    * <pre>
115    * Full URL, partial URI, or short name of the accelerator type resource to
116    * expose to this instance. See
117    * [Compute Engine
118    * AcceleratorTypes](https://cloud.google.com/compute/docs/reference/v1/acceleratorTypes).
119    * Examples:
120    * * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-k80`
121    * * `projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-k80`
122    * * `nvidia-tesla-k80`
123    * **Auto Zone Exception**: If you are using the Dataproc
124    * [Auto Zone
125    * Placement](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement)
126    * feature, you must use the short name of the accelerator type
127    * resource, for example, `nvidia-tesla-k80`.
128    * </pre>
129    *
130    * <code>string accelerator_type_uri = 1;</code>
131    *
132    * @return The bytes for acceleratorTypeUri.
133    */
134   @java.lang.Override
getAcceleratorTypeUriBytes()135   public com.google.protobuf.ByteString getAcceleratorTypeUriBytes() {
136     java.lang.Object ref = acceleratorTypeUri_;
137     if (ref instanceof java.lang.String) {
138       com.google.protobuf.ByteString b =
139           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
140       acceleratorTypeUri_ = b;
141       return b;
142     } else {
143       return (com.google.protobuf.ByteString) ref;
144     }
145   }
146 
147   public static final int ACCELERATOR_COUNT_FIELD_NUMBER = 2;
148   private int acceleratorCount_ = 0;
149   /**
150    *
151    *
152    * <pre>
153    * The number of the accelerator cards of this type exposed to this instance.
154    * </pre>
155    *
156    * <code>int32 accelerator_count = 2;</code>
157    *
158    * @return The acceleratorCount.
159    */
160   @java.lang.Override
getAcceleratorCount()161   public int getAcceleratorCount() {
162     return acceleratorCount_;
163   }
164 
165   private byte memoizedIsInitialized = -1;
166 
167   @java.lang.Override
isInitialized()168   public final boolean isInitialized() {
169     byte isInitialized = memoizedIsInitialized;
170     if (isInitialized == 1) return true;
171     if (isInitialized == 0) return false;
172 
173     memoizedIsInitialized = 1;
174     return true;
175   }
176 
177   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)178   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
179     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(acceleratorTypeUri_)) {
180       com.google.protobuf.GeneratedMessageV3.writeString(output, 1, acceleratorTypeUri_);
181     }
182     if (acceleratorCount_ != 0) {
183       output.writeInt32(2, acceleratorCount_);
184     }
185     getUnknownFields().writeTo(output);
186   }
187 
188   @java.lang.Override
getSerializedSize()189   public int getSerializedSize() {
190     int size = memoizedSize;
191     if (size != -1) return size;
192 
193     size = 0;
194     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(acceleratorTypeUri_)) {
195       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, acceleratorTypeUri_);
196     }
197     if (acceleratorCount_ != 0) {
198       size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, acceleratorCount_);
199     }
200     size += getUnknownFields().getSerializedSize();
201     memoizedSize = size;
202     return size;
203   }
204 
205   @java.lang.Override
equals(final java.lang.Object obj)206   public boolean equals(final java.lang.Object obj) {
207     if (obj == this) {
208       return true;
209     }
210     if (!(obj instanceof com.google.cloud.dataproc.v1.AcceleratorConfig)) {
211       return super.equals(obj);
212     }
213     com.google.cloud.dataproc.v1.AcceleratorConfig other =
214         (com.google.cloud.dataproc.v1.AcceleratorConfig) obj;
215 
216     if (!getAcceleratorTypeUri().equals(other.getAcceleratorTypeUri())) return false;
217     if (getAcceleratorCount() != other.getAcceleratorCount()) return false;
218     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
219     return true;
220   }
221 
222   @java.lang.Override
hashCode()223   public int hashCode() {
224     if (memoizedHashCode != 0) {
225       return memoizedHashCode;
226     }
227     int hash = 41;
228     hash = (19 * hash) + getDescriptor().hashCode();
229     hash = (37 * hash) + ACCELERATOR_TYPE_URI_FIELD_NUMBER;
230     hash = (53 * hash) + getAcceleratorTypeUri().hashCode();
231     hash = (37 * hash) + ACCELERATOR_COUNT_FIELD_NUMBER;
232     hash = (53 * hash) + getAcceleratorCount();
233     hash = (29 * hash) + getUnknownFields().hashCode();
234     memoizedHashCode = hash;
235     return hash;
236   }
237 
parseFrom(java.nio.ByteBuffer data)238   public static com.google.cloud.dataproc.v1.AcceleratorConfig parseFrom(java.nio.ByteBuffer data)
239       throws com.google.protobuf.InvalidProtocolBufferException {
240     return PARSER.parseFrom(data);
241   }
242 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)243   public static com.google.cloud.dataproc.v1.AcceleratorConfig parseFrom(
244       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
245       throws com.google.protobuf.InvalidProtocolBufferException {
246     return PARSER.parseFrom(data, extensionRegistry);
247   }
248 
parseFrom( com.google.protobuf.ByteString data)249   public static com.google.cloud.dataproc.v1.AcceleratorConfig parseFrom(
250       com.google.protobuf.ByteString data)
251       throws com.google.protobuf.InvalidProtocolBufferException {
252     return PARSER.parseFrom(data);
253   }
254 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)255   public static com.google.cloud.dataproc.v1.AcceleratorConfig parseFrom(
256       com.google.protobuf.ByteString data,
257       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
258       throws com.google.protobuf.InvalidProtocolBufferException {
259     return PARSER.parseFrom(data, extensionRegistry);
260   }
261 
parseFrom(byte[] data)262   public static com.google.cloud.dataproc.v1.AcceleratorConfig parseFrom(byte[] data)
263       throws com.google.protobuf.InvalidProtocolBufferException {
264     return PARSER.parseFrom(data);
265   }
266 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)267   public static com.google.cloud.dataproc.v1.AcceleratorConfig parseFrom(
268       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
269       throws com.google.protobuf.InvalidProtocolBufferException {
270     return PARSER.parseFrom(data, extensionRegistry);
271   }
272 
parseFrom(java.io.InputStream input)273   public static com.google.cloud.dataproc.v1.AcceleratorConfig parseFrom(java.io.InputStream input)
274       throws java.io.IOException {
275     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
276   }
277 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)278   public static com.google.cloud.dataproc.v1.AcceleratorConfig parseFrom(
279       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
280       throws java.io.IOException {
281     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
282         PARSER, input, extensionRegistry);
283   }
284 
parseDelimitedFrom( java.io.InputStream input)285   public static com.google.cloud.dataproc.v1.AcceleratorConfig parseDelimitedFrom(
286       java.io.InputStream input) throws java.io.IOException {
287     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
288   }
289 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)290   public static com.google.cloud.dataproc.v1.AcceleratorConfig parseDelimitedFrom(
291       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
292       throws java.io.IOException {
293     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
294         PARSER, input, extensionRegistry);
295   }
296 
parseFrom( com.google.protobuf.CodedInputStream input)297   public static com.google.cloud.dataproc.v1.AcceleratorConfig parseFrom(
298       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
299     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
300   }
301 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)302   public static com.google.cloud.dataproc.v1.AcceleratorConfig parseFrom(
303       com.google.protobuf.CodedInputStream input,
304       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
305       throws java.io.IOException {
306     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
307         PARSER, input, extensionRegistry);
308   }
309 
310   @java.lang.Override
newBuilderForType()311   public Builder newBuilderForType() {
312     return newBuilder();
313   }
314 
newBuilder()315   public static Builder newBuilder() {
316     return DEFAULT_INSTANCE.toBuilder();
317   }
318 
newBuilder(com.google.cloud.dataproc.v1.AcceleratorConfig prototype)319   public static Builder newBuilder(com.google.cloud.dataproc.v1.AcceleratorConfig prototype) {
320     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
321   }
322 
323   @java.lang.Override
toBuilder()324   public Builder toBuilder() {
325     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
326   }
327 
328   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)329   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
330     Builder builder = new Builder(parent);
331     return builder;
332   }
333   /**
334    *
335    *
336    * <pre>
337    * Specifies the type and number of accelerator cards attached to the instances
338    * of an instance. See [GPUs on Compute
339    * Engine](https://cloud.google.com/compute/docs/gpus/).
340    * </pre>
341    *
342    * Protobuf type {@code google.cloud.dataproc.v1.AcceleratorConfig}
343    */
344   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
345       implements
346       // @@protoc_insertion_point(builder_implements:google.cloud.dataproc.v1.AcceleratorConfig)
347       com.google.cloud.dataproc.v1.AcceleratorConfigOrBuilder {
getDescriptor()348     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
349       return com.google.cloud.dataproc.v1.ClustersProto
350           .internal_static_google_cloud_dataproc_v1_AcceleratorConfig_descriptor;
351     }
352 
353     @java.lang.Override
354     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()355         internalGetFieldAccessorTable() {
356       return com.google.cloud.dataproc.v1.ClustersProto
357           .internal_static_google_cloud_dataproc_v1_AcceleratorConfig_fieldAccessorTable
358           .ensureFieldAccessorsInitialized(
359               com.google.cloud.dataproc.v1.AcceleratorConfig.class,
360               com.google.cloud.dataproc.v1.AcceleratorConfig.Builder.class);
361     }
362 
363     // Construct using com.google.cloud.dataproc.v1.AcceleratorConfig.newBuilder()
Builder()364     private Builder() {}
365 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)366     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
367       super(parent);
368     }
369 
370     @java.lang.Override
clear()371     public Builder clear() {
372       super.clear();
373       bitField0_ = 0;
374       acceleratorTypeUri_ = "";
375       acceleratorCount_ = 0;
376       return this;
377     }
378 
379     @java.lang.Override
getDescriptorForType()380     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
381       return com.google.cloud.dataproc.v1.ClustersProto
382           .internal_static_google_cloud_dataproc_v1_AcceleratorConfig_descriptor;
383     }
384 
385     @java.lang.Override
getDefaultInstanceForType()386     public com.google.cloud.dataproc.v1.AcceleratorConfig getDefaultInstanceForType() {
387       return com.google.cloud.dataproc.v1.AcceleratorConfig.getDefaultInstance();
388     }
389 
390     @java.lang.Override
build()391     public com.google.cloud.dataproc.v1.AcceleratorConfig build() {
392       com.google.cloud.dataproc.v1.AcceleratorConfig result = buildPartial();
393       if (!result.isInitialized()) {
394         throw newUninitializedMessageException(result);
395       }
396       return result;
397     }
398 
399     @java.lang.Override
buildPartial()400     public com.google.cloud.dataproc.v1.AcceleratorConfig buildPartial() {
401       com.google.cloud.dataproc.v1.AcceleratorConfig result =
402           new com.google.cloud.dataproc.v1.AcceleratorConfig(this);
403       if (bitField0_ != 0) {
404         buildPartial0(result);
405       }
406       onBuilt();
407       return result;
408     }
409 
buildPartial0(com.google.cloud.dataproc.v1.AcceleratorConfig result)410     private void buildPartial0(com.google.cloud.dataproc.v1.AcceleratorConfig result) {
411       int from_bitField0_ = bitField0_;
412       if (((from_bitField0_ & 0x00000001) != 0)) {
413         result.acceleratorTypeUri_ = acceleratorTypeUri_;
414       }
415       if (((from_bitField0_ & 0x00000002) != 0)) {
416         result.acceleratorCount_ = acceleratorCount_;
417       }
418     }
419 
420     @java.lang.Override
clone()421     public Builder clone() {
422       return super.clone();
423     }
424 
425     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)426     public Builder setField(
427         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
428       return super.setField(field, value);
429     }
430 
431     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)432     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
433       return super.clearField(field);
434     }
435 
436     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)437     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
438       return super.clearOneof(oneof);
439     }
440 
441     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)442     public Builder setRepeatedField(
443         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
444       return super.setRepeatedField(field, index, value);
445     }
446 
447     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)448     public Builder addRepeatedField(
449         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
450       return super.addRepeatedField(field, value);
451     }
452 
453     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)454     public Builder mergeFrom(com.google.protobuf.Message other) {
455       if (other instanceof com.google.cloud.dataproc.v1.AcceleratorConfig) {
456         return mergeFrom((com.google.cloud.dataproc.v1.AcceleratorConfig) other);
457       } else {
458         super.mergeFrom(other);
459         return this;
460       }
461     }
462 
mergeFrom(com.google.cloud.dataproc.v1.AcceleratorConfig other)463     public Builder mergeFrom(com.google.cloud.dataproc.v1.AcceleratorConfig other) {
464       if (other == com.google.cloud.dataproc.v1.AcceleratorConfig.getDefaultInstance()) return this;
465       if (!other.getAcceleratorTypeUri().isEmpty()) {
466         acceleratorTypeUri_ = other.acceleratorTypeUri_;
467         bitField0_ |= 0x00000001;
468         onChanged();
469       }
470       if (other.getAcceleratorCount() != 0) {
471         setAcceleratorCount(other.getAcceleratorCount());
472       }
473       this.mergeUnknownFields(other.getUnknownFields());
474       onChanged();
475       return this;
476     }
477 
478     @java.lang.Override
isInitialized()479     public final boolean isInitialized() {
480       return true;
481     }
482 
483     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)484     public Builder mergeFrom(
485         com.google.protobuf.CodedInputStream input,
486         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
487         throws java.io.IOException {
488       if (extensionRegistry == null) {
489         throw new java.lang.NullPointerException();
490       }
491       try {
492         boolean done = false;
493         while (!done) {
494           int tag = input.readTag();
495           switch (tag) {
496             case 0:
497               done = true;
498               break;
499             case 10:
500               {
501                 acceleratorTypeUri_ = input.readStringRequireUtf8();
502                 bitField0_ |= 0x00000001;
503                 break;
504               } // case 10
505             case 16:
506               {
507                 acceleratorCount_ = input.readInt32();
508                 bitField0_ |= 0x00000002;
509                 break;
510               } // case 16
511             default:
512               {
513                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
514                   done = true; // was an endgroup tag
515                 }
516                 break;
517               } // default:
518           } // switch (tag)
519         } // while (!done)
520       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
521         throw e.unwrapIOException();
522       } finally {
523         onChanged();
524       } // finally
525       return this;
526     }
527 
528     private int bitField0_;
529 
530     private java.lang.Object acceleratorTypeUri_ = "";
531     /**
532      *
533      *
534      * <pre>
535      * Full URL, partial URI, or short name of the accelerator type resource to
536      * expose to this instance. See
537      * [Compute Engine
538      * AcceleratorTypes](https://cloud.google.com/compute/docs/reference/v1/acceleratorTypes).
539      * Examples:
540      * * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-k80`
541      * * `projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-k80`
542      * * `nvidia-tesla-k80`
543      * **Auto Zone Exception**: If you are using the Dataproc
544      * [Auto Zone
545      * Placement](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement)
546      * feature, you must use the short name of the accelerator type
547      * resource, for example, `nvidia-tesla-k80`.
548      * </pre>
549      *
550      * <code>string accelerator_type_uri = 1;</code>
551      *
552      * @return The acceleratorTypeUri.
553      */
getAcceleratorTypeUri()554     public java.lang.String getAcceleratorTypeUri() {
555       java.lang.Object ref = acceleratorTypeUri_;
556       if (!(ref instanceof java.lang.String)) {
557         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
558         java.lang.String s = bs.toStringUtf8();
559         acceleratorTypeUri_ = s;
560         return s;
561       } else {
562         return (java.lang.String) ref;
563       }
564     }
565     /**
566      *
567      *
568      * <pre>
569      * Full URL, partial URI, or short name of the accelerator type resource to
570      * expose to this instance. See
571      * [Compute Engine
572      * AcceleratorTypes](https://cloud.google.com/compute/docs/reference/v1/acceleratorTypes).
573      * Examples:
574      * * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-k80`
575      * * `projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-k80`
576      * * `nvidia-tesla-k80`
577      * **Auto Zone Exception**: If you are using the Dataproc
578      * [Auto Zone
579      * Placement](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement)
580      * feature, you must use the short name of the accelerator type
581      * resource, for example, `nvidia-tesla-k80`.
582      * </pre>
583      *
584      * <code>string accelerator_type_uri = 1;</code>
585      *
586      * @return The bytes for acceleratorTypeUri.
587      */
getAcceleratorTypeUriBytes()588     public com.google.protobuf.ByteString getAcceleratorTypeUriBytes() {
589       java.lang.Object ref = acceleratorTypeUri_;
590       if (ref instanceof String) {
591         com.google.protobuf.ByteString b =
592             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
593         acceleratorTypeUri_ = b;
594         return b;
595       } else {
596         return (com.google.protobuf.ByteString) ref;
597       }
598     }
599     /**
600      *
601      *
602      * <pre>
603      * Full URL, partial URI, or short name of the accelerator type resource to
604      * expose to this instance. See
605      * [Compute Engine
606      * AcceleratorTypes](https://cloud.google.com/compute/docs/reference/v1/acceleratorTypes).
607      * Examples:
608      * * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-k80`
609      * * `projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-k80`
610      * * `nvidia-tesla-k80`
611      * **Auto Zone Exception**: If you are using the Dataproc
612      * [Auto Zone
613      * Placement](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement)
614      * feature, you must use the short name of the accelerator type
615      * resource, for example, `nvidia-tesla-k80`.
616      * </pre>
617      *
618      * <code>string accelerator_type_uri = 1;</code>
619      *
620      * @param value The acceleratorTypeUri to set.
621      * @return This builder for chaining.
622      */
setAcceleratorTypeUri(java.lang.String value)623     public Builder setAcceleratorTypeUri(java.lang.String value) {
624       if (value == null) {
625         throw new NullPointerException();
626       }
627       acceleratorTypeUri_ = value;
628       bitField0_ |= 0x00000001;
629       onChanged();
630       return this;
631     }
632     /**
633      *
634      *
635      * <pre>
636      * Full URL, partial URI, or short name of the accelerator type resource to
637      * expose to this instance. See
638      * [Compute Engine
639      * AcceleratorTypes](https://cloud.google.com/compute/docs/reference/v1/acceleratorTypes).
640      * Examples:
641      * * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-k80`
642      * * `projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-k80`
643      * * `nvidia-tesla-k80`
644      * **Auto Zone Exception**: If you are using the Dataproc
645      * [Auto Zone
646      * Placement](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement)
647      * feature, you must use the short name of the accelerator type
648      * resource, for example, `nvidia-tesla-k80`.
649      * </pre>
650      *
651      * <code>string accelerator_type_uri = 1;</code>
652      *
653      * @return This builder for chaining.
654      */
clearAcceleratorTypeUri()655     public Builder clearAcceleratorTypeUri() {
656       acceleratorTypeUri_ = getDefaultInstance().getAcceleratorTypeUri();
657       bitField0_ = (bitField0_ & ~0x00000001);
658       onChanged();
659       return this;
660     }
661     /**
662      *
663      *
664      * <pre>
665      * Full URL, partial URI, or short name of the accelerator type resource to
666      * expose to this instance. See
667      * [Compute Engine
668      * AcceleratorTypes](https://cloud.google.com/compute/docs/reference/v1/acceleratorTypes).
669      * Examples:
670      * * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-k80`
671      * * `projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-k80`
672      * * `nvidia-tesla-k80`
673      * **Auto Zone Exception**: If you are using the Dataproc
674      * [Auto Zone
675      * Placement](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement)
676      * feature, you must use the short name of the accelerator type
677      * resource, for example, `nvidia-tesla-k80`.
678      * </pre>
679      *
680      * <code>string accelerator_type_uri = 1;</code>
681      *
682      * @param value The bytes for acceleratorTypeUri to set.
683      * @return This builder for chaining.
684      */
setAcceleratorTypeUriBytes(com.google.protobuf.ByteString value)685     public Builder setAcceleratorTypeUriBytes(com.google.protobuf.ByteString value) {
686       if (value == null) {
687         throw new NullPointerException();
688       }
689       checkByteStringIsUtf8(value);
690       acceleratorTypeUri_ = value;
691       bitField0_ |= 0x00000001;
692       onChanged();
693       return this;
694     }
695 
696     private int acceleratorCount_;
697     /**
698      *
699      *
700      * <pre>
701      * The number of the accelerator cards of this type exposed to this instance.
702      * </pre>
703      *
704      * <code>int32 accelerator_count = 2;</code>
705      *
706      * @return The acceleratorCount.
707      */
708     @java.lang.Override
getAcceleratorCount()709     public int getAcceleratorCount() {
710       return acceleratorCount_;
711     }
712     /**
713      *
714      *
715      * <pre>
716      * The number of the accelerator cards of this type exposed to this instance.
717      * </pre>
718      *
719      * <code>int32 accelerator_count = 2;</code>
720      *
721      * @param value The acceleratorCount to set.
722      * @return This builder for chaining.
723      */
setAcceleratorCount(int value)724     public Builder setAcceleratorCount(int value) {
725 
726       acceleratorCount_ = value;
727       bitField0_ |= 0x00000002;
728       onChanged();
729       return this;
730     }
731     /**
732      *
733      *
734      * <pre>
735      * The number of the accelerator cards of this type exposed to this instance.
736      * </pre>
737      *
738      * <code>int32 accelerator_count = 2;</code>
739      *
740      * @return This builder for chaining.
741      */
clearAcceleratorCount()742     public Builder clearAcceleratorCount() {
743       bitField0_ = (bitField0_ & ~0x00000002);
744       acceleratorCount_ = 0;
745       onChanged();
746       return this;
747     }
748 
749     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)750     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
751       return super.setUnknownFields(unknownFields);
752     }
753 
754     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)755     public final Builder mergeUnknownFields(
756         final com.google.protobuf.UnknownFieldSet unknownFields) {
757       return super.mergeUnknownFields(unknownFields);
758     }
759 
760     // @@protoc_insertion_point(builder_scope:google.cloud.dataproc.v1.AcceleratorConfig)
761   }
762 
763   // @@protoc_insertion_point(class_scope:google.cloud.dataproc.v1.AcceleratorConfig)
764   private static final com.google.cloud.dataproc.v1.AcceleratorConfig DEFAULT_INSTANCE;
765 
766   static {
767     DEFAULT_INSTANCE = new com.google.cloud.dataproc.v1.AcceleratorConfig();
768   }
769 
getDefaultInstance()770   public static com.google.cloud.dataproc.v1.AcceleratorConfig getDefaultInstance() {
771     return DEFAULT_INSTANCE;
772   }
773 
774   private static final com.google.protobuf.Parser<AcceleratorConfig> PARSER =
775       new com.google.protobuf.AbstractParser<AcceleratorConfig>() {
776         @java.lang.Override
777         public AcceleratorConfig parsePartialFrom(
778             com.google.protobuf.CodedInputStream input,
779             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
780             throws com.google.protobuf.InvalidProtocolBufferException {
781           Builder builder = newBuilder();
782           try {
783             builder.mergeFrom(input, extensionRegistry);
784           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
785             throw e.setUnfinishedMessage(builder.buildPartial());
786           } catch (com.google.protobuf.UninitializedMessageException e) {
787             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
788           } catch (java.io.IOException e) {
789             throw new com.google.protobuf.InvalidProtocolBufferException(e)
790                 .setUnfinishedMessage(builder.buildPartial());
791           }
792           return builder.buildPartial();
793         }
794       };
795 
parser()796   public static com.google.protobuf.Parser<AcceleratorConfig> parser() {
797     return PARSER;
798   }
799 
800   @java.lang.Override
getParserForType()801   public com.google.protobuf.Parser<AcceleratorConfig> getParserForType() {
802     return PARSER;
803   }
804 
805   @java.lang.Override
getDefaultInstanceForType()806   public com.google.cloud.dataproc.v1.AcceleratorConfig getDefaultInstanceForType() {
807     return DEFAULT_INSTANCE;
808   }
809 }
810