rpc

package
v2.1.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// GRPCRaftRPCName is the type name of the grpc raft RPC module.
	GRPCRaftRPCName = "grpc-transport"
)

Functions

func NewRaftGRPC

func NewRaftGRPC(nhConfig config.NodeHostConfig,
	requestHandler raftio.RequestHandler,
	sinkFactory raftio.ChunkSinkFactory) raftio.IRaftRPC

NewRaftGRPC creates the GRPC based raft RPC instance.

Types

type GRPCConnection

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

GRPCConnection is the GRPC based client for sending raft messages.

func NewGRPCConnection

func NewGRPCConnection(ctx context.Context,
	conn *grpc.ClientConn) (*GRPCConnection, error)

NewGRPCConnection create a GRPCConnection instance.

func (*GRPCConnection) Close

func (c *GRPCConnection) Close()

Close closes the GRPCConnection instance.

func (*GRPCConnection) SendMessageBatch

func (c *GRPCConnection) SendMessageBatch(batch raftpb.MessageBatch) error

SendMessageBatch sends the specified message batch.

type GRPCSnapshotConnection

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

GRPCSnapshotConnection is the GRPC based ISnapshotConnection instance for sending snapshot data.

func NewGRPCSnapshotConnection

func NewGRPCSnapshotConnection(ctx context.Context,
	conn *grpc.ClientConn) (*GRPCSnapshotConnection, error)

NewGRPCSnapshotConnection creates a GRPCSnapshotConnection intance.

func (*GRPCSnapshotConnection) Close

func (c *GRPCSnapshotConnection) Close()

Close closes the GRPCSnapshotConnection instance.

func (*GRPCSnapshotConnection) SendSnapshotChunk

func (c *GRPCSnapshotConnection) SendSnapshotChunk(chunk raftpb.SnapshotChunk) error

SendSnapshotChunk sends the specified snapshot chunk.

type RaftGRPC

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

RaftGRPC is the GRPC based RPC moldule.

func (*RaftGRPC) GetConnection

func (g *RaftGRPC) GetConnection(ctx context.Context,
	target string) (raftio.IConnection, error)

GetConnection gets the IConnection instance used for sending raft messages.

func (*RaftGRPC) GetSnapshotConnection

func (g *RaftGRPC) GetSnapshotConnection(ctx context.Context,
	target string) (raftio.ISnapshotConnection, error)

GetSnapshotConnection gets the ISnapshotConnection instance used for sending raft snapshot chunks.

func (*RaftGRPC) Name

func (g *RaftGRPC) Name() string

Name returns the type name of the RaftGRPC instance.

func (*RaftGRPC) RaftMessage

func (g *RaftGRPC) RaftMessage(stream pb.Transport_RaftMessageServer) error

RaftMessage is the gRPC server side service method.

func (*RaftGRPC) RaftSnapshot

func (g *RaftGRPC) RaftSnapshot(stream pb.Transport_RaftSnapshotServer) error

RaftSnapshot is the gRPC server side service method.

func (*RaftGRPC) Start

func (g *RaftGRPC) Start() error

Start starts the server component of the GRPC based RPC instance.

func (*RaftGRPC) Stop

func (g *RaftGRPC) Stop()

Stop stops the RaftGRPC instance.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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