balancer

package
v0.0.0-...-ebb4f00 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

README

GRPC Balancer

This package is a forked version of https://github.com/GoogleCloudPlatform/grpc-gcp-go.

We use this primarily to create new sub-connections when we reach maximum number of streams (100 for GFE) on a given connection.

Refer to https://github.com/grpc/grpc/issues/21386 for status on the long-term fix for this issue.

Documentation

Overview

Package balancer is a forked version of https://github.com/GoogleCloudPlatform/grpc-gcp-go.

Index

Constants

View Source
const (
	// Name is the name of grpc_gcp balancer.
	Name = "grpc_gcp"
)

Variables

View Source
var (
	// DefaultMinConnections is the default number of gRPC sub-connections the
	// gRPC balancer should create during SDK initialization.
	DefaultMinConnections = 5

	// MinConnections is the minimum number of gRPC sub-connections the gRPC balancer
	// should create during SDK initialization.
	// It is initialized in flags package.
	MinConnections = DefaultMinConnections
)

Functions

func ParseAPIConfig

func ParseAPIConfig(path string) (*pb.ApiConfig, error)

ParseAPIConfig parses a json config file into ApiConfig proto message.

Types

type GCPInterceptor

type GCPInterceptor struct {
	// contains filtered or unexported fields
}

GCPInterceptor provides functions for intercepting client requests in order to support GCP specific features

func NewGCPInterceptor

func NewGCPInterceptor(config *pb.ApiConfig) *GCPInterceptor

NewGCPInterceptor creates a new GCPInterceptor with a given ApiConfig

func (*GCPInterceptor) GCPStreamClientInterceptor

func (gcpInt *GCPInterceptor) GCPStreamClientInterceptor(
	ctx context.Context,
	desc *grpc.StreamDesc,
	cc *grpc.ClientConn,
	method string,
	streamer grpc.Streamer,
	opts ...grpc.CallOption,
) (grpc.ClientStream, error)

GCPStreamClientInterceptor intercepts the execution of a client streaming RPC and injects necessary information to be used by the picker.

func (*GCPInterceptor) GCPUnaryClientInterceptor

func (gcpInt *GCPInterceptor) GCPUnaryClientInterceptor(
	ctx context.Context,
	method string,
	req interface{},
	reply interface{},
	cc *grpc.ClientConn,
	invoker grpc.UnaryInvoker,
	opts ...grpc.CallOption,
) error

GCPUnaryClientInterceptor intercepts the execution of a unary RPC and injects necessary information to be used by the picker.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL