datascheduler

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataScheduler

type DataScheduler interface {
	// state should be got from SchedulerResult which is got from last caller for the same range request.
	Schedule(ctx context.Context, rr basic.RangeRequest, state ScheduleState) (SchedulerResult, error)
}

DataScheduler defines how to schedule peers for range request.

type ScheduleState

type ScheduleState interface {
	// Continue tells user if reschedule the request range again.
	Continue() bool
}

ScheduleState defines the state of this schedule.

type SchedulerResult

type SchedulerResult interface {
	// Result get the schedule result for range data which may not include all data of request range.
	Result() []*basic.SchedulePieceDataResult

	// State gets the temporary states of this schedule which binds to range request.
	State() ScheduleState
}

SchedulerResult defines the schedule result of request range. For some implementation, developer could do more than one schedule for the same request range.

Jump to

Keyboard shortcuts

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