Browse Source

Add comments

pull/15701/head
Chris S. Kim 2 years ago
parent
commit
e8be8e4d55
  1. 8
      agent/grpc-internal/balancer/custombalancer.go
  2. 2
      agent/grpc-internal/balancer/pickfirst.go

8
agent/grpc-internal/balancer/custombalancer.go

@ -11,9 +11,8 @@ func init() {
balancer.Register(newCustomPickfirstBuilder())
}
// CustomBalancerName is the name of the modified pick_first balancer.
const CustomBalancerName = "pick_first_custom"
// logger is referenced in pickfirst.go.
// The gRPC library uses the same component name.
var logger = grpclog.Component("balancer")
func newCustomPickfirstBuilder() balancer.Builder {
@ -29,9 +28,10 @@ func (*customPickfirstBuilder) Build(cc balancer.ClientConn, opt balancer.BuildO
}
func (*customPickfirstBuilder) Name() string {
return CustomBalancerName
return "pick_first_custom"
}
// customPickfirstBalancer overrides UpdateClientConnState of pickfirstBalancer.
type customPickfirstBalancer struct {
pickfirstBalancer

2
agent/grpc-internal/balancer/pickfirst.go

@ -1,4 +1,4 @@
// NOTICE: This file is a derivative of grpc's pick_first implementation [1].
// NOTICE: This file is a copy of grpc's pick_first implementation [1].
// It is preserved as-is with the init() removed for easier updating.
//
// [1]: https://github.com/grpc/grpc-go/blob/v1.49.x/pickfirst.go

Loading…
Cancel
Save