From e8be8e4d55babae4dce7da6308d855ab606d7fe0 Mon Sep 17 00:00:00 2001 From: "Chris S. Kim" Date: Fri, 9 Dec 2022 12:08:43 -0500 Subject: [PATCH] Add comments --- agent/grpc-internal/balancer/custombalancer.go | 8 ++++---- agent/grpc-internal/balancer/pickfirst.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/agent/grpc-internal/balancer/custombalancer.go b/agent/grpc-internal/balancer/custombalancer.go index d689f14b5d..bec458424a 100644 --- a/agent/grpc-internal/balancer/custombalancer.go +++ b/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 diff --git a/agent/grpc-internal/balancer/pickfirst.go b/agent/grpc-internal/balancer/pickfirst.go index 009976c31c..6c5ca9b9a1 100644 --- a/agent/grpc-internal/balancer/pickfirst.go +++ b/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