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) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
if (initialRequestsBuilder_ == null) {
initialRequests_ = null;
} else {
initialRequests_ = null;
initialRequestsBuilder_ = null;
}
if (additionalRequestChanceBuilder_ == null) {
additionalRequestChance_ = null;
} else {
additionalRequestChance_ = null;
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 (initialRequestsBuilder_ == null) {
result.initialRequests_ = initialRequests_;
} else {
result.initialRequests_ = initialRequestsBuilder_.build();
}
if (additionalRequestChanceBuilder_ == null) {
result.additionalRequestChance_ = additionalRequestChance_;
} else {
result.additionalRequestChance_ = additionalRequestChanceBuilder_.build();
}
result.hedgeOnPerTryTimeout_ = hedgeOnPerTryTimeout_;
onBuilt();
return result;
}
@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.unknownFields);
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 {
io.envoyproxy.envoy.config.route.v3.HedgePolicy parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.envoyproxy.envoy.config.route.v3.HedgePolicy) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
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 initialRequestsBuilder_ != null || initialRequests_ != null;
}
/**
*
* 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;
onChanged();
} else {
initialRequestsBuilder_.setMessage(value);
}
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();
onChanged();
} else {
initialRequestsBuilder_.setMessage(builderForValue.build());
}
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 (initialRequests_ != null) {
initialRequests_ =
com.google.protobuf.UInt32Value.newBuilder(initialRequests_).mergeFrom(value).buildPartial();
} else {
initialRequests_ = value;
}
onChanged();
} else {
initialRequestsBuilder_.mergeFrom(value);
}
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() {
if (initialRequestsBuilder_ == null) {
initialRequests_ = null;
onChanged();
} else {
initialRequests_ = null;
initialRequestsBuilder_ = null;
}
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() {
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 additionalRequestChanceBuilder_ != null || additionalRequestChance_ != null;
}
/**
*
* 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;
onChanged();
} else {
additionalRequestChanceBuilder_.setMessage(value);
}
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();
onChanged();
} else {
additionalRequestChanceBuilder_.setMessage(builderForValue.build());
}
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 (additionalRequestChance_ != null) {
additionalRequestChance_ =
io.envoyproxy.envoy.type.v3.FractionalPercent.newBuilder(additionalRequestChance_).mergeFrom(value).buildPartial();
} else {
additionalRequestChance_ = value;
}
onChanged();
} else {
additionalRequestChanceBuilder_.mergeFrom(value);
}
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() {
if (additionalRequestChanceBuilder_ == null) {
additionalRequestChance_ = null;
onChanged();
} else {
additionalRequestChance_ = null;
additionalRequestChanceBuilder_ = null;
}
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() {
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;
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() {
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 {
return new HedgePolicy(input, extensionRegistry);
}
};
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;
}
}