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/tasks/v2beta3/queue.proto 18 19 package com.google.cloud.tasks.v2beta3; 20 21 /** 22 * 23 * 24 * <pre> 25 * Rate limits. 26 * This message determines the maximum rate that tasks can be dispatched by a 27 * queue, regardless of whether the dispatch is a first task attempt or a retry. 28 * Note: The debugging command, 29 * [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask], will run a task 30 * even if the queue has reached its 31 * [RateLimits][google.cloud.tasks.v2beta3.RateLimits]. 32 * </pre> 33 * 34 * Protobuf type {@code google.cloud.tasks.v2beta3.RateLimits} 35 */ 36 public final class RateLimits extends com.google.protobuf.GeneratedMessageV3 37 implements 38 // @@protoc_insertion_point(message_implements:google.cloud.tasks.v2beta3.RateLimits) 39 RateLimitsOrBuilder { 40 private static final long serialVersionUID = 0L; 41 // Use RateLimits.newBuilder() to construct. RateLimits(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)42 private RateLimits(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 43 super(builder); 44 } 45 RateLimits()46 private RateLimits() {} 47 48 @java.lang.Override 49 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)50 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 51 return new RateLimits(); 52 } 53 54 @java.lang.Override getUnknownFields()55 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 56 return this.unknownFields; 57 } 58 getDescriptor()59 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 60 return com.google.cloud.tasks.v2beta3.QueueProto 61 .internal_static_google_cloud_tasks_v2beta3_RateLimits_descriptor; 62 } 63 64 @java.lang.Override 65 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()66 internalGetFieldAccessorTable() { 67 return com.google.cloud.tasks.v2beta3.QueueProto 68 .internal_static_google_cloud_tasks_v2beta3_RateLimits_fieldAccessorTable 69 .ensureFieldAccessorsInitialized( 70 com.google.cloud.tasks.v2beta3.RateLimits.class, 71 com.google.cloud.tasks.v2beta3.RateLimits.Builder.class); 72 } 73 74 public static final int MAX_DISPATCHES_PER_SECOND_FIELD_NUMBER = 1; 75 private double maxDispatchesPerSecond_ = 0D; 76 /** 77 * 78 * 79 * <pre> 80 * The maximum rate at which tasks are dispatched from this queue. 81 * If unspecified when the queue is created, Cloud Tasks will pick the 82 * default. 83 * * For [App Engine queues][google.cloud.tasks.v2beta3.AppEngineHttpQueue], 84 * the maximum allowed value 85 * is 500. 86 * This field has the same meaning as 87 * [rate in 88 * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). 89 * </pre> 90 * 91 * <code>double max_dispatches_per_second = 1;</code> 92 * 93 * @return The maxDispatchesPerSecond. 94 */ 95 @java.lang.Override getMaxDispatchesPerSecond()96 public double getMaxDispatchesPerSecond() { 97 return maxDispatchesPerSecond_; 98 } 99 100 public static final int MAX_BURST_SIZE_FIELD_NUMBER = 2; 101 private int maxBurstSize_ = 0; 102 /** 103 * 104 * 105 * <pre> 106 * The max burst size. 107 * Max burst size limits how fast tasks in queue are processed when 108 * many tasks are in the queue and the rate is high. This field 109 * allows the queue to have a high rate so processing starts shortly 110 * after a task is enqueued, but still limits resource usage when 111 * many tasks are enqueued in a short period of time. 112 * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) 113 * algorithm is used to control the rate of task dispatches. Each 114 * queue has a token bucket that holds tokens, up to the maximum 115 * specified by `max_burst_size`. Each time a task is dispatched, a 116 * token is removed from the bucket. Tasks will be dispatched until 117 * the queue's bucket runs out of tokens. The bucket will be 118 * continuously refilled with new tokens based on 119 * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. 120 * The default value of `max_burst_size` is picked by Cloud Tasks 121 * based on the value of 122 * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. 123 * The maximum value of `max_burst_size` is 500. 124 * For App Engine queues that were created or updated using 125 * `queue.yaml/xml`, `max_burst_size` is equal to 126 * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). 127 * If 128 * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is called 129 * on a queue without explicitly setting a value for `max_burst_size`, 130 * `max_burst_size` value will get updated if 131 * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is 132 * updating 133 * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. 134 * </pre> 135 * 136 * <code>int32 max_burst_size = 2;</code> 137 * 138 * @return The maxBurstSize. 139 */ 140 @java.lang.Override getMaxBurstSize()141 public int getMaxBurstSize() { 142 return maxBurstSize_; 143 } 144 145 public static final int MAX_CONCURRENT_DISPATCHES_FIELD_NUMBER = 3; 146 private int maxConcurrentDispatches_ = 0; 147 /** 148 * 149 * 150 * <pre> 151 * The maximum number of concurrent tasks that Cloud Tasks allows 152 * to be dispatched for this queue. After this threshold has been 153 * reached, Cloud Tasks stops dispatching tasks until the number of 154 * concurrent requests decreases. 155 * If unspecified when the queue is created, Cloud Tasks will pick the 156 * default. 157 * The maximum allowed value is 5,000. 158 * This field has the same meaning as 159 * [max_concurrent_requests in 160 * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). 161 * </pre> 162 * 163 * <code>int32 max_concurrent_dispatches = 3;</code> 164 * 165 * @return The maxConcurrentDispatches. 166 */ 167 @java.lang.Override getMaxConcurrentDispatches()168 public int getMaxConcurrentDispatches() { 169 return maxConcurrentDispatches_; 170 } 171 172 private byte memoizedIsInitialized = -1; 173 174 @java.lang.Override isInitialized()175 public final boolean isInitialized() { 176 byte isInitialized = memoizedIsInitialized; 177 if (isInitialized == 1) return true; 178 if (isInitialized == 0) return false; 179 180 memoizedIsInitialized = 1; 181 return true; 182 } 183 184 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)185 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 186 if (java.lang.Double.doubleToRawLongBits(maxDispatchesPerSecond_) != 0) { 187 output.writeDouble(1, maxDispatchesPerSecond_); 188 } 189 if (maxBurstSize_ != 0) { 190 output.writeInt32(2, maxBurstSize_); 191 } 192 if (maxConcurrentDispatches_ != 0) { 193 output.writeInt32(3, maxConcurrentDispatches_); 194 } 195 getUnknownFields().writeTo(output); 196 } 197 198 @java.lang.Override getSerializedSize()199 public int getSerializedSize() { 200 int size = memoizedSize; 201 if (size != -1) return size; 202 203 size = 0; 204 if (java.lang.Double.doubleToRawLongBits(maxDispatchesPerSecond_) != 0) { 205 size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, maxDispatchesPerSecond_); 206 } 207 if (maxBurstSize_ != 0) { 208 size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, maxBurstSize_); 209 } 210 if (maxConcurrentDispatches_ != 0) { 211 size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, maxConcurrentDispatches_); 212 } 213 size += getUnknownFields().getSerializedSize(); 214 memoizedSize = size; 215 return size; 216 } 217 218 @java.lang.Override equals(final java.lang.Object obj)219 public boolean equals(final java.lang.Object obj) { 220 if (obj == this) { 221 return true; 222 } 223 if (!(obj instanceof com.google.cloud.tasks.v2beta3.RateLimits)) { 224 return super.equals(obj); 225 } 226 com.google.cloud.tasks.v2beta3.RateLimits other = 227 (com.google.cloud.tasks.v2beta3.RateLimits) obj; 228 229 if (java.lang.Double.doubleToLongBits(getMaxDispatchesPerSecond()) 230 != java.lang.Double.doubleToLongBits(other.getMaxDispatchesPerSecond())) return false; 231 if (getMaxBurstSize() != other.getMaxBurstSize()) return false; 232 if (getMaxConcurrentDispatches() != other.getMaxConcurrentDispatches()) return false; 233 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 234 return true; 235 } 236 237 @java.lang.Override hashCode()238 public int hashCode() { 239 if (memoizedHashCode != 0) { 240 return memoizedHashCode; 241 } 242 int hash = 41; 243 hash = (19 * hash) + getDescriptor().hashCode(); 244 hash = (37 * hash) + MAX_DISPATCHES_PER_SECOND_FIELD_NUMBER; 245 hash = 246 (53 * hash) 247 + com.google.protobuf.Internal.hashLong( 248 java.lang.Double.doubleToLongBits(getMaxDispatchesPerSecond())); 249 hash = (37 * hash) + MAX_BURST_SIZE_FIELD_NUMBER; 250 hash = (53 * hash) + getMaxBurstSize(); 251 hash = (37 * hash) + MAX_CONCURRENT_DISPATCHES_FIELD_NUMBER; 252 hash = (53 * hash) + getMaxConcurrentDispatches(); 253 hash = (29 * hash) + getUnknownFields().hashCode(); 254 memoizedHashCode = hash; 255 return hash; 256 } 257 parseFrom(java.nio.ByteBuffer data)258 public static com.google.cloud.tasks.v2beta3.RateLimits parseFrom(java.nio.ByteBuffer data) 259 throws com.google.protobuf.InvalidProtocolBufferException { 260 return PARSER.parseFrom(data); 261 } 262 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)263 public static com.google.cloud.tasks.v2beta3.RateLimits parseFrom( 264 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 265 throws com.google.protobuf.InvalidProtocolBufferException { 266 return PARSER.parseFrom(data, extensionRegistry); 267 } 268 parseFrom( com.google.protobuf.ByteString data)269 public static com.google.cloud.tasks.v2beta3.RateLimits parseFrom( 270 com.google.protobuf.ByteString data) 271 throws com.google.protobuf.InvalidProtocolBufferException { 272 return PARSER.parseFrom(data); 273 } 274 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)275 public static com.google.cloud.tasks.v2beta3.RateLimits parseFrom( 276 com.google.protobuf.ByteString data, 277 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 278 throws com.google.protobuf.InvalidProtocolBufferException { 279 return PARSER.parseFrom(data, extensionRegistry); 280 } 281 parseFrom(byte[] data)282 public static com.google.cloud.tasks.v2beta3.RateLimits parseFrom(byte[] data) 283 throws com.google.protobuf.InvalidProtocolBufferException { 284 return PARSER.parseFrom(data); 285 } 286 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)287 public static com.google.cloud.tasks.v2beta3.RateLimits parseFrom( 288 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 289 throws com.google.protobuf.InvalidProtocolBufferException { 290 return PARSER.parseFrom(data, extensionRegistry); 291 } 292 parseFrom(java.io.InputStream input)293 public static com.google.cloud.tasks.v2beta3.RateLimits parseFrom(java.io.InputStream input) 294 throws java.io.IOException { 295 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 296 } 297 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)298 public static com.google.cloud.tasks.v2beta3.RateLimits parseFrom( 299 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 300 throws java.io.IOException { 301 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 302 PARSER, input, extensionRegistry); 303 } 304 parseDelimitedFrom( java.io.InputStream input)305 public static com.google.cloud.tasks.v2beta3.RateLimits parseDelimitedFrom( 306 java.io.InputStream input) throws java.io.IOException { 307 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 308 } 309 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)310 public static com.google.cloud.tasks.v2beta3.RateLimits parseDelimitedFrom( 311 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 312 throws java.io.IOException { 313 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 314 PARSER, input, extensionRegistry); 315 } 316 parseFrom( com.google.protobuf.CodedInputStream input)317 public static com.google.cloud.tasks.v2beta3.RateLimits parseFrom( 318 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 319 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 320 } 321 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)322 public static com.google.cloud.tasks.v2beta3.RateLimits parseFrom( 323 com.google.protobuf.CodedInputStream input, 324 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 325 throws java.io.IOException { 326 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 327 PARSER, input, extensionRegistry); 328 } 329 330 @java.lang.Override newBuilderForType()331 public Builder newBuilderForType() { 332 return newBuilder(); 333 } 334 newBuilder()335 public static Builder newBuilder() { 336 return DEFAULT_INSTANCE.toBuilder(); 337 } 338 newBuilder(com.google.cloud.tasks.v2beta3.RateLimits prototype)339 public static Builder newBuilder(com.google.cloud.tasks.v2beta3.RateLimits prototype) { 340 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 341 } 342 343 @java.lang.Override toBuilder()344 public Builder toBuilder() { 345 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 346 } 347 348 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)349 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 350 Builder builder = new Builder(parent); 351 return builder; 352 } 353 /** 354 * 355 * 356 * <pre> 357 * Rate limits. 358 * This message determines the maximum rate that tasks can be dispatched by a 359 * queue, regardless of whether the dispatch is a first task attempt or a retry. 360 * Note: The debugging command, 361 * [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask], will run a task 362 * even if the queue has reached its 363 * [RateLimits][google.cloud.tasks.v2beta3.RateLimits]. 364 * </pre> 365 * 366 * Protobuf type {@code google.cloud.tasks.v2beta3.RateLimits} 367 */ 368 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 369 implements 370 // @@protoc_insertion_point(builder_implements:google.cloud.tasks.v2beta3.RateLimits) 371 com.google.cloud.tasks.v2beta3.RateLimitsOrBuilder { getDescriptor()372 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 373 return com.google.cloud.tasks.v2beta3.QueueProto 374 .internal_static_google_cloud_tasks_v2beta3_RateLimits_descriptor; 375 } 376 377 @java.lang.Override 378 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()379 internalGetFieldAccessorTable() { 380 return com.google.cloud.tasks.v2beta3.QueueProto 381 .internal_static_google_cloud_tasks_v2beta3_RateLimits_fieldAccessorTable 382 .ensureFieldAccessorsInitialized( 383 com.google.cloud.tasks.v2beta3.RateLimits.class, 384 com.google.cloud.tasks.v2beta3.RateLimits.Builder.class); 385 } 386 387 // Construct using com.google.cloud.tasks.v2beta3.RateLimits.newBuilder() Builder()388 private Builder() {} 389 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)390 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 391 super(parent); 392 } 393 394 @java.lang.Override clear()395 public Builder clear() { 396 super.clear(); 397 bitField0_ = 0; 398 maxDispatchesPerSecond_ = 0D; 399 maxBurstSize_ = 0; 400 maxConcurrentDispatches_ = 0; 401 return this; 402 } 403 404 @java.lang.Override getDescriptorForType()405 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 406 return com.google.cloud.tasks.v2beta3.QueueProto 407 .internal_static_google_cloud_tasks_v2beta3_RateLimits_descriptor; 408 } 409 410 @java.lang.Override getDefaultInstanceForType()411 public com.google.cloud.tasks.v2beta3.RateLimits getDefaultInstanceForType() { 412 return com.google.cloud.tasks.v2beta3.RateLimits.getDefaultInstance(); 413 } 414 415 @java.lang.Override build()416 public com.google.cloud.tasks.v2beta3.RateLimits build() { 417 com.google.cloud.tasks.v2beta3.RateLimits result = buildPartial(); 418 if (!result.isInitialized()) { 419 throw newUninitializedMessageException(result); 420 } 421 return result; 422 } 423 424 @java.lang.Override buildPartial()425 public com.google.cloud.tasks.v2beta3.RateLimits buildPartial() { 426 com.google.cloud.tasks.v2beta3.RateLimits result = 427 new com.google.cloud.tasks.v2beta3.RateLimits(this); 428 if (bitField0_ != 0) { 429 buildPartial0(result); 430 } 431 onBuilt(); 432 return result; 433 } 434 buildPartial0(com.google.cloud.tasks.v2beta3.RateLimits result)435 private void buildPartial0(com.google.cloud.tasks.v2beta3.RateLimits result) { 436 int from_bitField0_ = bitField0_; 437 if (((from_bitField0_ & 0x00000001) != 0)) { 438 result.maxDispatchesPerSecond_ = maxDispatchesPerSecond_; 439 } 440 if (((from_bitField0_ & 0x00000002) != 0)) { 441 result.maxBurstSize_ = maxBurstSize_; 442 } 443 if (((from_bitField0_ & 0x00000004) != 0)) { 444 result.maxConcurrentDispatches_ = maxConcurrentDispatches_; 445 } 446 } 447 448 @java.lang.Override clone()449 public Builder clone() { 450 return super.clone(); 451 } 452 453 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)454 public Builder setField( 455 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 456 return super.setField(field, value); 457 } 458 459 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)460 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 461 return super.clearField(field); 462 } 463 464 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)465 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 466 return super.clearOneof(oneof); 467 } 468 469 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)470 public Builder setRepeatedField( 471 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 472 return super.setRepeatedField(field, index, value); 473 } 474 475 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)476 public Builder addRepeatedField( 477 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 478 return super.addRepeatedField(field, value); 479 } 480 481 @java.lang.Override mergeFrom(com.google.protobuf.Message other)482 public Builder mergeFrom(com.google.protobuf.Message other) { 483 if (other instanceof com.google.cloud.tasks.v2beta3.RateLimits) { 484 return mergeFrom((com.google.cloud.tasks.v2beta3.RateLimits) other); 485 } else { 486 super.mergeFrom(other); 487 return this; 488 } 489 } 490 mergeFrom(com.google.cloud.tasks.v2beta3.RateLimits other)491 public Builder mergeFrom(com.google.cloud.tasks.v2beta3.RateLimits other) { 492 if (other == com.google.cloud.tasks.v2beta3.RateLimits.getDefaultInstance()) return this; 493 if (other.getMaxDispatchesPerSecond() != 0D) { 494 setMaxDispatchesPerSecond(other.getMaxDispatchesPerSecond()); 495 } 496 if (other.getMaxBurstSize() != 0) { 497 setMaxBurstSize(other.getMaxBurstSize()); 498 } 499 if (other.getMaxConcurrentDispatches() != 0) { 500 setMaxConcurrentDispatches(other.getMaxConcurrentDispatches()); 501 } 502 this.mergeUnknownFields(other.getUnknownFields()); 503 onChanged(); 504 return this; 505 } 506 507 @java.lang.Override isInitialized()508 public final boolean isInitialized() { 509 return true; 510 } 511 512 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)513 public Builder mergeFrom( 514 com.google.protobuf.CodedInputStream input, 515 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 516 throws java.io.IOException { 517 if (extensionRegistry == null) { 518 throw new java.lang.NullPointerException(); 519 } 520 try { 521 boolean done = false; 522 while (!done) { 523 int tag = input.readTag(); 524 switch (tag) { 525 case 0: 526 done = true; 527 break; 528 case 9: 529 { 530 maxDispatchesPerSecond_ = input.readDouble(); 531 bitField0_ |= 0x00000001; 532 break; 533 } // case 9 534 case 16: 535 { 536 maxBurstSize_ = input.readInt32(); 537 bitField0_ |= 0x00000002; 538 break; 539 } // case 16 540 case 24: 541 { 542 maxConcurrentDispatches_ = input.readInt32(); 543 bitField0_ |= 0x00000004; 544 break; 545 } // case 24 546 default: 547 { 548 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 549 done = true; // was an endgroup tag 550 } 551 break; 552 } // default: 553 } // switch (tag) 554 } // while (!done) 555 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 556 throw e.unwrapIOException(); 557 } finally { 558 onChanged(); 559 } // finally 560 return this; 561 } 562 563 private int bitField0_; 564 565 private double maxDispatchesPerSecond_; 566 /** 567 * 568 * 569 * <pre> 570 * The maximum rate at which tasks are dispatched from this queue. 571 * If unspecified when the queue is created, Cloud Tasks will pick the 572 * default. 573 * * For [App Engine queues][google.cloud.tasks.v2beta3.AppEngineHttpQueue], 574 * the maximum allowed value 575 * is 500. 576 * This field has the same meaning as 577 * [rate in 578 * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). 579 * </pre> 580 * 581 * <code>double max_dispatches_per_second = 1;</code> 582 * 583 * @return The maxDispatchesPerSecond. 584 */ 585 @java.lang.Override getMaxDispatchesPerSecond()586 public double getMaxDispatchesPerSecond() { 587 return maxDispatchesPerSecond_; 588 } 589 /** 590 * 591 * 592 * <pre> 593 * The maximum rate at which tasks are dispatched from this queue. 594 * If unspecified when the queue is created, Cloud Tasks will pick the 595 * default. 596 * * For [App Engine queues][google.cloud.tasks.v2beta3.AppEngineHttpQueue], 597 * the maximum allowed value 598 * is 500. 599 * This field has the same meaning as 600 * [rate in 601 * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). 602 * </pre> 603 * 604 * <code>double max_dispatches_per_second = 1;</code> 605 * 606 * @param value The maxDispatchesPerSecond to set. 607 * @return This builder for chaining. 608 */ setMaxDispatchesPerSecond(double value)609 public Builder setMaxDispatchesPerSecond(double value) { 610 611 maxDispatchesPerSecond_ = value; 612 bitField0_ |= 0x00000001; 613 onChanged(); 614 return this; 615 } 616 /** 617 * 618 * 619 * <pre> 620 * The maximum rate at which tasks are dispatched from this queue. 621 * If unspecified when the queue is created, Cloud Tasks will pick the 622 * default. 623 * * For [App Engine queues][google.cloud.tasks.v2beta3.AppEngineHttpQueue], 624 * the maximum allowed value 625 * is 500. 626 * This field has the same meaning as 627 * [rate in 628 * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). 629 * </pre> 630 * 631 * <code>double max_dispatches_per_second = 1;</code> 632 * 633 * @return This builder for chaining. 634 */ clearMaxDispatchesPerSecond()635 public Builder clearMaxDispatchesPerSecond() { 636 bitField0_ = (bitField0_ & ~0x00000001); 637 maxDispatchesPerSecond_ = 0D; 638 onChanged(); 639 return this; 640 } 641 642 private int maxBurstSize_; 643 /** 644 * 645 * 646 * <pre> 647 * The max burst size. 648 * Max burst size limits how fast tasks in queue are processed when 649 * many tasks are in the queue and the rate is high. This field 650 * allows the queue to have a high rate so processing starts shortly 651 * after a task is enqueued, but still limits resource usage when 652 * many tasks are enqueued in a short period of time. 653 * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) 654 * algorithm is used to control the rate of task dispatches. Each 655 * queue has a token bucket that holds tokens, up to the maximum 656 * specified by `max_burst_size`. Each time a task is dispatched, a 657 * token is removed from the bucket. Tasks will be dispatched until 658 * the queue's bucket runs out of tokens. The bucket will be 659 * continuously refilled with new tokens based on 660 * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. 661 * The default value of `max_burst_size` is picked by Cloud Tasks 662 * based on the value of 663 * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. 664 * The maximum value of `max_burst_size` is 500. 665 * For App Engine queues that were created or updated using 666 * `queue.yaml/xml`, `max_burst_size` is equal to 667 * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). 668 * If 669 * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is called 670 * on a queue without explicitly setting a value for `max_burst_size`, 671 * `max_burst_size` value will get updated if 672 * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is 673 * updating 674 * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. 675 * </pre> 676 * 677 * <code>int32 max_burst_size = 2;</code> 678 * 679 * @return The maxBurstSize. 680 */ 681 @java.lang.Override getMaxBurstSize()682 public int getMaxBurstSize() { 683 return maxBurstSize_; 684 } 685 /** 686 * 687 * 688 * <pre> 689 * The max burst size. 690 * Max burst size limits how fast tasks in queue are processed when 691 * many tasks are in the queue and the rate is high. This field 692 * allows the queue to have a high rate so processing starts shortly 693 * after a task is enqueued, but still limits resource usage when 694 * many tasks are enqueued in a short period of time. 695 * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) 696 * algorithm is used to control the rate of task dispatches. Each 697 * queue has a token bucket that holds tokens, up to the maximum 698 * specified by `max_burst_size`. Each time a task is dispatched, a 699 * token is removed from the bucket. Tasks will be dispatched until 700 * the queue's bucket runs out of tokens. The bucket will be 701 * continuously refilled with new tokens based on 702 * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. 703 * The default value of `max_burst_size` is picked by Cloud Tasks 704 * based on the value of 705 * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. 706 * The maximum value of `max_burst_size` is 500. 707 * For App Engine queues that were created or updated using 708 * `queue.yaml/xml`, `max_burst_size` is equal to 709 * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). 710 * If 711 * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is called 712 * on a queue without explicitly setting a value for `max_burst_size`, 713 * `max_burst_size` value will get updated if 714 * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is 715 * updating 716 * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. 717 * </pre> 718 * 719 * <code>int32 max_burst_size = 2;</code> 720 * 721 * @param value The maxBurstSize to set. 722 * @return This builder for chaining. 723 */ setMaxBurstSize(int value)724 public Builder setMaxBurstSize(int value) { 725 726 maxBurstSize_ = value; 727 bitField0_ |= 0x00000002; 728 onChanged(); 729 return this; 730 } 731 /** 732 * 733 * 734 * <pre> 735 * The max burst size. 736 * Max burst size limits how fast tasks in queue are processed when 737 * many tasks are in the queue and the rate is high. This field 738 * allows the queue to have a high rate so processing starts shortly 739 * after a task is enqueued, but still limits resource usage when 740 * many tasks are enqueued in a short period of time. 741 * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) 742 * algorithm is used to control the rate of task dispatches. Each 743 * queue has a token bucket that holds tokens, up to the maximum 744 * specified by `max_burst_size`. Each time a task is dispatched, a 745 * token is removed from the bucket. Tasks will be dispatched until 746 * the queue's bucket runs out of tokens. The bucket will be 747 * continuously refilled with new tokens based on 748 * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. 749 * The default value of `max_burst_size` is picked by Cloud Tasks 750 * based on the value of 751 * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. 752 * The maximum value of `max_burst_size` is 500. 753 * For App Engine queues that were created or updated using 754 * `queue.yaml/xml`, `max_burst_size` is equal to 755 * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). 756 * If 757 * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is called 758 * on a queue without explicitly setting a value for `max_burst_size`, 759 * `max_burst_size` value will get updated if 760 * [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is 761 * updating 762 * [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. 763 * </pre> 764 * 765 * <code>int32 max_burst_size = 2;</code> 766 * 767 * @return This builder for chaining. 768 */ clearMaxBurstSize()769 public Builder clearMaxBurstSize() { 770 bitField0_ = (bitField0_ & ~0x00000002); 771 maxBurstSize_ = 0; 772 onChanged(); 773 return this; 774 } 775 776 private int maxConcurrentDispatches_; 777 /** 778 * 779 * 780 * <pre> 781 * The maximum number of concurrent tasks that Cloud Tasks allows 782 * to be dispatched for this queue. After this threshold has been 783 * reached, Cloud Tasks stops dispatching tasks until the number of 784 * concurrent requests decreases. 785 * If unspecified when the queue is created, Cloud Tasks will pick the 786 * default. 787 * The maximum allowed value is 5,000. 788 * This field has the same meaning as 789 * [max_concurrent_requests in 790 * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). 791 * </pre> 792 * 793 * <code>int32 max_concurrent_dispatches = 3;</code> 794 * 795 * @return The maxConcurrentDispatches. 796 */ 797 @java.lang.Override getMaxConcurrentDispatches()798 public int getMaxConcurrentDispatches() { 799 return maxConcurrentDispatches_; 800 } 801 /** 802 * 803 * 804 * <pre> 805 * The maximum number of concurrent tasks that Cloud Tasks allows 806 * to be dispatched for this queue. After this threshold has been 807 * reached, Cloud Tasks stops dispatching tasks until the number of 808 * concurrent requests decreases. 809 * If unspecified when the queue is created, Cloud Tasks will pick the 810 * default. 811 * The maximum allowed value is 5,000. 812 * This field has the same meaning as 813 * [max_concurrent_requests in 814 * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). 815 * </pre> 816 * 817 * <code>int32 max_concurrent_dispatches = 3;</code> 818 * 819 * @param value The maxConcurrentDispatches to set. 820 * @return This builder for chaining. 821 */ setMaxConcurrentDispatches(int value)822 public Builder setMaxConcurrentDispatches(int value) { 823 824 maxConcurrentDispatches_ = value; 825 bitField0_ |= 0x00000004; 826 onChanged(); 827 return this; 828 } 829 /** 830 * 831 * 832 * <pre> 833 * The maximum number of concurrent tasks that Cloud Tasks allows 834 * to be dispatched for this queue. After this threshold has been 835 * reached, Cloud Tasks stops dispatching tasks until the number of 836 * concurrent requests decreases. 837 * If unspecified when the queue is created, Cloud Tasks will pick the 838 * default. 839 * The maximum allowed value is 5,000. 840 * This field has the same meaning as 841 * [max_concurrent_requests in 842 * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). 843 * </pre> 844 * 845 * <code>int32 max_concurrent_dispatches = 3;</code> 846 * 847 * @return This builder for chaining. 848 */ clearMaxConcurrentDispatches()849 public Builder clearMaxConcurrentDispatches() { 850 bitField0_ = (bitField0_ & ~0x00000004); 851 maxConcurrentDispatches_ = 0; 852 onChanged(); 853 return this; 854 } 855 856 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)857 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 858 return super.setUnknownFields(unknownFields); 859 } 860 861 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)862 public final Builder mergeUnknownFields( 863 final com.google.protobuf.UnknownFieldSet unknownFields) { 864 return super.mergeUnknownFields(unknownFields); 865 } 866 867 // @@protoc_insertion_point(builder_scope:google.cloud.tasks.v2beta3.RateLimits) 868 } 869 870 // @@protoc_insertion_point(class_scope:google.cloud.tasks.v2beta3.RateLimits) 871 private static final com.google.cloud.tasks.v2beta3.RateLimits DEFAULT_INSTANCE; 872 873 static { 874 DEFAULT_INSTANCE = new com.google.cloud.tasks.v2beta3.RateLimits(); 875 } 876 getDefaultInstance()877 public static com.google.cloud.tasks.v2beta3.RateLimits getDefaultInstance() { 878 return DEFAULT_INSTANCE; 879 } 880 881 private static final com.google.protobuf.Parser<RateLimits> PARSER = 882 new com.google.protobuf.AbstractParser<RateLimits>() { 883 @java.lang.Override 884 public RateLimits parsePartialFrom( 885 com.google.protobuf.CodedInputStream input, 886 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 887 throws com.google.protobuf.InvalidProtocolBufferException { 888 Builder builder = newBuilder(); 889 try { 890 builder.mergeFrom(input, extensionRegistry); 891 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 892 throw e.setUnfinishedMessage(builder.buildPartial()); 893 } catch (com.google.protobuf.UninitializedMessageException e) { 894 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 895 } catch (java.io.IOException e) { 896 throw new com.google.protobuf.InvalidProtocolBufferException(e) 897 .setUnfinishedMessage(builder.buildPartial()); 898 } 899 return builder.buildPartial(); 900 } 901 }; 902 parser()903 public static com.google.protobuf.Parser<RateLimits> parser() { 904 return PARSER; 905 } 906 907 @java.lang.Override getParserForType()908 public com.google.protobuf.Parser<RateLimits> getParserForType() { 909 return PARSER; 910 } 911 912 @java.lang.Override getDefaultInstanceForType()913 public com.google.cloud.tasks.v2beta3.RateLimits getDefaultInstanceForType() { 914 return DEFAULT_INSTANCE; 915 } 916 } 917