Documentation ¶
Index ¶
Constants ¶
View Source
const ( JobsChangedEventPath = types.EventPath("jobs-changed") MemberJobsChangedEventPath = types.EventPath("msm_jobs-changed") )
View Source
const ( PathJobs = "jobs" PathMemberJobs = "membjobs" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
Job job data structure
func (*Job) GetAsObject ¶
GetAsObject Get data as interface
type JobsChangedEvent ¶
type JobsChangedEvent struct { common.DaemonEvent BlockHeight int64 }
func (JobsChangedEvent) Path ¶
func (event JobsChangedEvent) Path() types.EventPath
type Manager ¶
Manager manager for jobs
func (*Manager) GetRepository ¶
func (manager *Manager) GetRepository() Repository
type MemberJobsChangedEvent ¶
type MemberJobsChangedEvent struct { common.DaemonEvent NodeID string JobIDs []string }
func (MemberJobsChangedEvent) Path ¶
func (event MemberJobsChangedEvent) Path() types.EventPath
type Organizer ¶
type Organizer interface {
Distribute(allJobs map[string]Job, aliveMembers []string, membJobMap map[string][]string) (membJobs map[string][]string, err error)
}
Organizer : Job Organizer distributes jobs to members
func NewSimpleOrganizer ¶
NewSimpleOrganizer ..
type Repository ¶
type Repository interface { PutJob(job Job) error PutJobIfNotExist(job Job) error RemoveJob(jobID string) error RemoveAllJobs() error GetJob(jobID string) (job Job, err error) ContainsJob(jobID string) bool GetAllJobIDs() (jobIDs []string, err error) GetAllJobs() (jobs map[string]Job, err error) GetMemberJobIDs(membID string) (jobIDs []string, err error) GetAllMemberJobIDs() (membJobMap map[string][]string, err error) PutMemberJobIDs(membID string, jobIDs []string) (err error) GetMemberJobs(membID string) (jobs []Job, err error) Commit() error }
func NewRepository ¶
func NewRepository(config common.DaemonConfig, logger log.Logger, client types.Client) Repository
Click to show internal directories.
Click to hide internal directories.