Documentation ¶
Index ¶
- func NewMetrics() *jocko.Metrics
- type Broker
- type Client
- type CommitLog
- func (c *CommitLog) Append(b []byte) (int64, error)
- func (c *CommitLog) Delete() error
- func (c *CommitLog) Log() [][]byte
- func (c *CommitLog) NewReader(offset int64, maxBytes int32) (io.Reader, error)
- func (c *CommitLog) NewestOffset() int64
- func (c *CommitLog) OldestOffset() int64
- func (c *CommitLog) Truncate(int64) error
- type Raft
- type Serf
- func (s *Serf) Bootstrap(node *jocko.ClusterMember, reconcileCh chan<- *jocko.ClusterMember) error
- func (s *Serf) Cluster() []*jocko.ClusterMember
- func (s *Serf) ID() int32
- func (s *Serf) Join(addrs ...string) (int, error)
- func (s *Serf) Member(memberID int32) *jocko.ClusterMember
- func (s *Serf) Shutdown() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMetrics ¶
Types ¶
type Broker ¶
type Broker struct { RunFn func(context.Context, <-chan jocko.Request, chan<- jocko.Response) RunInvoked bool JoinFn func(addr ...string) protocol.Error JoinInvoked bool ShutdownFn func() error ShutdownInvoked bool }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for testing
func (*Client) CreateTopic ¶
func (p *Client) CreateTopic(clientID string, createRequest *protocol.CreateTopicRequest) (*protocol.CreateTopicsResponse, error)
func (*Client) FetchMessages ¶
func (p *Client) FetchMessages(clientID string, fetchRequest *protocol.FetchRequest) (*protocol.FetchResponses, error)
type CommitLog ¶
type CommitLog struct {
// contains filtered or unexported fields
}
func NewCommitLog ¶
func NewCommitLog() *CommitLog
func (*CommitLog) NewestOffset ¶
func (*CommitLog) OldestOffset ¶
type Raft ¶
type Raft struct { BootstrapFn func(serf jocko.Serf, serfEventCh <-chan *jocko.ClusterMember, commandCh chan<- jocko.RaftCommand) error BootstrapInvoked bool ApplyFn func(cmd jocko.RaftCommand) error ApplyInvoked bool IsLeaderFn func() bool IsLeaderInvoked bool LeaderIDFn func() string LeaderIDInvoked bool ShutdownFn func() error ShutdownInvoked bool AddrFn func() string AddrInvoked bool }
func (*Raft) Bootstrap ¶
func (r *Raft) Bootstrap(serf jocko.Serf, serfEventCh <-chan *jocko.ClusterMember, commandCh chan<- jocko.RaftCommand) error
type Serf ¶
type Serf struct { BootstrapFn func(node *jocko.ClusterMember, reconcileCh chan<- *jocko.ClusterMember) error BootstrapInvoked bool ClusterFn func() []*jocko.ClusterMember ClusterInvoked bool MemberFn func(memberID int32) *jocko.ClusterMember MemberInvoked bool JoinFn func(addrs ...string) (int, error) JoinInvoked bool ShutdownFn func() error ShutdownInvoked bool IDFn func() int32 IDInvoked bool }
func (*Serf) Bootstrap ¶
func (s *Serf) Bootstrap(node *jocko.ClusterMember, reconcileCh chan<- *jocko.ClusterMember) error
func (*Serf) Cluster ¶
func (s *Serf) Cluster() []*jocko.ClusterMember
Click to show internal directories.
Click to hide internal directories.