Class CloudTasksWriterOptions
- All Implemented Interfaces:
Serializable
Set via CloudTasksSinkBuilder.writerOptions(CloudTasksWriterOptions); optional — every
knob is defaulted, so defaults() is equivalent to not setting options at all.
There are deliberately no rate knobs. Cloud Tasks paces dispatch on the queue (
maxDispatchesPerSecond, maxConcurrentDispatches, the retry configuration), which is
queue configuration applied by whoever creates the queue. What this sink bounds is how many task
creations it keeps outstanding, not how fast the tasks execute. The channel pool is not a rate
knob either: it sizes how much of the in-flight cap the transport can actually carry
concurrently.
Retries are the sink's own because the generated client does not retry CreateTask: its
retryable-code set is empty and its total timeout is 20 seconds, while the read-only methods do
retry (verified in CloudTasksStubSettings; the dated verification record is ADR-0048).
NOT_FOUND has a budget of its own because a queue idle for 30 days takes a few minutes to
re-activate and returns NOT_FOUND meanwhile, while a mistyped queue name must not burn
the full retry budget on every record before the job fails.
Instances are immutable and serializable.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a newCloudTasksWriterOptions.Builder.static CloudTasksWriterOptionsdefaults()Returns the default options: an in-flight cap of 1000, the client's default transport (one gRPC channel), a transient-failure budget of 100 ms doubling to 10 s over 8 attempts, and aNOT_FOUNDbudget of 500 ms doubling to 2 s over 3 attempts.booleanReturns the configured gRPC channel-pool size, ornullwhen the client's default transport is left alone.intReturns the writer's cap on outstanding task creations.Returns the first backoff of theNOT_FOUNDretry.intReturns the maximum attempts of theNOT_FOUNDretry.Returns the backoff cap of theNOT_FOUNDretry.Returns the first backoff of the transient-failure retry.intReturns the maximum attempts of the transient-failure retry.Returns the backoff cap of the transient-failure retry.inthashCode()booleanReturns whether the writer registers per-queue send counters.Returns the schedule retryingNOT_FOUNDcreations.Returns the schedule retryingUNAVAILABLE,DEADLINE_EXCEEDEDandRESOURCE_EXHAUSTEDcreations.toString()
-
Method Details
-
builder
Creates a newCloudTasksWriterOptions.Builder.- Returns:
- a new builder
-
defaults
Returns the default options: an in-flight cap of 1000, the client's default transport (one gRPC channel), a transient-failure budget of 100 ms doubling to 10 s over 8 attempts, and aNOT_FOUNDbudget of 500 ms doubling to 2 s over 3 attempts.- Returns:
- the default options
-
getMaxInFlightTasks
public int getMaxInFlightTasks()Returns the writer's cap on outstanding task creations. -
getChannelPoolSize
Returns the configured gRPC channel-pool size, ornullwhen the client's default transport is left alone. -
getRecoveryInitialBackoff
Returns the first backoff of the transient-failure retry. -
getRecoveryMaxBackoff
Returns the backoff cap of the transient-failure retry. -
getRecoveryMaxAttempts
public int getRecoveryMaxAttempts()Returns the maximum attempts of the transient-failure retry. -
getNotFoundRecoveryInitialBackoff
Returns the first backoff of theNOT_FOUNDretry. -
getNotFoundRecoveryMaxBackoff
Returns the backoff cap of theNOT_FOUNDretry. -
getNotFoundRecoveryMaxAttempts
public int getNotFoundRecoveryMaxAttempts()Returns the maximum attempts of theNOT_FOUNDretry. -
isPerDestinationMetrics
public boolean isPerDestinationMetrics()Returns whether the writer registers per-queue send counters. -
toRecoverySchedule
Returns the schedule retryingUNAVAILABLE,DEADLINE_EXCEEDEDandRESOURCE_EXHAUSTEDcreations. -
toNotFoundRecoverySchedule
Returns the schedule retryingNOT_FOUNDcreations. Jittered like the transient schedule: every subtask that hit the same missing queue retries against the same queue once it is created, and the jitter is mean-preserving, so spreading the attempts costs the short budget nothing in expectation. -
equals
-
hashCode
public int hashCode() -
toString
-