Class LoadBalancingPolicy.Builder
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite.Builder
-
- com.google.protobuf.AbstractMessage.Builder<BuilderT>
-
- com.google.protobuf.GeneratedMessage.Builder<LoadBalancingPolicy.Builder>
-
- io.envoyproxy.envoy.config.cluster.v3.LoadBalancingPolicy.Builder
-
- All Implemented Interfaces:
com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,LoadBalancingPolicyOrBuilder,java.lang.Cloneable
- Enclosing class:
- LoadBalancingPolicy
public static final class LoadBalancingPolicy.Builder extends com.google.protobuf.GeneratedMessage.Builder<LoadBalancingPolicy.Builder> implements LoadBalancingPolicyOrBuilder
Extensible load balancing policy configuration. Every LB policy defined via this mechanism will be identified via a unique name using reverse DNS notation. If the policy needs configuration parameters, it must define a message for its own configuration, which will be stored in the config field. The name of the policy will tell clients which type of message they should expect to see in the config field. Note that there are cases where it is useful to be able to independently select LB policies for choosing a locality and for choosing an endpoint within that locality. For example, a given deployment may always use the same policy to choose the locality, but for choosing the endpoint within the locality, some clusters may use weighted-round-robin, while others may use some sort of session-based balancing. This can be accomplished via hierarchical LB policies, where the parent LB policy creates a child LB policy for each locality. For each request, the parent chooses the locality and then delegates to the child policy for that locality to choose the endpoint within the locality. To facilitate this, the config message for the top-level LB policy may include a field of type LoadBalancingPolicy that specifies the child policy.
Protobuf typeenvoy.config.cluster.v3.LoadBalancingPolicy
-
-
Field Summary
Fields Modifier and Type Field Description private intbitField0_private java.util.List<LoadBalancingPolicy.Policy>policies_private com.google.protobuf.RepeatedFieldBuilder<LoadBalancingPolicy.Policy,LoadBalancingPolicy.Policy.Builder,LoadBalancingPolicy.PolicyOrBuilder>policiesBuilder_
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LoadBalancingPolicy.BuilderaddAllPolicies(java.lang.Iterable<? extends LoadBalancingPolicy.Policy> values)Each client will iterate over the list in order and stop at the first policy that it supports.LoadBalancingPolicy.BuilderaddPolicies(int index, LoadBalancingPolicy.Policy value)Each client will iterate over the list in order and stop at the first policy that it supports.LoadBalancingPolicy.BuilderaddPolicies(int index, LoadBalancingPolicy.Policy.Builder builderForValue)Each client will iterate over the list in order and stop at the first policy that it supports.LoadBalancingPolicy.BuilderaddPolicies(LoadBalancingPolicy.Policy value)Each client will iterate over the list in order and stop at the first policy that it supports.LoadBalancingPolicy.BuilderaddPolicies(LoadBalancingPolicy.Policy.Builder builderForValue)Each client will iterate over the list in order and stop at the first policy that it supports.LoadBalancingPolicy.Policy.BuilderaddPoliciesBuilder()Each client will iterate over the list in order and stop at the first policy that it supports.LoadBalancingPolicy.Policy.BuilderaddPoliciesBuilder(int index)Each client will iterate over the list in order and stop at the first policy that it supports.LoadBalancingPolicybuild()LoadBalancingPolicybuildPartial()private voidbuildPartial0(LoadBalancingPolicy result)private voidbuildPartialRepeatedFields(LoadBalancingPolicy result)LoadBalancingPolicy.Builderclear()LoadBalancingPolicy.BuilderclearPolicies()Each client will iterate over the list in order and stop at the first policy that it supports.private voidensurePoliciesIsMutable()LoadBalancingPolicygetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()com.google.protobuf.Descriptors.DescriptorgetDescriptorForType()LoadBalancingPolicy.PolicygetPolicies(int index)Each client will iterate over the list in order and stop at the first policy that it supports.LoadBalancingPolicy.Policy.BuildergetPoliciesBuilder(int index)Each client will iterate over the list in order and stop at the first policy that it supports.java.util.List<LoadBalancingPolicy.Policy.Builder>getPoliciesBuilderList()Each client will iterate over the list in order and stop at the first policy that it supports.intgetPoliciesCount()Each client will iterate over the list in order and stop at the first policy that it supports.private com.google.protobuf.RepeatedFieldBuilder<LoadBalancingPolicy.Policy,LoadBalancingPolicy.Policy.Builder,LoadBalancingPolicy.PolicyOrBuilder>getPoliciesFieldBuilder()java.util.List<LoadBalancingPolicy.Policy>getPoliciesList()Each client will iterate over the list in order and stop at the first policy that it supports.LoadBalancingPolicy.PolicyOrBuildergetPoliciesOrBuilder(int index)Each client will iterate over the list in order and stop at the first policy that it supports.java.util.List<? extends LoadBalancingPolicy.PolicyOrBuilder>getPoliciesOrBuilderList()Each client will iterate over the list in order and stop at the first policy that it supports.protected com.google.protobuf.GeneratedMessage.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()LoadBalancingPolicy.BuildermergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)LoadBalancingPolicy.BuildermergeFrom(com.google.protobuf.Message other)LoadBalancingPolicy.BuildermergeFrom(LoadBalancingPolicy other)LoadBalancingPolicy.BuilderremovePolicies(int index)Each client will iterate over the list in order and stop at the first policy that it supports.LoadBalancingPolicy.BuildersetPolicies(int index, LoadBalancingPolicy.Policy value)Each client will iterate over the list in order and stop at the first policy that it supports.LoadBalancingPolicy.BuildersetPolicies(int index, LoadBalancingPolicy.Policy.Builder builderForValue)Each client will iterate over the list in order and stop at the first policy that it supports.-
Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3
-
Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
bitField0_
private int bitField0_
-
policies_
private java.util.List<LoadBalancingPolicy.Policy> policies_
-
policiesBuilder_
private com.google.protobuf.RepeatedFieldBuilder<LoadBalancingPolicy.Policy,LoadBalancingPolicy.Policy.Builder,LoadBalancingPolicy.PolicyOrBuilder> policiesBuilder_
-
-
Method Detail
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<LoadBalancingPolicy.Builder>
-
clear
public LoadBalancingPolicy.Builder clear()
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<LoadBalancingPolicy.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<LoadBalancingPolicy.Builder>
-
getDefaultInstanceForType
public LoadBalancingPolicy getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
public LoadBalancingPolicy build()
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public LoadBalancingPolicy buildPartial()
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartialRepeatedFields
private void buildPartialRepeatedFields(LoadBalancingPolicy result)
-
buildPartial0
private void buildPartial0(LoadBalancingPolicy result)
-
mergeFrom
public LoadBalancingPolicy.Builder mergeFrom(com.google.protobuf.Message other)
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<LoadBalancingPolicy.Builder>
-
mergeFrom
public LoadBalancingPolicy.Builder mergeFrom(LoadBalancingPolicy other)
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<LoadBalancingPolicy.Builder>
-
mergeFrom
public LoadBalancingPolicy.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<LoadBalancingPolicy.Builder>- Throws:
java.io.IOException
-
ensurePoliciesIsMutable
private void ensurePoliciesIsMutable()
-
getPoliciesList
public java.util.List<LoadBalancingPolicy.Policy> getPoliciesList()
Each client will iterate over the list in order and stop at the first policy that it supports. This provides a mechanism for starting to use new LB policies that are not yet supported by all clients.
repeated .envoy.config.cluster.v3.LoadBalancingPolicy.Policy policies = 1;- Specified by:
getPoliciesListin interfaceLoadBalancingPolicyOrBuilder
-
getPoliciesCount
public int getPoliciesCount()
Each client will iterate over the list in order and stop at the first policy that it supports. This provides a mechanism for starting to use new LB policies that are not yet supported by all clients.
repeated .envoy.config.cluster.v3.LoadBalancingPolicy.Policy policies = 1;- Specified by:
getPoliciesCountin interfaceLoadBalancingPolicyOrBuilder
-
getPolicies
public LoadBalancingPolicy.Policy getPolicies(int index)
Each client will iterate over the list in order and stop at the first policy that it supports. This provides a mechanism for starting to use new LB policies that are not yet supported by all clients.
repeated .envoy.config.cluster.v3.LoadBalancingPolicy.Policy policies = 1;- Specified by:
getPoliciesin interfaceLoadBalancingPolicyOrBuilder
-
setPolicies
public LoadBalancingPolicy.Builder setPolicies(int index, LoadBalancingPolicy.Policy value)
Each client will iterate over the list in order and stop at the first policy that it supports. This provides a mechanism for starting to use new LB policies that are not yet supported by all clients.
repeated .envoy.config.cluster.v3.LoadBalancingPolicy.Policy policies = 1;
-
setPolicies
public LoadBalancingPolicy.Builder setPolicies(int index, LoadBalancingPolicy.Policy.Builder builderForValue)
Each client will iterate over the list in order and stop at the first policy that it supports. This provides a mechanism for starting to use new LB policies that are not yet supported by all clients.
repeated .envoy.config.cluster.v3.LoadBalancingPolicy.Policy policies = 1;
-
addPolicies
public LoadBalancingPolicy.Builder addPolicies(LoadBalancingPolicy.Policy value)
Each client will iterate over the list in order and stop at the first policy that it supports. This provides a mechanism for starting to use new LB policies that are not yet supported by all clients.
repeated .envoy.config.cluster.v3.LoadBalancingPolicy.Policy policies = 1;
-
addPolicies
public LoadBalancingPolicy.Builder addPolicies(int index, LoadBalancingPolicy.Policy value)
Each client will iterate over the list in order and stop at the first policy that it supports. This provides a mechanism for starting to use new LB policies that are not yet supported by all clients.
repeated .envoy.config.cluster.v3.LoadBalancingPolicy.Policy policies = 1;
-
addPolicies
public LoadBalancingPolicy.Builder addPolicies(LoadBalancingPolicy.Policy.Builder builderForValue)
Each client will iterate over the list in order and stop at the first policy that it supports. This provides a mechanism for starting to use new LB policies that are not yet supported by all clients.
repeated .envoy.config.cluster.v3.LoadBalancingPolicy.Policy policies = 1;
-
addPolicies
public LoadBalancingPolicy.Builder addPolicies(int index, LoadBalancingPolicy.Policy.Builder builderForValue)
Each client will iterate over the list in order and stop at the first policy that it supports. This provides a mechanism for starting to use new LB policies that are not yet supported by all clients.
repeated .envoy.config.cluster.v3.LoadBalancingPolicy.Policy policies = 1;
-
addAllPolicies
public LoadBalancingPolicy.Builder addAllPolicies(java.lang.Iterable<? extends LoadBalancingPolicy.Policy> values)
Each client will iterate over the list in order and stop at the first policy that it supports. This provides a mechanism for starting to use new LB policies that are not yet supported by all clients.
repeated .envoy.config.cluster.v3.LoadBalancingPolicy.Policy policies = 1;
-
clearPolicies
public LoadBalancingPolicy.Builder clearPolicies()
Each client will iterate over the list in order and stop at the first policy that it supports. This provides a mechanism for starting to use new LB policies that are not yet supported by all clients.
repeated .envoy.config.cluster.v3.LoadBalancingPolicy.Policy policies = 1;
-
removePolicies
public LoadBalancingPolicy.Builder removePolicies(int index)
Each client will iterate over the list in order and stop at the first policy that it supports. This provides a mechanism for starting to use new LB policies that are not yet supported by all clients.
repeated .envoy.config.cluster.v3.LoadBalancingPolicy.Policy policies = 1;
-
getPoliciesBuilder
public LoadBalancingPolicy.Policy.Builder getPoliciesBuilder(int index)
Each client will iterate over the list in order and stop at the first policy that it supports. This provides a mechanism for starting to use new LB policies that are not yet supported by all clients.
repeated .envoy.config.cluster.v3.LoadBalancingPolicy.Policy policies = 1;
-
getPoliciesOrBuilder
public LoadBalancingPolicy.PolicyOrBuilder getPoliciesOrBuilder(int index)
Each client will iterate over the list in order and stop at the first policy that it supports. This provides a mechanism for starting to use new LB policies that are not yet supported by all clients.
repeated .envoy.config.cluster.v3.LoadBalancingPolicy.Policy policies = 1;- Specified by:
getPoliciesOrBuilderin interfaceLoadBalancingPolicyOrBuilder
-
getPoliciesOrBuilderList
public java.util.List<? extends LoadBalancingPolicy.PolicyOrBuilder> getPoliciesOrBuilderList()
Each client will iterate over the list in order and stop at the first policy that it supports. This provides a mechanism for starting to use new LB policies that are not yet supported by all clients.
repeated .envoy.config.cluster.v3.LoadBalancingPolicy.Policy policies = 1;- Specified by:
getPoliciesOrBuilderListin interfaceLoadBalancingPolicyOrBuilder
-
addPoliciesBuilder
public LoadBalancingPolicy.Policy.Builder addPoliciesBuilder()
Each client will iterate over the list in order and stop at the first policy that it supports. This provides a mechanism for starting to use new LB policies that are not yet supported by all clients.
repeated .envoy.config.cluster.v3.LoadBalancingPolicy.Policy policies = 1;
-
addPoliciesBuilder
public LoadBalancingPolicy.Policy.Builder addPoliciesBuilder(int index)
Each client will iterate over the list in order and stop at the first policy that it supports. This provides a mechanism for starting to use new LB policies that are not yet supported by all clients.
repeated .envoy.config.cluster.v3.LoadBalancingPolicy.Policy policies = 1;
-
getPoliciesBuilderList
public java.util.List<LoadBalancingPolicy.Policy.Builder> getPoliciesBuilderList()
Each client will iterate over the list in order and stop at the first policy that it supports. This provides a mechanism for starting to use new LB policies that are not yet supported by all clients.
repeated .envoy.config.cluster.v3.LoadBalancingPolicy.Policy policies = 1;
-
getPoliciesFieldBuilder
private com.google.protobuf.RepeatedFieldBuilder<LoadBalancingPolicy.Policy,LoadBalancingPolicy.Policy.Builder,LoadBalancingPolicy.PolicyOrBuilder> getPoliciesFieldBuilder()
-
-