Documentation
¶
Index ¶
- type JobSetSubscriptions
- type JobTable
- type SQLJobService
- func (s *SQLJobService) CheckToUnSubscribe(queue string, jobSet string, configTimeWithoutUpdates int64) bool
- func (s *SQLJobService) CleanupJobSetAndJobs(queue string, jobSet string) (int64, error)
- func (s *SQLJobService) CreateTable()
- func (s *SQLJobService) DeleteJobsInJobSet(queue string, jobSet string) (int64, error)
- func (s *SQLJobService) GetJobStatus(jobId string) (*js.JobServiceResponse, error)
- func (s *SQLJobService) GetSubscribedJobSets() []SubscribedTuple
- func (s *SQLJobService) HealthCheck() (bool, error)
- func (s *SQLJobService) IsJobSetSubscribed(queue string, jobSet string) bool
- func (s *SQLJobService) SubscribeJobSet(queue string, jobSet string)
- func (s *SQLJobService) UpdateJobServiceDb(jobTable *JobTable)
- func (s *SQLJobService) UpdateJobSetTime(queue string, jobSet string) error
- type SubscribeTable
- type SubscribedTuple
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JobSetSubscriptions ¶
type JobSetSubscriptions struct {
// contains filtered or unexported fields
}
Internal structure for storing in memory JobTables and Subscription JobSets Locks are used for concurrent access of map
func NewJobSetSubscriptions ¶
func NewJobSetSubscriptions(subscribeMap map[string]*SubscribeTable) *JobSetSubscriptions
type JobTable ¶
type JobTable struct {
// contains filtered or unexported fields
}
Our representation for a JobStatus
func NewJobTable ¶
func NewJobTable(queue string, jobSetId string, jobId string, jobResponse js.JobServiceResponse) *JobTable
Construct a JobTable and adds a timestamp when it was created.
type SQLJobService ¶
type SQLJobService struct {
// contains filtered or unexported fields
}
SQLJobService for persisting to DB.
func NewSQLJobService ¶
func NewSQLJobService(jobSetSubscribe *JobSetSubscriptions, config *configuration.JobServiceConfiguration, db *sql.DB) *SQLJobService
func (*SQLJobService) CheckToUnSubscribe ¶
func (s *SQLJobService) CheckToUnSubscribe(queue string, jobSet string, configTimeWithoutUpdates int64) bool
Checks JobSet table to make determine if we should unsubscribe from JobSet configTimeWithoutUpdates is a configurable value that is read from the config We allow unsubscribing if the jobset hasn't been updated in configTime
func (*SQLJobService) CleanupJobSetAndJobs ¶
func (s *SQLJobService) CleanupJobSetAndJobs(queue string, jobSet string) (int64, error)
UnSubscribe to JobSet and delete all the jobs in the database
func (*SQLJobService) CreateTable ¶
func (s *SQLJobService) CreateTable()
Create a Table from a hard-coded schema.
func (*SQLJobService) DeleteJobsInJobSet ¶
func (s *SQLJobService) DeleteJobsInJobSet(queue string, jobSet string) (int64, error)
Delete Jobs in the database
func (*SQLJobService) GetJobStatus ¶
func (s *SQLJobService) GetJobStatus(jobId string) (*js.JobServiceResponse, error)
Get the JobStatus given the jodId
func (*SQLJobService) GetSubscribedJobSets ¶
func (s *SQLJobService) GetSubscribedJobSets() []SubscribedTuple
Get a list of SubscribedJobSets (Queue JobSet)
func (*SQLJobService) HealthCheck ¶
func (s *SQLJobService) HealthCheck() (bool, error)
Simple Health Check to Verify if SqlLite is working.
func (*SQLJobService) IsJobSetSubscribed ¶
func (s *SQLJobService) IsJobSetSubscribed(queue string, jobSet string) bool
Check if JobSet is in our map.
func (*SQLJobService) SubscribeJobSet ¶
func (s *SQLJobService) SubscribeJobSet(queue string, jobSet string)
Mark our JobSet as being subscribed SubscribeTable contains Queue, JobSet and time when it was created.
func (*SQLJobService) UpdateJobServiceDb ¶
func (s *SQLJobService) UpdateJobServiceDb(jobTable *JobTable)
Update database with JobTable.
func (*SQLJobService) UpdateJobSetTime ¶
func (s *SQLJobService) UpdateJobSetTime(queue string, jobSet string) error
Update JobSet Map with time that a Job in that JobSet was requested
type SubscribeTable ¶
type SubscribeTable struct {
// contains filtered or unexported fields
}
func NewSubscribeTable ¶
func NewSubscribeTable(queue string, jobSet string) *SubscribeTable