Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrTopicExists = errors.New("topic exists already") ErrInvalidArgument = errors.New("no logger set") )
Functions ¶
This section is empty.
Types ¶
type Broker ¶
Broker represents a broker in a Jocko cluster, like a broker in a Kafka cluster.
func (*Broker) Join ¶
Join is used to have the broker join the gossip ring. The given address should be another broker listening on the Serf address.
func (*Broker) Run ¶
func (b *Broker) Run(ctx context.Context, requestc <-chan jocko.Request, responsec chan<- jocko.Response)
Run starts a loop to handle requests send back responses.
type BrokerFn ¶
type BrokerFn func(b *Broker)
BrokerFn is used to configure brokers.
func RaftCommands ¶
func RaftCommands(commands chan jocko.RaftCommand) BrokerFn
RaftCommands sets the channel the broker listens for raft commands, probably only useful for Jocko tests.
type Replicator ¶
type Replicator struct {
// contains filtered or unexported fields
}
Replicator fetches from the partition's leader producing to itself the follower, thereby replicating the partition.
func NewReplicator ¶
func NewReplicator(partition *jocko.Partition, replicaID int32, opts ...ReplicatorFn) *Replicator
NewReplicator returns a new replicator instance.
func (*Replicator) Close ¶
func (r *Replicator) Close() error
Close the replicator object when we are no longer following
func (*Replicator) Replicate ¶
func (r *Replicator) Replicate()
type ReplicatorFn ¶
type ReplicatorFn func(r *Replicator)
ReplicatorFn is used to configure replicators.
func ReplicatorFetchSize ¶
func ReplicatorFetchSize(size int32) ReplicatorFn
ReplicatorFetchSize is used to set replicator's fetch request size.
func ReplicatorLeader ¶
func ReplicatorLeader(leader jocko.Client) ReplicatorFn
ReplicatorLeader is used to set the replicator's leader to consume from.
func ReplicatorMaxWaitTime ¶
func ReplicatorMaxWaitTime(time int32) ReplicatorFn
ReplicatorMaxWaitTime is used to set the replicator's request's max wait time. Similar to the consumer config in Kakfa.
func ReplicatorMinBytes ¶
func ReplicatorMinBytes(size int32) ReplicatorFn
ReplicatorMinBytes is used to set the replicator's min byte request size. Similar to the consumer config in Kafka.
func ReplicatorReplicaID ¶
func ReplicatorReplicaID(id int32) ReplicatorFn
ReplicatorReplicaID is used to set the ID of the broker this replicator should replicate. Similar to the consumer config in Kafka.