schedule

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrStreamNotAvailable     = coderr.NewCodeError(coderr.Internal, "stream to node is not available")
	ErrStreamSendMsg          = coderr.NewCodeError(coderr.Internal, "send msg by stream to node")
	ErrStreamSendTimeout      = coderr.NewCodeError(coderr.Internal, "send msg timeout")
	ErrHeartbeatStreamsClosed = coderr.NewCodeError(coderr.Internal, "HeartbeatStreams closed")
)

Functions

This section is empty.

Types

type Event

type Event interface {
	ToHeartbeatResp() *metaservicepb.NodeHeartbeatResponse
}

type EventHandler

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

func NewEventHandler

func NewEventHandler(hbstream *HeartbeatStreams) *EventHandler

func (*EventHandler) Dispatch

func (e *EventHandler) Dispatch(ctx context.Context, nodeName string, event Event) error

type HeartbeatStreamSender

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

type HeartbeatStreams

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

HeartbeatStreams manages all the streams connected by ceresdb node.

func NewHeartbeatStreams

func NewHeartbeatStreams(ctx context.Context) *HeartbeatStreams

func (*HeartbeatStreams) Bind

func (h *HeartbeatStreams) Bind(node string, sender HeartbeatStreamSender)

func (*HeartbeatStreams) Close

func (h *HeartbeatStreams) Close()

Close cancels and waits for all the waiting goroutines.

func (*HeartbeatStreams) SendMsgAsync

SendMsgAsync sends messages to node and this procedure is asynchronous.

func (*HeartbeatStreams) Unbind

func (h *HeartbeatStreams) Unbind(node string)

type NoneEvent

type NoneEvent struct{}

func (*NoneEvent) ToHeartbeatResp

func (*NoneEvent) ToHeartbeatResp() *metaservicepb.NodeHeartbeatResponse

type OpenEvent

type OpenEvent struct {
	ShardIDs []uint32
}

func (*OpenEvent) ToHeartbeatResp

func (open *OpenEvent) ToHeartbeatResp() *metaservicepb.NodeHeartbeatResponse

Jump to

Keyboard shortcuts

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