scheduler

package
v2.3.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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.

func (*Scheduler) Start

func (s *Scheduler) Start()

Start starts the scheduler. It does not block.

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).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL