// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.10
// 	protoc        v6.33.2
// source: envoy/extensions/load_balancing_policies/least_request/v3/least_request.proto

package least_requestv3

import (
	_ "github.com/cncf/xds/go/udpa/annotations"
	_ "github.com/envoyproxy/go-control-plane/envoy/annotations"
	v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
	v31 "github.com/envoyproxy/go-control-plane/envoy/extensions/load_balancing_policies/common/v3"
	_ "github.com/envoyproxy/protoc-gen-validate/validate"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

// Available methods for selecting the host set from which to return the host with the
// fewest active requests.
type LeastRequest_SelectionMethod int32

const (
	// Return host with fewest requests from a set of “choice_count“ randomly selected hosts.
	// Best selection method for most scenarios.
	LeastRequest_N_CHOICES LeastRequest_SelectionMethod = 0
	// Return host with fewest requests from all hosts.
	// Useful in some niche use cases involving low request rates and one of:
	// (example 1) low request limits on workloads, or (example 2) few hosts.
	//
	// Example 1: Consider a workload type that can only accept one connection at a time.
	// If such workloads are deployed across many hosts, only a small percentage of those
	// workloads have zero connections at any given time, and the rate of new connections is low,
	// the “FULL_SCAN“ method is more likely to select a suitable host than “N_CHOICES“.
	//
	// Example 2: Consider a workload type that is only deployed on 2 hosts. With default settings,
	// the “N_CHOICES“ method will return the host with more active requests 25% of the time.
	// If the request rate is sufficiently low, the behavior of always selecting the host with least
	// requests as of the last metrics refresh may be preferable.
	LeastRequest_FULL_SCAN LeastRequest_SelectionMethod = 1
)

// Enum value maps for LeastRequest_SelectionMethod.
var (
	LeastRequest_SelectionMethod_name = map[int32]string{
		0: "N_CHOICES",
		1: "FULL_SCAN",
	}
	LeastRequest_SelectionMethod_value = map[string]int32{
		"N_CHOICES": 0,
		"FULL_SCAN": 1,
	}
)

func (x LeastRequest_SelectionMethod) Enum() *LeastRequest_SelectionMethod {
	p := new(LeastRequest_SelectionMethod)
	*p = x
	return p
}

func (x LeastRequest_SelectionMethod) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (LeastRequest_SelectionMethod) Descriptor() protoreflect.EnumDescriptor {
	return file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_enumTypes[0].Descriptor()
}

func (LeastRequest_SelectionMethod) Type() protoreflect.EnumType {
	return &file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_enumTypes[0]
}

func (x LeastRequest_SelectionMethod) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use LeastRequest_SelectionMethod.Descriptor instead.
func (LeastRequest_SelectionMethod) EnumDescriptor() ([]byte, []int) {
	return file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_rawDescGZIP(), []int{0, 0}
}

// This configuration allows the built-in LEAST_REQUEST LB policy to be configured via the LB policy
// extension point. See the :ref:`load balancing architecture overview
// <arch_overview_load_balancing_types>` for more information.
// [#next-free-field: 7]
type LeastRequest struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The number of random healthy hosts from which the host with the fewest active requests will
	// be chosen. Defaults to 2 so that we perform two-choice selection if the field is not set.
	// Only applies to the “N_CHOICES“ selection method.
	ChoiceCount *wrapperspb.UInt32Value `protobuf:"bytes,1,opt,name=choice_count,json=choiceCount,proto3" json:"choice_count,omitempty"`
	// The following formula is used to calculate the dynamic weights when hosts have different load
	// balancing weights:
	//
	// “weight = load_balancing_weight / (active_requests + 1)^active_request_bias“
	//
	// The larger the active request bias is, the more aggressively active requests will lower the
	// effective weight when all host weights are not equal.
	//
	// “active_request_bias“ must be greater than or equal to 0.0.
	//
	// When “active_request_bias == 0.0“ the Least Request Load Balancer doesn't consider the number
	// of active requests at the time it picks a host and behaves like the Round Robin Load
	// Balancer.
	//
	// When “active_request_bias > 0.0“ the Least Request Load Balancer scales the load balancing
	// weight by the number of active requests at the time it does a pick.
	//
	// The value is cached for performance reasons and refreshed whenever one of the Load Balancer's
	// host sets changes, e.g., whenever there is a host membership update or a host load balancing
	// weight change.
	//
	// .. note::
	//
	//	This setting only takes effect if all host weights are not equal.
	ActiveRequestBias *v3.RuntimeDouble `protobuf:"bytes,2,opt,name=active_request_bias,json=activeRequestBias,proto3" json:"active_request_bias,omitempty"`
	// Configuration for slow start mode.
	// If this configuration is not set, slow start will not be not enabled.
	SlowStartConfig *v31.SlowStartConfig `protobuf:"bytes,3,opt,name=slow_start_config,json=slowStartConfig,proto3" json:"slow_start_config,omitempty"`
	// Configuration for local zone aware load balancing or locality weighted load balancing.
	LocalityLbConfig *v31.LocalityLbConfig `protobuf:"bytes,4,opt,name=locality_lb_config,json=localityLbConfig,proto3" json:"locality_lb_config,omitempty"`
	// [#not-implemented-hide:]
	// Unused. Replaced by the `selection_method` enum for better extensibility.
	//
	// Deprecated: Marked as deprecated in envoy/extensions/load_balancing_policies/least_request/v3/least_request.proto.
	EnableFullScan *wrapperspb.BoolValue `protobuf:"bytes,5,opt,name=enable_full_scan,json=enableFullScan,proto3" json:"enable_full_scan,omitempty"`
	// Method for selecting the host set from which to return the host with the fewest active requests.
	//
	// Defaults to “N_CHOICES“.
	SelectionMethod LeastRequest_SelectionMethod `protobuf:"varint,6,opt,name=selection_method,json=selectionMethod,proto3,enum=envoy.extensions.load_balancing_policies.least_request.v3.LeastRequest_SelectionMethod" json:"selection_method,omitempty"`
	unknownFields   protoimpl.UnknownFields
	sizeCache       protoimpl.SizeCache
}

func (x *LeastRequest) Reset() {
	*x = LeastRequest{}
	mi := &file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *LeastRequest) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*LeastRequest) ProtoMessage() {}

func (x *LeastRequest) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use LeastRequest.ProtoReflect.Descriptor instead.
func (*LeastRequest) Descriptor() ([]byte, []int) {
	return file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_rawDescGZIP(), []int{0}
}

func (x *LeastRequest) GetChoiceCount() *wrapperspb.UInt32Value {
	if x != nil {
		return x.ChoiceCount
	}
	return nil
}

func (x *LeastRequest) GetActiveRequestBias() *v3.RuntimeDouble {
	if x != nil {
		return x.ActiveRequestBias
	}
	return nil
}

func (x *LeastRequest) GetSlowStartConfig() *v31.SlowStartConfig {
	if x != nil {
		return x.SlowStartConfig
	}
	return nil
}

func (x *LeastRequest) GetLocalityLbConfig() *v31.LocalityLbConfig {
	if x != nil {
		return x.LocalityLbConfig
	}
	return nil
}

// Deprecated: Marked as deprecated in envoy/extensions/load_balancing_policies/least_request/v3/least_request.proto.
func (x *LeastRequest) GetEnableFullScan() *wrapperspb.BoolValue {
	if x != nil {
		return x.EnableFullScan
	}
	return nil
}

func (x *LeastRequest) GetSelectionMethod() LeastRequest_SelectionMethod {
	if x != nil {
		return x.SelectionMethod
	}
	return LeastRequest_N_CHOICES
}

var File_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto protoreflect.FileDescriptor

