Documentation
¶
Index ¶
- Constants
- Variables
- func NewProtoFromPChannelInfo(pchannel PChannelInfo) *streamingpb.PChannelInfo
- func NewProtoFromStreamingNodeInfo(info StreamingNodeInfo) *streamingpb.StreamingNodeInfo
- type AssignmentDiscoverWatcher
- type AssignmentRebalanceTrigger
- type PChannelInfo
- type PChannelInfoAssigned
- type StreamingNodeAssignment
- type StreamingNodeInfo
- type StreamingNodeStatus
- type VersionedStreamingNodeAssignments
Constants ¶
const (
InitialTerm int64 = -1
)
Variables ¶
var ( ErrStopping = errors.New("streaming node is stopping") ErrNotAlive = errors.New("streaming node is not alive") )
Functions ¶
func NewProtoFromPChannelInfo ¶
func NewProtoFromPChannelInfo(pchannel PChannelInfo) *streamingpb.PChannelInfo
NewProtoFromPChannelInfo converts PChannelInfo to protobuf PChannelInfo
func NewProtoFromStreamingNodeInfo ¶
func NewProtoFromStreamingNodeInfo(info StreamingNodeInfo) *streamingpb.StreamingNodeInfo
NewProtoFromStreamingNodeInfo creates a proto from StreamingNodeInfo.
Types ¶
type AssignmentDiscoverWatcher ¶
type AssignmentDiscoverWatcher interface {
// AssignmentDiscover watches the assignment discovery.
// The callback will be called when the discovery is changed.
// The final error will be returned when the watcher is closed or broken.
AssignmentDiscover(ctx context.Context, cb func(*VersionedStreamingNodeAssignments) error) error
AssignmentRebalanceTrigger
}
AssignmentDiscoverWatcher is the interface for watching the assignment discovery.
type AssignmentRebalanceTrigger ¶
type AssignmentRebalanceTrigger interface {
// ReportStreamingError is used to report the streaming error.
// Trigger a re-balance of the pchannel.
ReportAssignmentError(ctx context.Context, pchannel PChannelInfo, err error) error
}
AssignmentRebalanceTrigger is the interface for triggering the re-balance of the pchannel.
type PChannelInfo ¶
PChannelInfo is the struct for pchannel info.
func NewPChannelInfoFromProto ¶
func NewPChannelInfoFromProto(pchannel *streamingpb.PChannelInfo) PChannelInfo
NewPChannelInfoFromProto converts protobuf PChannelInfo to PChannelInfo
func (*PChannelInfo) String ¶
func (c *PChannelInfo) String() string
type PChannelInfoAssigned ¶
type PChannelInfoAssigned struct {
Channel PChannelInfo
Node StreamingNodeInfo
}
type StreamingNodeAssignment ¶
type StreamingNodeAssignment struct {
NodeInfo StreamingNodeInfo
Channels map[string]PChannelInfo
}
StreamingNodeAssignment is the relation between server and channels.
type StreamingNodeInfo ¶
StreamingNodeInfo is the relation between server and channels.
func NewStreamingNodeInfoFromProto ¶
func NewStreamingNodeInfoFromProto(proto *streamingpb.StreamingNodeInfo) StreamingNodeInfo
NewStreamingNodeInfoFromProto creates a StreamingNodeInfo from proto.
type StreamingNodeStatus ¶
type StreamingNodeStatus struct {
StreamingNodeInfo
// TODO: balance attributes should added here in future.
Err error
}
StreamingNodeStatus is the information of a streaming node.
func (*StreamingNodeStatus) ErrorOfNode ¶
func (n *StreamingNodeStatus) ErrorOfNode() error
ErrorOfNode returns the error of the streaming node.
func (*StreamingNodeStatus) IsHealthy ¶
func (n *StreamingNodeStatus) IsHealthy() bool
IsHealthy returns whether the streaming node is healthy.
type VersionedStreamingNodeAssignments ¶
type VersionedStreamingNodeAssignments struct {
Version typeutil.VersionInt64Pair
Assignments map[int64]StreamingNodeAssignment
}
VersionedStreamingNodeAssignments is the relation between server and channels with version.