Documentation ¶
Index ¶
- type Scheduler
- type SchedulerOption
- func WithSchedulerCount(count int) SchedulerOption
- func WithSchedulerDialOpts(opts ...grpc.DialOption) SchedulerOption
- func WithSchedulerInterval(interval time.Duration) SchedulerOption
- func WithSchedulerLeadership(isLeader func() bool) SchedulerOption
- func WithSchedulerLogger(l *log.Logger) SchedulerOption
- func WithSchedulerReplicationFactor(replicationFactor int) SchedulerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler manages the routes of the Log Cache nodes.
func NewScheduler ¶
func NewScheduler(logCacheAddrs []string, opts ...SchedulerOption) *Scheduler
NewScheduler returns a new Scheduler. Addrs are the addresses of the Cache nodes.
type SchedulerOption ¶
type SchedulerOption func(*Scheduler)
SchedulerOption configures a Scheduler.
func WithSchedulerCount ¶
func WithSchedulerCount(count int) SchedulerOption
WithSchedulerCount returns a SchedulerOption that configures the number of ranges to manage. Defaults to 100.
func WithSchedulerDialOpts ¶
func WithSchedulerDialOpts(opts ...grpc.DialOption) SchedulerOption
WithSchedulerDialOpts are the gRPC options used to dial peer Log Cache nodes. It defaults to WithInsecure().
func WithSchedulerInterval ¶
func WithSchedulerInterval(interval time.Duration) SchedulerOption
WithSchedulerInterval returns a SchedulerOption that configures the interval for terms to take place. It defaults to a minute.
func WithSchedulerLeadership ¶
func WithSchedulerLeadership(isLeader func() bool) SchedulerOption
WithSchedulerLeadership sets the leadership decsision function that returns true if the scheduler node is the leader. Default to a fuction that returns true.
func WithSchedulerLogger ¶
func WithSchedulerLogger(l *log.Logger) SchedulerOption
WithSchedulerLogger returns a SchedulerOption that configures the logger used for the Scheduler. Defaults to silent logger.
func WithSchedulerReplicationFactor ¶
func WithSchedulerReplicationFactor(replicationFactor int) SchedulerOption
WithSchedulerReplicationFactor returns a SchedulerOption that configures the replication factor for the Log Cache cluster. Replication factor is the total number of nodes to replicate data across. It defaults to 1 (meaning no replication).