const file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_rawDesc = "" +
	"\n" +
	"Menvoy/extensions/load_balancing_policies/least_request/v3/least_request.proto\x129envoy.extensions.load_balancing_policies.least_request.v3\x1a\x1fenvoy/config/core/v3/base.proto\x1a?envoy/extensions/load_balancing_policies/common/v3/common.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a#envoy/annotations/deprecation.proto\x1a\x1dudpa/annotations/status.proto\x1a\x17validate/validate.proto\"\xa5\x05\n" +
	"\fLeastRequest\x12H\n" +
	"\fchoice_count\x18\x01 \x01(\v2\x1c.google.protobuf.UInt32ValueB\a\xfaB\x04*\x02(\x02R\vchoiceCount\x12S\n" +
	"\x13active_request_bias\x18\x02 \x01(\v2#.envoy.config.core.v3.RuntimeDoubleR\x11activeRequestBias\x12o\n" +
	"\x11slow_start_config\x18\x03 \x01(\v2C.envoy.extensions.load_balancing_policies.common.v3.SlowStartConfigR\x0fslowStartConfig\x12r\n" +
	"\x12locality_lb_config\x18\x04 \x01(\v2D.envoy.extensions.load_balancing_policies.common.v3.LocalityLbConfigR\x10localityLbConfig\x12Q\n" +
	"\x10enable_full_scan\x18\x05 \x01(\v2\x1a.google.protobuf.BoolValueB\v\x92ǆ\xd8\x04\x033.0\x18\x01R\x0eenableFullScan\x12\x8c\x01\n" +
	"\x10selection_method\x18\x06 \x01(\x0e2W.envoy.extensions.load_balancing_policies.least_request.v3.LeastRequest.SelectionMethodB\b\xfaB\x05\x82\x01\x02\x10\x01R\x0fselectionMethod\"/\n" +
	"\x0fSelectionMethod\x12\r\n" +
	"\tN_CHOICES\x10\x00\x12\r\n" +
	"\tFULL_SCAN\x10\x01B\xd8\x01\xba\x80\xc8\xd1\x06\x02\x10\x02\n" +
	"Gio.envoyproxy.envoy.extensions.load_balancing_policies.least_request.v3B\x11LeastRequestProtoP\x01Zpgithub.com/envoyproxy/go-control-plane/envoy/extensions/load_balancing_policies/least_request/v3;least_requestv3b\x06proto3"

var (
	file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_rawDescOnce sync.Once
	file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_rawDescData []byte
)

func file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_rawDescGZIP() []byte {
	file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_rawDescOnce.Do(func() {
		file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_rawDesc), len(file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_rawDesc)))
	})
	return file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_rawDescData
}

var file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_goTypes = []any{
	(LeastRequest_SelectionMethod)(0), // 0: envoy.extensions.load_balancing_policies.least_request.v3.LeastRequest.SelectionMethod
	(*LeastRequest)(nil),              // 1: envoy.extensions.load_balancing_policies.least_request.v3.LeastRequest
	(*wrapperspb.UInt32Value)(nil),    // 2: google.protobuf.UInt32Value
	(*v3.RuntimeDouble)(nil),          // 3: envoy.config.core.v3.RuntimeDouble
	(*v31.SlowStartConfig)(nil),       // 4: envoy.extensions.load_balancing_policies.common.v3.SlowStartConfig
	(*v31.LocalityLbConfig)(nil),      // 5: envoy.extensions.load_balancing_policies.common.v3.LocalityLbConfig
	(*wrapperspb.BoolValue)(nil),      // 6: google.protobuf.BoolValue
}
var file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_depIdxs = []int32{
	2, // 0: envoy.extensions.load_balancing_policies.least_request.v3.LeastRequest.choice_count:type_name -> google.protobuf.UInt32Value
	3, // 1: envoy.extensions.load_balancing_policies.least_request.v3.LeastRequest.active_request_bias:type_name -> envoy.config.core.v3.RuntimeDouble
	4, // 2: envoy.extensions.load_balancing_policies.least_request.v3.LeastRequest.slow_start_config:type_name -> envoy.extensions.load_balancing_policies.common.v3.SlowStartConfig
	5, // 3: envoy.extensions.load_balancing_policies.least_request.v3.LeastRequest.locality_lb_config:type_name -> envoy.extensions.load_balancing_policies.common.v3.LocalityLbConfig
	6, // 4: envoy.extensions.load_balancing_policies.least_request.v3.LeastRequest.enable_full_scan:type_name -> google.protobuf.BoolValue
	0, // 5: envoy.extensions.load_balancing_policies.least_request.v3.LeastRequest.selection_method:type_name -> envoy.extensions.load_balancing_policies.least_request.v3.LeastRequest.SelectionMethod
	6, // [6:6] is the sub-list for method output_type
	6, // [6:6] is the sub-list for method input_type
	6, // [6:6] is the sub-list for extension type_name
	6, // [6:6] is the sub-list for extension extendee
	0, // [0:6] is the sub-list for field type_name
}

func init() {
	file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_init()
}
func file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_init() {
	if File_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_rawDesc), len(file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   1,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_goTypes,
		DependencyIndexes: file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_depIdxs,
		EnumInfos:         file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_enumTypes,
		MessageInfos:      file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_msgTypes,
	}.Build()
	File_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto = out.File
	file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_goTypes = nil
	file_envoy_extensions_load_balancing_policies_least_request_v3_least_request_proto_depIdxs = nil
}
