From 6d242842f17bf7f0173c9d14915dfd4e433d5aa6 Mon Sep 17 00:00:00 2001 From: Arjan Bal Date: Thu, 5 Sep 2024 11:34:25 +0530 Subject: [PATCH] change package name to genericproducer --- balancer/pickfirstleaf/pickfirstleaf.go | 4 ++-- health/{producer => genericproducer}/generic_producer.go | 2 +- health/producer.go | 4 ++-- xds/internal/balancer/outlierdetection/balancer.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) rename health/{producer => genericproducer}/generic_producer.go (99%) diff --git a/balancer/pickfirstleaf/pickfirstleaf.go b/balancer/pickfirstleaf/pickfirstleaf.go index 3889645eee3e..3a96741d150c 100644 --- a/balancer/pickfirstleaf/pickfirstleaf.go +++ b/balancer/pickfirstleaf/pickfirstleaf.go @@ -30,7 +30,7 @@ import ( "google.golang.org/grpc/balancer" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/health/producer" + "google.golang.org/grpc/health/genericproducer" "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/envconfig" internalgrpclog "google.golang.org/grpc/internal/grpclog" @@ -491,7 +491,7 @@ func (b *pickfirstBalancer) updateSubConnState(sd *scData, state balancer.SubCon pb: b, } if sd.unregisterHealthListener == nil { - sd.unregisterHealthListener = producer.RegisterListener(hl, sd.subConn) + sd.unregisterHealthListener = genericproducer.RegisterListener(hl, sd.subConn) } else { // The health update may have already arrived. b.updateSubConnHealthState(sd) diff --git a/health/producer/generic_producer.go b/health/genericproducer/generic_producer.go similarity index 99% rename from health/producer/generic_producer.go rename to health/genericproducer/generic_producer.go index 5c0f9b5f22eb..c578ef0a78ea 100644 --- a/health/producer/generic_producer.go +++ b/health/genericproducer/generic_producer.go @@ -1,4 +1,4 @@ -package producer +package genericproducer import ( "context" diff --git a/health/producer.go b/health/producer.go index 7b04b1d84981..e8ef0d621beb 100644 --- a/health/producer.go +++ b/health/producer.go @@ -8,7 +8,7 @@ import ( "google.golang.org/grpc/balancer" "google.golang.org/grpc/codes" "google.golang.org/grpc/connectivity" - "google.golang.org/grpc/health/producer" + "google.golang.org/grpc/health/genericproducer" "google.golang.org/grpc/internal" "google.golang.org/grpc/status" ) @@ -110,7 +110,7 @@ func EnableHealthCheck(opts balancer.HealthCheckOptions, sc balancer.SubConn) fu return closeFn } var closeGenericProducer func() - p.listener, closeGenericProducer = producer.SwapRootListener(&noOpListener{p: p}, sc) + p.listener, closeGenericProducer = genericproducer.SwapRootListener(&noOpListener{p: p}, sc) ls := &subConnStateListener{ p: p, } diff --git a/xds/internal/balancer/outlierdetection/balancer.go b/xds/internal/balancer/outlierdetection/balancer.go index f600b7ed13e6..0c5c6d9b6162 100644 --- a/xds/internal/balancer/outlierdetection/balancer.go +++ b/xds/internal/balancer/outlierdetection/balancer.go @@ -35,7 +35,7 @@ import ( "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/pickfirstleaf" "google.golang.org/grpc/connectivity" - "google.golang.org/grpc/health/producer" + "google.golang.org/grpc/health/genericproducer" "google.golang.org/grpc/internal/balancer/gracefulswitch" "google.golang.org/grpc/internal/buffer" "google.golang.org/grpc/internal/channelz" @@ -530,7 +530,7 @@ func (b *outlierDetectionBalancer) NewSubConn(addrs []resolver.Address, opts bal genericHealthProducerEnabled: genericHealthProducerEnabled, } if genericHealthProducerEnabled { - scw.healthListener, scw.unregisterHealthListener = producer.SwapRootListener(&healthListener{ + scw.healthListener, scw.unregisterHealthListener = genericproducer.SwapRootListener(&healthListener{ b: b, sc: sc, }, sc)