Ejemplo n.º 1
0
Archivo: meta.go Proyecto: yzl11/vessel
// 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)
}
Ejemplo n.º 2
0
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)
}
Ejemplo n.º 3
0
Archivo: meta.go Proyecto: yzl11/vessel
// 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)
}
Ejemplo n.º 4
0
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)
}