func (s *StateStore) EvalsByJob(ws memdb.WatchSet, jobID string) ([]*structs.Evaluation, error) {
	txn := s.db.Txn(false)

	// Get an iterator over the node allocations
	iter, err := txn.Get("evals", "job_prefix", jobID)
	if err != nil {
		return nil, err
	}

	ws.Add(iter.WatchCh())

	var out []*structs.Evaluation
	for {
		raw := iter.Next()
		if raw == nil {
			break
		}

		e := raw.(*structs.Evaluation)

		// Filter non-exact matches
		if e.JobID != jobID {
			continue
		}

		out = append(out, e)
	}
	return out, nil
}
// EvalsByJob returns all the evaluations by job id
EvalsByJob returns all the evaluations by job id
// EvalsByJob returns all the evaluations by job id
func (s *StateStore) EvalsByJob(ws memdb.WatchSet, jobID string) ([]*structs.Evaluation, error) {
	txn := s.db.Txn(false)
	iter, err := txn.Get("evals", "job_prefix", jobID)
	if err != nil {
		return nil, err
	}
	ws.Add(iter.WatchCh())
	var out []*structs.Evaluation
	for {
		raw := iter.Next()
		if raw == nil {
			break
		}
		e := raw.(*structs.Evaluation)
		if e.JobID != jobID {
			continue
		}
		out = append(out, e)
	}
	return out, nil
}
func ( s * StateStore ) EvalsByJob ( ws memdb . WatchSet , jobID string ) ( [ ] * structs . Evaluation , error ) { txn := s . db . Txn ( false ) iter , err := txn . Get ( " " , " " , jobID ) if err != nil { return nil , err } ws . Add ( iter . WatchCh ( ) ) var out [ ] * structs . Evaluation for { raw := iter . Next ( ) if raw == nil { break } e := raw . ( * structs . Evaluation ) if e . JobID != jobID { continue } out = append ( out , e ) } return out , nil }
EvalsByJob returns all the evaluations by job id
EvalsByJob returns all the evaluations by job id
// Get an iterator over the node allocations // Filter non-exact matches