Documentation
¶
Index ¶
- Constants
- Variables
- type ClusterHandler
- func (cl *ClusterHandler) GetHandlers() map[uint64]func(store.WritableState, []byte) (interface{}, error)
- func (cl *ClusterHandler) HandleAcquireJobCommand(state store.WritableState, data []byte) (interface{}, error)
- func (cl *ClusterHandler) HandleAddPeerCommand(state store.WritableState, data []byte) (interface{}, error)
- func (cl *ClusterHandler) HandleDeleteJobCommand(state store.WritableState, data []byte) (interface{}, error)
- func (cl *ClusterHandler) HandleInsertJobCommand(state store.WritableState, data []byte) (interface{}, error)
- func (cl *ClusterHandler) HandleJobExecutedCommand(state store.WritableState, data []byte) (interface{}, error)
- func (cl *ClusterHandler) HandleRemovePeerCommand(state store.WritableState, data []byte) (interface{}, error)
- type JobExecutor
- type RaftAdapter
- type Scheduler
Constants ¶
View Source
const (
DefaultJobExecutionTimeout = 5 * time.Second
)
Variables ¶
View Source
var (
ErrJobTimeoutExceeded = errors.New("job execution timeout exceeded")
)
Functions ¶
This section is empty.
Types ¶
type ClusterHandler ¶
type ClusterHandler struct {
// contains filtered or unexported fields
}
func NewClusterHandler ¶
func NewClusterHandler(typeProvider provider.TypeProvider, executor executor) *ClusterHandler
func (*ClusterHandler) GetHandlers ¶
func (cl *ClusterHandler) GetHandlers() map[uint64]func(store.WritableState, []byte) (interface{}, error)
func (*ClusterHandler) HandleAcquireJobCommand ¶
func (cl *ClusterHandler) HandleAcquireJobCommand(state store.WritableState, data []byte) (interface{}, error)
func (*ClusterHandler) HandleAddPeerCommand ¶
func (cl *ClusterHandler) HandleAddPeerCommand(state store.WritableState, data []byte) (interface{}, error)
func (*ClusterHandler) HandleDeleteJobCommand ¶
func (cl *ClusterHandler) HandleDeleteJobCommand(state store.WritableState, data []byte) (interface{}, error)
func (*ClusterHandler) HandleInsertJobCommand ¶
func (cl *ClusterHandler) HandleInsertJobCommand(state store.WritableState, data []byte) (interface{}, error)
func (*ClusterHandler) HandleJobExecutedCommand ¶
func (cl *ClusterHandler) HandleJobExecutedCommand(state store.WritableState, data []byte) (interface{}, error)
func (*ClusterHandler) HandleRemovePeerCommand ¶
func (cl *ClusterHandler) HandleRemovePeerCommand(state store.WritableState, data []byte) (interface{}, error)
type JobExecutor ¶
type RaftAdapter ¶
type RaftAdapter struct {
Config config.ClusterConfiguration
RaftStore *store.Store
ClusterClient *cluster.Client
HTTPServer *http.Server
EtpServer etp.Server
// contains filtered or unexported fields
}
func NewRaftAdapter ¶
func NewRaftAdapter(cfg config.ClusterConfiguration, handler store.CommandsHandler, typeProvider provider.TypeProvider) (*RaftAdapter, error)
type Scheduler ¶
type Scheduler interface {
WaitCluster(context.Context) bool
Shutdown(ctx context.Context) error
RegisterExecutor(jobType string, executor JobExecutor, newJobFunc provider.NewJobFunc) Scheduler
UnregisterExecutor(jobType string)
ScheduleJob(job jobs.Job) error
GetJob(key string) (*store.JobInfo, error)
DeleteJob(key string) error
GetAllJobs() []store.JobInfo
GetJobsByType(jobType string) []store.JobInfo
}
func NewScheduler ¶
func NewScheduler(config config.ClusterConfiguration) (Scheduler, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.