// AddHistoryDDLJob adds DDL job to history. func (m *Meta) AddHistoryDDLJob(job *model.Job) error { b, err := job.Encode() if err != nil { return errors.Trace(err) } return m.txn.HSet(mDDLJobHistoryKey, m.jobIDKey(job.ID), b) }
func (m *Meta) enQueueDDLJob(key []byte, job *model.Job) error { b, err := job.Encode() if err != nil { return errors.Trace(err) } return m.txn.RPush(key, b) }
// EnQueueDDLJob adds a DDL job to the list. func (m *Meta) EnQueueDDLJob(job *model.Job) error { b, err := job.Encode() if err != nil { return errors.Trace(err) } return m.txn.RPush(mDDLJobListKey, b) }
func (m *Meta) updateDDLJob(index int64, job *model.Job, key []byte) error { // TODO: use timestamp allocated by TSO job.LastUpdateTS = time.Now().UnixNano() b, err := job.Encode() if err != nil { return errors.Trace(err) } return m.txn.LSet(key, index, b) }