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
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 ¶
func (h *HeartbeatStreams) SendMsgAsync(ctx context.Context, node string, msg *metaservicepb.NodeHeartbeatResponse) error
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
Click to show internal directories.
Click to hide internal directories.