Documentation ¶
Index ¶
- Constants
- func NewJobStore(config appconfig.PersistentStore, logger *zap.Logger) (common.JobStore, error)
- type Batch
- type Iter
- type Query
- type Session
- type Store
- func (s *Store) BatchGetJobs(ctx context.Context, jobID common.JobIdentity, IDs []string) ([]common.Job, error)
- func (s *Store) Close()
- func (s *Store) CreateJob(ctx context.Context, job *common.Job, ttl int64) error
- func (s *Store) DeleteJob(ctx context.Context, jobID common.JobIdentity) error
- func (s *Store) DeleteJobLog(ctx context.Context, jobID common.JobIdentity) error
- func (s *Store) DeleteJobStepLog(ctx context.Context, log *common.JobStepLog) error
- func (s *Store) GetJob(ctx context.Context, jobID common.JobIdentity) (common.Job, error)
- func (s *Store) GetJobStepLogs(ctx context.Context, jobID common.JobIdentity, stepID string, startTime string, ...) (*common.JobLogPart, error)
- func (s *Store) GetName() string
- func (s *Store) GetReloadDirs() []string
- func (s *Store) Initialize() error
- func (s *Store) InsertJobStepLog(ctx context.Context, log *common.JobStepLog, ttl int64) error
- func (s *Store) JobStepLogFinished(ctx context.Context, jobID common.JobIdentity, stepID string) bool
- func (s *Store) Reload()
- func (s *Store) UpdateJobStatus(ctx context.Context, job *common.Job, version int32) error
Constants ¶
View Source
const ( MaxJobStepLogRecord = 20 InsertJobQueryTemplate = `INSERT INTO job_info (` + `service, task, domain, job_date, job_id, user_id, engine, spec, started_time, finished_time, state, steps, detail, version) ` + `VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) IF NOT EXISTS USING TTL ?` InsertJobStepLogQueryTemplate = `INSERT INTO log_info (` + `service, task, domain, job_id, step_id, log_time, data) ` + `VALUES(?, ?, ?, ?, ?, ?, ?) IF NOT EXISTS USING TTL ?` DeleteJobStepLogQueryTemplate = `DELETE FROM log_info ` + `WHERE service = ? ` + `and task = ? ` + `and domain = ? ` + `and job_id = ? ` + `and step_id = ?` DeleteJobLogQueryTemplate = `DELETE FROM log_info ` + `WHERE service = ? ` + `and task = ? ` + `and domain = ? ` + `and job_id = ? ` DeleteJobQueryTemplate = `DELETE FROM job_info ` + `WHERE service = ? ` + `and task = ? ` + `and domain = ? ` + `and job_date = ? ` + `and job_id = ?` UpdateJobQueryTemplate = `UPDATE job_info ` + `SET started_time = ?, ` + `finished_time = ?, ` + `state = ?, ` + `steps = ?, ` + `detail = ?, ` + `version = ?` + `WHERE service = ? ` + `and task = ? ` + `and domain = ? ` + `and job_date = ? ` + `and job_id = ?` + `IF version = ?` GetJobQueryTemplate = `SELECT service, task, domain, job_id, user_id, engine, spec, started_time, finished_time, state, steps, detail, version ` + `FROM job_info ` + `WHERE service = ? ` + `and task = ? ` + `and domain = ? ` + `and job_date = ? ` + `and job_id IN ? ` GetJobLogQueryTemplate = `SELECT log_time, data ` + `FROM log_info ` + `WHERE service = ? ` + `and task = ? ` + `and domain = ? ` + `and job_id = ? ` + `and step_id = ?` + `and log_time > ?` + `LIMIT ?` GetJobLastLogQueryTemplate = `SELECT data ` + `FROM log_info ` + `WHERE service = ? ` + `and task = ? ` + `and domain = ? ` + `and job_id = ? ` + `and step_id = ?` + `ORDER BY log_time DESC LIMIT 1` )
View Source
const (
PluginName = "cassandra"
)
Variables ¶
This section is empty.
Functions ¶
func NewJobStore ¶
Types ¶
type Iter ¶
type Iter interface { Scan(...interface{}) bool MapScan(map[string]interface{}) bool PageState() []byte Close() error }
Iter is the interface for executing and iterating over all resulting rows.
type Query ¶
type Query interface { Exec() error Scan(...interface{}) error ScanCAS(...interface{}) (bool, error) MapScan(map[string]interface{}) error MapScanCAS(map[string]interface{}) (bool, error) Iter() Iter PageSize(int) Query PageState([]byte) Query WithContext(context.Context) Query WithTimestamp(int64) Query Bind(...interface{}) Query }
type Session ¶
func NewSession ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) BatchGetJobs ¶
func (*Store) DeleteJobLog ¶
func (*Store) DeleteJobStepLog ¶
func (*Store) GetJobStepLogs ¶
func (*Store) GetReloadDirs ¶
func (*Store) Initialize ¶
func (*Store) InsertJobStepLog ¶
func (*Store) JobStepLogFinished ¶
Click to show internal directories.
Click to hide internal directories.