Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions balancer/xds/lrs/lrs.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

// Package lrs implements load reporting service for xds balancer.
package lrs

import (
Expand All @@ -28,6 +29,7 @@ import (
"google.golang.org/grpc/balancer/xds/internal"
basepb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base"
loadreportpb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/endpoint/load_report"
lrsgrpc "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs"
lrspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/internal/backoff"
Expand Down Expand Up @@ -126,7 +128,7 @@ func (ls *lrsStore) buildStats() []*loadreportpb.ClusterStats {
//
// It retries the call (with backoff) until ctx is canceled.
func (ls *lrsStore) ReportTo(ctx context.Context, cc *grpc.ClientConn) {
c := lrspb.NewLoadReportingServiceClient(cc)
c := lrsgrpc.NewLoadReportingServiceClient(cc)
var (
retryCount int
doBackoff bool
Expand Down Expand Up @@ -188,7 +190,7 @@ func (ls *lrsStore) ReportTo(ctx context.Context, cc *grpc.ClientConn) {
}
}

func (ls *lrsStore) sendLoads(ctx context.Context, stream lrspb.LoadReportingService_StreamLoadStatsClient, clusterName string, interval time.Duration) {
func (ls *lrsStore) sendLoads(ctx context.Context, stream lrsgrpc.LoadReportingService_StreamLoadStatsClient, clusterName string, interval time.Duration) {
tick := time.NewTicker(interval)
defer tick.Stop()
for {
Expand Down
5 changes: 3 additions & 2 deletions balancer/xds/lrs/lrs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
"google.golang.org/grpc/balancer/xds/internal"
basepb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base"
loadreportpb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/endpoint/load_report"
lrsgrpc "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs"
lrspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down Expand Up @@ -136,7 +137,7 @@ type lrsServer struct {
reportingInterval *durationpb.Duration
}

func (lrss *lrsServer) StreamLoadStats(stream lrspb.LoadReportingService_StreamLoadStatsServer) error {
func (lrss *lrsServer) StreamLoadStats(stream lrsgrpc.LoadReportingService_StreamLoadStatsServer) error {
req, err := stream.Recv()
if err != nil {
return err
Expand Down Expand Up @@ -189,7 +190,7 @@ func setupServer(t *testing.T, reportingInterval *durationpb.Duration) (addr str
drops: make(map[string]uint64),
reportingInterval: reportingInterval,
}
lrspb.RegisterLoadReportingServiceServer(svr, lrss)
lrsgrpc.RegisterLoadReportingServiceServer(svr, lrss)
go svr.Serve(lis)
return lis.Addr().String(), lrss, func() {
svr.Stop()
Expand Down
6 changes: 3 additions & 3 deletions balancer/xds/xds_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
basepb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base"
discoverypb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/discovery"
edspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/eds"
adspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/discovery/v2/ads"
adsgrpc "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/discovery/v2/ads"
"google.golang.org/grpc/balancer/xds/lrs"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/internal/backoff"
Expand All @@ -60,7 +60,7 @@ var (
type client struct {
ctx context.Context
cancel context.CancelFunc
cli adspb.AggregatedDiscoveryServiceClient
cli adsgrpc.AggregatedDiscoveryServiceClient
opts balancer.BuildOptions
balancerName string // the traffic director name
serviceName string // the user dial target name
Expand Down Expand Up @@ -164,7 +164,7 @@ func (c *client) newEDSRequest() *discoverypb.DiscoveryRequest {
}

func (c *client) makeADSCall() {
c.cli = adspb.NewAggregatedDiscoveryServiceClient(c.cc)
c.cli = adsgrpc.NewAggregatedDiscoveryServiceClient(c.cc)
retryCount := 0
var doRetry bool

Expand Down
12 changes: 6 additions & 6 deletions balancer/xds/xds_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ import (
discoverypb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/discovery"
edspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/eds"
endpointpb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/endpoint/endpoint"
adspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/discovery/v2/ads"
lrspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs"
adsgrpc "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/discovery/v2/ads"
lrsgrpc "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/resolver"
"google.golang.org/grpc/status"
Expand Down Expand Up @@ -205,7 +205,7 @@ type response struct {
err error
}

func (ttd *testTrafficDirector) StreamAggregatedResources(s adspb.AggregatedDiscoveryService_StreamAggregatedResourcesServer) error {
func (ttd *testTrafficDirector) StreamAggregatedResources(s adsgrpc.AggregatedDiscoveryService_StreamAggregatedResourcesServer) error {
for {
req, err := s.Recv()
if err != nil {
Expand Down Expand Up @@ -242,7 +242,7 @@ func (ttd *testTrafficDirector) StreamAggregatedResources(s adspb.AggregatedDisc
}
}

func (ttd *testTrafficDirector) DeltaAggregatedResources(adspb.AggregatedDiscoveryService_DeltaAggregatedResourcesServer) error {
func (ttd *testTrafficDirector) DeltaAggregatedResources(adsgrpc.AggregatedDiscoveryService_DeltaAggregatedResourcesServer) error {
return status.Error(codes.Unimplemented, "")
}

Expand Down Expand Up @@ -284,8 +284,8 @@ func setupServer(t *testing.T) (addr string, td *testTrafficDirector, lrss *lrsS
Nanos: 0,
},
}
adspb.RegisterAggregatedDiscoveryServiceServer(svr, td)
lrspb.RegisterLoadReportingServiceServer(svr, lrss)
adsgrpc.RegisterAggregatedDiscoveryServiceServer(svr, td)
lrsgrpc.RegisterLoadReportingServiceServer(svr, lrss)
go svr.Serve(lis)
return lis.Addr().String(), td, lrss, func() {
svr.Stop()
Expand Down
3 changes: 2 additions & 1 deletion balancer/xds/xds_lrs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"google.golang.org/grpc/balancer"
"google.golang.org/grpc/balancer/xds/internal"
basepb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base"
lrsgrpc "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs"
lrspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/resolver"
Expand All @@ -46,7 +47,7 @@ type lrsServer struct {
reportingInterval *durationpb.Duration
}

func (lrss *lrsServer) StreamLoadStats(stream lrspb.LoadReportingService_StreamLoadStatsServer) error {
func (lrss *lrsServer) StreamLoadStats(stream lrsgrpc.LoadReportingService_StreamLoadStatsServer) error {
req, err := stream.Recv()
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion benchmark/primitives/syncmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package primitives
package primitives_test

import (
"sync"
Expand Down