func (s *StateStore) UpdateAllocsFromClient(index uint64, allocs []*structs.Allocation) error {
	txn := s.db.Txn(true)
	defer txn.Abort()

	// Handle each of the updated allocations
	for _, alloc := range allocs {
		if err := s.nestedUpdateAllocFromClient(txn, index, alloc); err != nil {
			return err
		}
	}

	// Update the indexes
	if err := txn.Insert("index", &IndexEntry{"allocs", index}); err != nil {
		return fmt.Errorf("index update failed: %v", err)
	}

	txn.Commit()
	return nil
}
// UpdateAllocsFromClient is used to update an allocation based on input
// from a client. While the schedulers are the authority on the allocation for
// most things, some updates are authoritative from the client. Specifically,
// the desired state comes from the schedulers, while the actual state comes
// from clients.
UpdateAllocsFromClient is used to update an allocation based on input
from a client. While the schedulers are the authority on the allocation for
most things, some updates are authoritative from the client. Specifically,
the desired state comes from the schedulers, while the actual state comes
from clients.
// UpdateAllocsFromClient is used to update an allocation based on input // from a client . While the schedulers are the authority on the allocation for // most things some updates are authoritative from the client . Specifically // the desired state comes from the schedulers while the actual state comes // from clients .
func (s *StateStore) UpdateAllocsFromClient(index uint64, allocs []*structs.Allocation) error {
	txn := s.db.Txn(true)
	defer txn.Abort()
	for _, alloc := range allocs {
		if err := s.nestedUpdateAllocFromClient(txn, index, alloc); err != nil {
			return err
		}
	}
	if err := txn.Insert("index", &IndexEntry{"allocs", index}); err != nil {
		return fmt.Errorf("index update failed: %v", err)
	}
	txn.Commit()
	return nil
}
func ( s * StateStore ) UpdateAllocsFromClient ( index uint64 , allocs [ ] * structs . Allocation ) error { txn := s . db . Txn ( true ) defer txn . Abort ( ) for _ , alloc := range allocs { if err := s . nestedUpdateAllocFromClient ( txn , index , alloc ) ; err != nil { return err } } if err := txn . Insert ( " " , & IndexEntry { " " , index } ) ; err != nil { return fmt . Errorf ( " " , err ) } txn . Commit ( ) return nil }
UpdateAllocsFromClient is used to update an allocation based on input
from a client.
UpdateAllocsFromClient is used to update an allocation based on input from a client .
// Handle each of the updated allocations // Update the indexes