
io.envoyproxy.envoy.config.route.v3.HedgePolicy Maven / Gradle / Ivy
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: envoy/config/route/v3/route_components.proto
// Protobuf Java Version: 3.25.1
package io.envoyproxy.envoy.config.route.v3;
/**
*
* HTTP request hedging :ref:`architecture overview <arch_overview_http_routing_hedging>`.
*
*
* Protobuf type {@code envoy.config.route.v3.HedgePolicy}
*/
public final class HedgePolicy extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:envoy.config.route.v3.HedgePolicy)
HedgePolicyOrBuilder {
private static final long serialVersionUID = 0L;
// Use HedgePolicy.newBuilder() to construct.
private HedgePolicy(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private HedgePolicy() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new HedgePolicy();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.envoyproxy.envoy.config.route.v3.RouteComponentsProto.internal_static_envoy_config_route_v3_HedgePolicy_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.envoyproxy.envoy.config.route.v3.RouteComponentsProto.internal_static_envoy_config_route_v3_HedgePolicy_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.envoyproxy.envoy.config.route.v3.HedgePolicy.class, io.envoyproxy.envoy.config.route.v3.HedgePolicy.Builder.class);
}
private int bitField0_;
public static final int INITIAL_REQUESTS_FIELD_NUMBER = 1;
private com.google.protobuf.UInt32Value initialRequests_;
/**
*
* Specifies the number of initial requests that should be sent upstream.
* Must be at least 1.
* Defaults to 1.
* [#not-implemented-hide:]
*
*
* .google.protobuf.UInt32Value initial_requests = 1 [(.validate.rules) = { ... }
* @return Whether the initialRequests field is set.
*/
@java.lang.Override
public boolean hasInitialRequests() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* Specifies the number of initial requests that should be sent upstream.
* Must be at least 1.
* Defaults to 1.
* [#not-implemented-hide:]
*
*
* .google.protobuf.UInt32Value initial_requests = 1 [(.validate.rules) = { ... }
* @return The initialRequests.
*/
@java.lang.Override
public com.google.protobuf.UInt32Value getInitialRequests() {
return initialRequests_ == null ? com.google.protobuf.UInt32Value.getDefaultInstance() : initialRequests_;
}
/**
*
* Specifies the number of initial requests that should be sent upstream.
* Must be at least 1.
* Defaults to 1.
* [#not-implemented-hide:]
*
*
* .google.protobuf.UInt32Value initial_requests = 1 [(.validate.rules) = { ... }
*/
@java.lang.Override
public com.google.protobuf.UInt32ValueOrBuilder getInitialRequestsOrBuilder() {
return initialRequests_ == null ? com.google.protobuf.UInt32Value.getDefaultInstance() : initialRequests_;
}
public static final int ADDITIONAL_REQUEST_CHANCE_FIELD_NUMBER = 2;
private io.envoyproxy.envoy.type.v3.FractionalPercent additionalRequestChance_;
/**
*
* Specifies a probability that an additional upstream request should be sent
* on top of what is specified by initial_requests.
* Defaults to 0.
* [#not-implemented-hide:]
*
*
* .envoy.type.v3.FractionalPercent additional_request_chance = 2;
* @return Whether the additionalRequestChance field is set.
*/
@java.lang.Override
public boolean hasAdditionalRequestChance() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
* Specifies a probability that an additional upstream request should be sent
* on top of what is specified by initial_requests.
* Defaults to 0.
* [#not-implemented-hide:]
*
*
* .envoy.type.v3.FractionalPercent additional_request_chance = 2;
* @return The additionalRequestChance.
*/
@java.lang.Override
public io.envoyproxy.envoy.type.v3.FractionalPercent getAdditionalRequestChance() {
return additionalRequestChance_ == null ? io.envoyproxy.envoy.type.v3.FractionalPercent.getDefaultInstance() : additionalRequestChance_;
}
/**
*
* Specifies a probability that an additional upstream request should be sent
* on top of what is specified by initial_requests.
* Defaults to 0.
* [#not-implemented-hide:]
*
*
* .envoy.type.v3.FractionalPercent additional_request_chance = 2;
*/
@java.lang.Override
public io.envoyproxy.envoy.type.v3.FractionalPercentOrBuilder getAdditionalRequestChanceOrBuilder() {
return additionalRequestChance_ == null ? io.envoyproxy.envoy.type.v3.FractionalPercent.getDefaultInstance() : additionalRequestChance_;
}
public static final int HEDGE_ON_PER_TRY_TIMEOUT_FIELD_NUMBER = 3;
private boolean hedgeOnPerTryTimeout_ = false;
/**
*
* Indicates that a hedged request should be sent when the per-try timeout is hit.
* This means that a retry will be issued without resetting the original request, leaving multiple upstream requests in flight.
* The first request to complete successfully will be the one returned to the caller.
*
* * At any time, a successful response (i.e. not triggering any of the retry-on conditions) would be returned to the client.
* * Before per-try timeout, an error response (per retry-on conditions) would be retried immediately or returned ot the client
* if there are no more retries left.
* * After per-try timeout, an error response would be discarded, as a retry in the form of a hedged request is already in progress.
*
* Note: For this to have effect, you must have a :ref:`RetryPolicy <envoy_v3_api_msg_config.route.v3.RetryPolicy>` that retries at least
* one error code and specifies a maximum number of retries.
*
* Defaults to false.
*
*
* bool hedge_on_per_try_timeout = 3;
* @return The hedgeOnPerTryTimeout.
*/
@java.lang.Override
public boolean getHedgeOnPerTryTimeout() {
return hedgeOnPerTryTimeout_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(1, getInitialRequests());
}
if (((bitField0_ & 0x00000002) != 0)) {
output.writeMessage(2, getAdditionalRequestChance());
}
if (hedgeOnPerTryTimeout_ != false) {
output.writeBool(3, hedgeOnPerTryTimeout_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getInitialRequests());
}
if (((bitField0_ & 0x00000002) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getAdditionalRequestChance());
}
if (hedgeOnPerTryTimeout_ != false) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(3, hedgeOnPerTryTimeout_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof io.envoyproxy.envoy.config.route.v3.HedgePolicy)) {
return super.equals(obj);
}
io.envoyproxy.envoy.config.route.v3.HedgePolicy other = (io.envoyproxy.envoy.config.route.v3.HedgePolicy) obj;
if (hasInitialRequests() != other.hasInitialRequests()) return false;
if (hasInitialRequests()) {
if (!getInitialRequests()
.equals(other.getInitialRequests())) return false;
}
if (hasAdditionalRequestChance() != other.hasAdditionalRequestChance()) return false;
if (hasAdditionalRequestChance()) {
if (!getAdditionalRequestChance()
.equals(other.getAdditionalRequestChance())) return false;
}
if (getHedgeOnPerTryTimeout()
!= other.getHedgeOnPerTryTimeout()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasInitialRequests()) {
hash = (37 * hash) + INITIAL_REQUESTS_FIELD_NUMBER;
hash = (53 * hash) + getInitialRequests().hashCode();
}
if (hasAdditionalRequestChance()) {
hash = (37 * hash) + ADDITIONAL_REQUEST_CHANCE_FIELD_NUMBER;
hash = (53 * hash) + getAdditionalRequestChance().hashCode();
}
hash = (37 * hash) + HEDGE_ON_PER_TRY_TIMEOUT_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getHedgeOnPerTryTimeout());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.envoyproxy.envoy.config.route.v3.HedgePolicy parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.config.route.v3.HedgePolicy parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.config.route.v3.HedgePolicy parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.config.route.v3.HedgePolicy parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.config.route.v3.HedgePolicy parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.config.route.v3.HedgePolicy parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.config.route.v3.HedgePolicy parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.config.route.v3.HedgePolicy parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.envoyproxy.envoy.config.route.v3.HedgePolicy parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.config.route.v3.HedgePolicy parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.envoyproxy.envoy.config.route.v3.HedgePolicy parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.config.route.v3.HedgePolicy parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.envoyproxy.envoy.config.route.v3.HedgePolicy prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* HTTP request hedging :ref:`architecture overview <arch_overview_http_routing_hedging>`.
*
*
* Protobuf type {@code envoy.config.route.v3.HedgePolicy}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:envoy.config.route.v3.HedgePolicy)
io.envoyproxy.envoy.config.route.v3.HedgePolicyOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.envoyproxy.envoy.config.route.v3.RouteComponentsProto.internal_static_envoy_config_route_v3_HedgePolicy_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.envoyproxy.envoy.config.route.v3.RouteComponentsProto.internal_static_envoy_config_route_v3_HedgePolicy_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.envoyproxy.envoy.config.route.v3.HedgePolicy.class, io.envoyproxy.envoy.config.route.v3.HedgePolicy.Builder.class);
}
// Construct using io.envoyproxy.envoy.config.route.v3.HedgePolicy.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getInitialRequestsFieldBuilder();
getAdditionalRequestChanceFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
initialRequests_ = null;
if (initialRequestsBuilder_ != null) {
initialRequestsBuilder_.dispose();
initialRequestsBuilder_ = null;
}
additionalRequestChance_ = null;
if (additionalRequestChanceBuilder_ != null) {
additionalRequestChanceBuilder_.dispose();
additionalRequestChanceBuilder_ = null;
}
hedgeOnPerTryTimeout_ = false;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.envoyproxy.envoy.config.route.v3.RouteComponentsProto.internal_static_envoy_config_route_v3_HedgePolicy_descriptor;
}
@java.lang.Override
public io.envoyproxy.envoy.config.route.v3.HedgePolicy getDefaultInstanceForType() {
return io.envoyproxy.envoy.config.route.v3.HedgePolicy.getDefaultInstance();
}
@java.lang.Override
public io.envoyproxy.envoy.config.route.v3.HedgePolicy build() {
io.envoyproxy.envoy.config.route.v3.HedgePolicy result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.envoyproxy.envoy.config.route.v3.HedgePolicy buildPartial() {
io.envoyproxy.envoy.config.route.v3.HedgePolicy result = new io.envoyproxy.envoy.config.route.v3.HedgePolicy(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(io.envoyproxy.envoy.config.route.v3.HedgePolicy result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.initialRequests_ = initialRequestsBuilder_ == null
? initialRequests_
: initialRequestsBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.additionalRequestChance_ = additionalRequestChanceBuilder_ == null
? additionalRequestChance_
: additionalRequestChanceBuilder_.build();
to_bitField0_ |= 0x00000002;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.hedgeOnPerTryTimeout_ = hedgeOnPerTryTimeout_;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.envoyproxy.envoy.config.route.v3.HedgePolicy) {
return mergeFrom((io.envoyproxy.envoy.config.route.v3.HedgePolicy)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.envoyproxy.envoy.config.route.v3.HedgePolicy other) {
if (other == io.envoyproxy.envoy.config.route.v3.HedgePolicy.getDefaultInstance()) return this;
if (other.hasInitialRequests()) {
mergeInitialRequests(other.getInitialRequests());
}
if (other.hasAdditionalRequestChance()) {
mergeAdditionalRequestChance(other.getAdditionalRequestChance());
}
if (other.getHedgeOnPerTryTimeout() != false) {
setHedgeOnPerTryTimeout(other.getHedgeOnPerTryTimeout());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
input.readMessage(
getInitialRequestsFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000001;
break;
} // case 10
case 18: {
input.readMessage(
getAdditionalRequestChanceFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000002;
break;
} // case 18
case 24: {
hedgeOnPerTryTimeout_ = input.readBool();
bitField0_ |= 0x00000004;
break;
} // case 24
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private com.google.protobuf.UInt32Value initialRequests_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.UInt32Value, com.google.protobuf.UInt32Value.Builder, com.google.protobuf.UInt32ValueOrBuilder> initialRequestsBuilder_;
/**
*
* Specifies the number of initial requests that should be sent upstream.
* Must be at least 1.
* Defaults to 1.
* [#not-implemented-hide:]
*
*
* .google.protobuf.UInt32Value initial_requests = 1 [(.validate.rules) = { ... }
* @return Whether the initialRequests field is set.
*/
public boolean hasInitialRequests() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* Specifies the number of initial requests that should be sent upstream.
* Must be at least 1.
* Defaults to 1.
* [#not-implemented-hide:]
*
*
* .google.protobuf.UInt32Value initial_requests = 1 [(.validate.rules) = { ... }
* @return The initialRequests.
*/
public com.google.protobuf.UInt32Value getInitialRequests() {
if (initialRequestsBuilder_ == null) {
return initialRequests_ == null ? com.google.protobuf.UInt32Value.getDefaultInstance() : initialRequests_;
} else {
return initialRequestsBuilder_.getMessage();
}
}
/**
*
* Specifies the number of initial requests that should be sent upstream.
* Must be at least 1.
* Defaults to 1.
* [#not-implemented-hide:]
*
*
* .google.protobuf.UInt32Value initial_requests = 1 [(.validate.rules) = { ... }
*/
public Builder setInitialRequests(com.google.protobuf.UInt32Value value) {
if (initialRequestsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
initialRequests_ = value;
} else {
initialRequestsBuilder_.setMessage(value);
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
* Specifies the number of initial requests that should be sent upstream.
* Must be at least 1.
* Defaults to 1.
* [#not-implemented-hide:]
*
*
* .google.protobuf.UInt32Value initial_requests = 1 [(.validate.rules) = { ... }
*/
public Builder setInitialRequests(
com.google.protobuf.UInt32Value.Builder builderForValue) {
if (initialRequestsBuilder_ == null) {
initialRequests_ = builderForValue.build();
} else {
initialRequestsBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
* Specifies the number of initial requests that should be sent upstream.
* Must be at least 1.
* Defaults to 1.
* [#not-implemented-hide:]
*
*
* .google.protobuf.UInt32Value initial_requests = 1 [(.validate.rules) = { ... }
*/
public Builder mergeInitialRequests(com.google.protobuf.UInt32Value value) {
if (initialRequestsBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0) &&
initialRequests_ != null &&
initialRequests_ != com.google.protobuf.UInt32Value.getDefaultInstance()) {
getInitialRequestsBuilder().mergeFrom(value);
} else {
initialRequests_ = value;
}
} else {
initialRequestsBuilder_.mergeFrom(value);
}
if (initialRequests_ != null) {
bitField0_ |= 0x00000001;
onChanged();
}
return this;
}
/**
*
* Specifies the number of initial requests that should be sent upstream.
* Must be at least 1.
* Defaults to 1.
* [#not-implemented-hide:]
*
*
* .google.protobuf.UInt32Value initial_requests = 1 [(.validate.rules) = { ... }
*/
public Builder clearInitialRequests() {
bitField0_ = (bitField0_ & ~0x00000001);
initialRequests_ = null;
if (initialRequestsBuilder_ != null) {
initialRequestsBuilder_.dispose();
initialRequestsBuilder_ = null;
}
onChanged();
return this;
}
/**
*
* Specifies the number of initial requests that should be sent upstream.
* Must be at least 1.
* Defaults to 1.
* [#not-implemented-hide:]
*
*
* .google.protobuf.UInt32Value initial_requests = 1 [(.validate.rules) = { ... }
*/
public com.google.protobuf.UInt32Value.Builder getInitialRequestsBuilder() {
bitField0_ |= 0x00000001;
onChanged();
return getInitialRequestsFieldBuilder().getBuilder();
}
/**
*
* Specifies the number of initial requests that should be sent upstream.
* Must be at least 1.
* Defaults to 1.
* [#not-implemented-hide:]
*
*
* .google.protobuf.UInt32Value initial_requests = 1 [(.validate.rules) = { ... }
*/
public com.google.protobuf.UInt32ValueOrBuilder getInitialRequestsOrBuilder() {
if (initialRequestsBuilder_ != null) {
return initialRequestsBuilder_.getMessageOrBuilder();
} else {
return initialRequests_ == null ?
com.google.protobuf.UInt32Value.getDefaultInstance() : initialRequests_;
}
}
/**
*
* Specifies the number of initial requests that should be sent upstream.
* Must be at least 1.
* Defaults to 1.
* [#not-implemented-hide:]
*
*
* .google.protobuf.UInt32Value initial_requests = 1 [(.validate.rules) = { ... }
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.UInt32Value, com.google.protobuf.UInt32Value.Builder, com.google.protobuf.UInt32ValueOrBuilder>
getInitialRequestsFieldBuilder() {
if (initialRequestsBuilder_ == null) {
initialRequestsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.UInt32Value, com.google.protobuf.UInt32Value.Builder, com.google.protobuf.UInt32ValueOrBuilder>(
getInitialRequests(),
getParentForChildren(),
isClean());
initialRequests_ = null;
}
return initialRequestsBuilder_;
}
private io.envoyproxy.envoy.type.v3.FractionalPercent additionalRequestChance_;
private com.google.protobuf.SingleFieldBuilderV3<
io.envoyproxy.envoy.type.v3.FractionalPercent, io.envoyproxy.envoy.type.v3.FractionalPercent.Builder, io.envoyproxy.envoy.type.v3.FractionalPercentOrBuilder> additionalRequestChanceBuilder_;
/**
*
* Specifies a probability that an additional upstream request should be sent
* on top of what is specified by initial_requests.
* Defaults to 0.
* [#not-implemented-hide:]
*
*
* .envoy.type.v3.FractionalPercent additional_request_chance = 2;
* @return Whether the additionalRequestChance field is set.
*/
public boolean hasAdditionalRequestChance() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
* Specifies a probability that an additional upstream request should be sent
* on top of what is specified by initial_requests.
* Defaults to 0.
* [#not-implemented-hide:]
*
*
* .envoy.type.v3.FractionalPercent additional_request_chance = 2;
* @return The additionalRequestChance.
*/
public io.envoyproxy.envoy.type.v3.FractionalPercent getAdditionalRequestChance() {
if (additionalRequestChanceBuilder_ == null) {
return additionalRequestChance_ == null ? io.envoyproxy.envoy.type.v3.FractionalPercent.getDefaultInstance() : additionalRequestChance_;
} else {
return additionalRequestChanceBuilder_.getMessage();
}
}
/**
*
* Specifies a probability that an additional upstream request should be sent
* on top of what is specified by initial_requests.
* Defaults to 0.
* [#not-implemented-hide:]
*
*
* .envoy.type.v3.FractionalPercent additional_request_chance = 2;
*/
public Builder setAdditionalRequestChance(io.envoyproxy.envoy.type.v3.FractionalPercent value) {
if (additionalRequestChanceBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
additionalRequestChance_ = value;
} else {
additionalRequestChanceBuilder_.setMessage(value);
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* Specifies a probability that an additional upstream request should be sent
* on top of what is specified by initial_requests.
* Defaults to 0.
* [#not-implemented-hide:]
*
*
* .envoy.type.v3.FractionalPercent additional_request_chance = 2;
*/
public Builder setAdditionalRequestChance(
io.envoyproxy.envoy.type.v3.FractionalPercent.Builder builderForValue) {
if (additionalRequestChanceBuilder_ == null) {
additionalRequestChance_ = builderForValue.build();
} else {
additionalRequestChanceBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* Specifies a probability that an additional upstream request should be sent
* on top of what is specified by initial_requests.
* Defaults to 0.
* [#not-implemented-hide:]
*
*
* .envoy.type.v3.FractionalPercent additional_request_chance = 2;
*/
public Builder mergeAdditionalRequestChance(io.envoyproxy.envoy.type.v3.FractionalPercent value) {
if (additionalRequestChanceBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0) &&
additionalRequestChance_ != null &&
additionalRequestChance_ != io.envoyproxy.envoy.type.v3.FractionalPercent.getDefaultInstance()) {
getAdditionalRequestChanceBuilder().mergeFrom(value);
} else {
additionalRequestChance_ = value;
}
} else {
additionalRequestChanceBuilder_.mergeFrom(value);
}
if (additionalRequestChance_ != null) {
bitField0_ |= 0x00000002;
onChanged();
}
return this;
}
/**
*
* Specifies a probability that an additional upstream request should be sent
* on top of what is specified by initial_requests.
* Defaults to 0.
* [#not-implemented-hide:]
*
*
* .envoy.type.v3.FractionalPercent additional_request_chance = 2;
*/
public Builder clearAdditionalRequestChance() {
bitField0_ = (bitField0_ & ~0x00000002);
additionalRequestChance_ = null;
if (additionalRequestChanceBuilder_ != null) {
additionalRequestChanceBuilder_.dispose();
additionalRequestChanceBuilder_ = null;
}
onChanged();
return this;
}
/**
*
* Specifies a probability that an additional upstream request should be sent
* on top of what is specified by initial_requests.
* Defaults to 0.
* [#not-implemented-hide:]
*
*
* .envoy.type.v3.FractionalPercent additional_request_chance = 2;
*/
public io.envoyproxy.envoy.type.v3.FractionalPercent.Builder getAdditionalRequestChanceBuilder() {
bitField0_ |= 0x00000002;
onChanged();
return getAdditionalRequestChanceFieldBuilder().getBuilder();
}
/**
*
* Specifies a probability that an additional upstream request should be sent
* on top of what is specified by initial_requests.
* Defaults to 0.
* [#not-implemented-hide:]
*
*
* .envoy.type.v3.FractionalPercent additional_request_chance = 2;
*/
public io.envoyproxy.envoy.type.v3.FractionalPercentOrBuilder getAdditionalRequestChanceOrBuilder() {
if (additionalRequestChanceBuilder_ != null) {
return additionalRequestChanceBuilder_.getMessageOrBuilder();
} else {
return additionalRequestChance_ == null ?
io.envoyproxy.envoy.type.v3.FractionalPercent.getDefaultInstance() : additionalRequestChance_;
}
}
/**
*
* Specifies a probability that an additional upstream request should be sent
* on top of what is specified by initial_requests.
* Defaults to 0.
* [#not-implemented-hide:]
*
*
* .envoy.type.v3.FractionalPercent additional_request_chance = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
io.envoyproxy.envoy.type.v3.FractionalPercent, io.envoyproxy.envoy.type.v3.FractionalPercent.Builder, io.envoyproxy.envoy.type.v3.FractionalPercentOrBuilder>
getAdditionalRequestChanceFieldBuilder() {
if (additionalRequestChanceBuilder_ == null) {
additionalRequestChanceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
io.envoyproxy.envoy.type.v3.FractionalPercent, io.envoyproxy.envoy.type.v3.FractionalPercent.Builder, io.envoyproxy.envoy.type.v3.FractionalPercentOrBuilder>(
getAdditionalRequestChance(),
getParentForChildren(),
isClean());
additionalRequestChance_ = null;
}
return additionalRequestChanceBuilder_;
}
private boolean hedgeOnPerTryTimeout_ ;
/**
*
* Indicates that a hedged request should be sent when the per-try timeout is hit.
* This means that a retry will be issued without resetting the original request, leaving multiple upstream requests in flight.
* The first request to complete successfully will be the one returned to the caller.
*
* * At any time, a successful response (i.e. not triggering any of the retry-on conditions) would be returned to the client.
* * Before per-try timeout, an error response (per retry-on conditions) would be retried immediately or returned ot the client
* if there are no more retries left.
* * After per-try timeout, an error response would be discarded, as a retry in the form of a hedged request is already in progress.
*
* Note: For this to have effect, you must have a :ref:`RetryPolicy <envoy_v3_api_msg_config.route.v3.RetryPolicy>` that retries at least
* one error code and specifies a maximum number of retries.
*
* Defaults to false.
*
*
* bool hedge_on_per_try_timeout = 3;
* @return The hedgeOnPerTryTimeout.
*/
@java.lang.Override
public boolean getHedgeOnPerTryTimeout() {
return hedgeOnPerTryTimeout_;
}
/**
*
* Indicates that a hedged request should be sent when the per-try timeout is hit.
* This means that a retry will be issued without resetting the original request, leaving multiple upstream requests in flight.
* The first request to complete successfully will be the one returned to the caller.
*
* * At any time, a successful response (i.e. not triggering any of the retry-on conditions) would be returned to the client.
* * Before per-try timeout, an error response (per retry-on conditions) would be retried immediately or returned ot the client
* if there are no more retries left.
* * After per-try timeout, an error response would be discarded, as a retry in the form of a hedged request is already in progress.
*
* Note: For this to have effect, you must have a :ref:`RetryPolicy <envoy_v3_api_msg_config.route.v3.RetryPolicy>` that retries at least
* one error code and specifies a maximum number of retries.
*
* Defaults to false.
*
*
* bool hedge_on_per_try_timeout = 3;
* @param value The hedgeOnPerTryTimeout to set.
* @return This builder for chaining.
*/
public Builder setHedgeOnPerTryTimeout(boolean value) {
hedgeOnPerTryTimeout_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
* Indicates that a hedged request should be sent when the per-try timeout is hit.
* This means that a retry will be issued without resetting the original request, leaving multiple upstream requests in flight.
* The first request to complete successfully will be the one returned to the caller.
*
* * At any time, a successful response (i.e. not triggering any of the retry-on conditions) would be returned to the client.
* * Before per-try timeout, an error response (per retry-on conditions) would be retried immediately or returned ot the client
* if there are no more retries left.
* * After per-try timeout, an error response would be discarded, as a retry in the form of a hedged request is already in progress.
*
* Note: For this to have effect, you must have a :ref:`RetryPolicy <envoy_v3_api_msg_config.route.v3.RetryPolicy>` that retries at least
* one error code and specifies a maximum number of retries.
*
* Defaults to false.
*
*
* bool hedge_on_per_try_timeout = 3;
* @return This builder for chaining.
*/
public Builder clearHedgeOnPerTryTimeout() {
bitField0_ = (bitField0_ & ~0x00000004);
hedgeOnPerTryTimeout_ = false;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:envoy.config.route.v3.HedgePolicy)
}
// @@protoc_insertion_point(class_scope:envoy.config.route.v3.HedgePolicy)
private static final io.envoyproxy.envoy.config.route.v3.HedgePolicy DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.envoyproxy.envoy.config.route.v3.HedgePolicy();
}
public static io.envoyproxy.envoy.config.route.v3.HedgePolicy getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public HedgePolicy parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public io.envoyproxy.envoy.config.route.v3.HedgePolicy getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy