grpcservice

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRecvHeartbeat         = coderr.NewCodeError(coderr.Internal, "receive heartbeat")
	ErrBindHeartbeatStream   = coderr.NewCodeError(coderr.Internal, "bind heartbeat sender")
	ErrUnbindHeartbeatStream = coderr.NewCodeError(coderr.Internal, "unbind heartbeat sender")
	ErrParseURL              = coderr.NewCodeError(coderr.Internal, "parse url")
	ErrGRPCDial              = coderr.NewCodeError(coderr.Internal, "grpc dial")
	ErrForward               = coderr.NewCodeError(coderr.Internal, "grpc forward")
)

Functions

This section is empty.

Types

type Handler

type Handler interface {
	GetClusterManager() cluster.Manager
	GetLeader(ctx context.Context) (*member.GetLeaderResp, error)
	UnbindHeartbeatStream(ctx context.Context, node string) error
	BindHeartbeatStream(ctx context.Context, node string, sender HeartbeatStreamSender) error
	ProcessHeartbeat(ctx context.Context, req *metaservicepb.NodeHeartbeatRequest) error
}

Handler is needed by grpc service to process the requests.

type HeartbeatStreamSender

type HeartbeatStreamSender interface {
	Send(response *metaservicepb.NodeHeartbeatResponse) error
}

type Service

type Service struct {
	metaservicepb.UnimplementedCeresmetaRpcServiceServer
	// contains filtered or unexported fields
}

func NewService

func NewService(opTimeout time.Duration, h Handler) *Service

func (*Service) AllocSchemaID

AllocSchemaID implements gRPC CeresmetaServer.

func (*Service) AllocTableID

AllocTableID implements gRPC CeresmetaServer.

func (*Service) DropTable

DropTable implements gRPC CeresmetaServer.

func (*Service) GetNodes

GetNodes implements gRPC CeresmetaServer.

func (*Service) GetShardTables

GetShardTables implements gRPC CeresmetaServer.

func (*Service) NodeHeartbeat

func (s *Service) NodeHeartbeat(heartbeatSrv metaservicepb.CeresmetaRpcService_NodeHeartbeatServer) error

NodeHeartbeat implements gRPC CeresmetaServer.

func (*Service) RouteTables

RouteTables implements gRPC CeresmetaServer.

Jump to

Keyboard shortcuts

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