func (s *StateStore) AllocsByNodeTerminal(ws memdb.WatchSet, node string, terminal bool) ([]*structs.Allocation, error) {
	txn := s.db.Txn(false)

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

	ws.Add(iter.WatchCh())

	var out []*structs.Allocation
	for {
		raw := iter.Next()
		if raw == nil {
			break
		}
		out = append(out, raw.(*structs.Allocation))
	}
	return out, nil
}
// AllocsByNode returns all the allocations by node and terminal status
AllocsByNode returns all the allocations by node and terminal status
// AllocsByNode returns all the allocations by node and terminal status
func (s *StateStore) AllocsByNodeTerminal(ws memdb.WatchSet, node string, terminal bool) ([]*structs.Allocation, error) {
	txn := s.db.Txn(false)
	iter, err := txn.Get("allocs", "node", node, terminal)
	if err != nil {
		return nil, err
	}
	ws.Add(iter.WatchCh())
	var out []*structs.Allocation
	for {
		raw := iter.Next()
		if raw == nil {
			break
		}
		out = append(out, raw.(*structs.Allocation))
	}
	return out, nil
}
func ( s * StateStore ) AllocsByNodeTerminal ( ws memdb . WatchSet , node string , terminal bool ) ( [ ] * structs . Allocation , error ) { txn := s . db . Txn ( false ) iter , err := txn . Get ( " " , " " , node , terminal ) if err != nil { return nil , err } ws . Add ( iter . WatchCh ( ) ) var out [ ] * structs . Allocation for { raw := iter . Next ( ) if raw == nil { break } out = append ( out , raw . ( * structs . Allocation ) ) } return out , nil }
AllocsByNode returns all the allocations by node and terminal status
AllocsByNode returns all the allocations by node and terminal status
// Get an iterator over the node allocations