// Update updates a RRSet with the provided val
356822
func (s *RRSetsService) Update(k RRSetKey, val RRSet) (*http.Response, error) {
	var ignored interface{}
	return s.client.put(k.URI(), val, &ignored)
}
973816
func (r ribout) update(p *table.Path) bool {
	key := p.GetNlri().String() // TODO expose (*Path).getPrefix()
	l := r[key]
	if p.IsWithdraw {
		if len(l) == 0 {
			return false
		}
		n := make([]*table.Path, 0, len(l))
		for _, q := range l {
			if p.GetSource() == q.GetSource() {
				continue
			}
			n = append(n, q)
		}
		if len(n) == 0 {
			delete(r, key)
		} else {
			r[key] = n
		}
		return true
	}

	if len(l) == 0 {
		r[key] = []*table.Path{p}
		return true
	}

	doAppend := true
	for idx, q := range l {
		if p.GetSource() == q.GetSource() {
			// if we have sent the same path, don't send it again
			if p.Equal(q) {
				return false
			}
			l[idx] = p
			doAppend = false
		}
	}
	if doAppend {
		r[key] = append(r[key], p)
	}
	return true
}
921311
func (t *RackKVMsTable) update(c context.Context) error {
	// Avoid using the database connection to prepare unnecessary statements.
	if len(t.updates) == 0 {
		return nil
	}

	db := database.Get(c)
	stmt, err := db.PrepareContext(c, `
		UPDATE racks
		SET kvm_id = ?
		WHERE id = ?
	`)
	if err != nil {
		return errors.Annotate(err, "failed to prepare statement").Err()
	}
	defer stmt.Close()

	// Update each rack in the table. It's more efficient to update the slice of
	// racks once at the end rather than for each update, so use a defer.
	updated := make(map[int64]*RackKVM, len(t.updates))
	defer func() {
		for _, rack := range t.current {
			if u, ok := updated[rack.Id]; ok {
				rack.KVMId = u.KVMId
			}
		}
	}()
	for len(t.updates) > 0 {
		rack := t.updates[0]
		if _, err := stmt.ExecContext(c, rack.KVMId, rack.Id); err != nil {
			return errors.Annotate(err, "failed to update rack %q", rack.Name).Err()
		}
		updated[rack.Id] = rack
		t.updates = t.updates[1:]
		logging.Infof(c, "Updated KVM for rack %q", rack.Name)
	}
	return nil
}
848740
func (ar *allocRunner) Update(update *structs.Allocation) {
	select {
	// Drain queued update from the channel if possible, and check the modify
	// index
	case oldUpdate := <-ar.allocUpdatedCh:
		// If the old update is newer than the replacement, then skip the new one
		// and return. This case shouldn't happen, but may in the case of a bug
		// elsewhere inside the system.
		if oldUpdate.AllocModifyIndex > update.AllocModifyIndex {
			ar.logger.Debug("Discarding allocation update due to newer alloc revision in queue",
				"old_modify_index", oldUpdate.AllocModifyIndex,
				"new_modify_index", update.AllocModifyIndex)
			ar.allocUpdatedCh <- oldUpdate
			return
		} else {
			ar.logger.Debug("Discarding allocation update",
				"skipped_modify_index", oldUpdate.AllocModifyIndex,
				"new_modify_index", update.AllocModifyIndex)
		}
	case <-ar.waitCh:
		ar.logger.Trace("AllocRunner has terminated, skipping alloc update",
			"modify_index", update.AllocModifyIndex)
		return
	default:
	}

	// Queue the new update
	ar.allocUpdatedCh <- update
}
115854
func (s *Sequence) Update(val uint64) error {
	// monotonically increasing error
	if s.increment > 0 && val < s.current {
		return errors.New("cannot decrease monotonically increasing sequence")
	}

	// monotonically decreasing error
	if s.increment < 0 && val > s.current {
		return errors.New("cannot increase monotonically decreasing sequence")
	}

	// Update the sequence.
	s.current = val
	return nil
}
535584
func (lu *LookupUnique) Update(vcursor VCursor, oldValues []sqltypes.Value, ksid []byte, newValues []sqltypes.Value) error {
	return lu.lkp.Update(vcursor, oldValues, sqltypes.MakeTrusted(sqltypes.VarBinary, ksid), newValues)
}
641547
func (eng *engine) Update(table Table, fields ...string) error {
	s := eng.newSession()
	defer s.Close()
	action, err := s.update(table, false, fields...)
	if err != nil {
		return s.catch("Update: "+action, err)
	}
	return nil
}
413001
func (d *OvsdbDriver) Update(context interface{}, tableUpdates libovsdb.TableUpdates) {
	d.populateCache(tableUpdates)
	intfUpds, ok := tableUpdates.Updates["Interface"]
	if !ok {
		return
	}

	for _, intfUpd := range intfUpds.Rows {
		intf := intfUpd.New.Fields["name"]
		oldLacpStatus, ok := intfUpd.Old.Fields["lacp_current"]
		if !ok {
			return
		}
		newLacpStatus, ok := intfUpd.New.Fields["lacp_current"]
		if !ok {
			return
		}
		if oldLacpStatus == newLacpStatus || d.ovsSwitch == nil {
			return
		}

		linkUpd := ofnet.LinkUpdateInfo{
			LinkName:   intf.(string),
			LacpStatus: newLacpStatus.(bool),
		}
		log.Debugf("LACP_UPD: Interface: %+v. LACP Status - (Old: %+v, New: %+v)\n", intf, oldLacpStatus, newLacpStatus)
		d.ovsSwitch.HandleLinkUpdates(linkUpd)
	}
}
1229216
func (tx *Tx) Update(table string) *UpdateStmt {
	b := Update(table)
	b.runner = tx
	b.EventReceiver = tx.EventReceiver
	b.Dialect = tx.Dialect
	return b
}
882487
func (t *Timer) Update(d time.Duration) {
	v := Floor(d.Seconds() * 1000)
	t.r.Update(v)
}
26869
func (batch *UpdateBatch) Update(ns string, key string, vv *VersionedValue) {
	batch.getOrCreateNsUpdates(ns).m[key] = vv
}
469198
func (c *statCollector) Update(ch chan<- prometheus.Metric) error {
	stats, err := c.fs.NewStat()
	if err != nil {
		return err
	}

	ch <- prometheus.MustNewConstMetric(c.intr, prometheus.CounterValue, float64(stats.IRQTotal))
	ch <- prometheus.MustNewConstMetric(c.ctxt, prometheus.CounterValue, float64(stats.ContextSwitches))
	ch <- prometheus.MustNewConstMetric(c.forks, prometheus.CounterValue, float64(stats.ProcessCreated))

	ch <- prometheus.MustNewConstMetric(c.btime, prometheus.GaugeValue, float64(stats.BootTime))

	ch <- prometheus.MustNewConstMetric(c.procsRunning, prometheus.GaugeValue, float64(stats.ProcessesRunning))
	ch <- prometheus.MustNewConstMetric(c.procsBlocked, prometheus.GaugeValue, float64(stats.ProcessesBlocked))

	return nil
}
1258101
func (cf *countFunction) Update(row []types.Datum, groupKey []byte, ectx context.Context) error {
	ctx := cf.getContext(groupKey)
	var vals []interface{}
	if cf.Distinct {
		vals = make([]interface{}, 0, len(cf.Args))
	}
	for _, a := range cf.Args {
		value, err := a.Eval(row, ectx)
		if err != nil {
			return errors.Trace(err)
		}
		if value.GetValue() == nil {
			return nil
		}
		if cf.mode == FinalMode {
			ctx.Count += value.GetInt64()
		}
		if cf.Distinct {
			vals = append(vals, value.GetValue())
		}
	}
	if cf.Distinct {
		d, err := ctx.DistinctChecker.Check(vals)
		if err != nil {
			return errors.Trace(err)
		}
		if !d {
			return nil
		}
	}
	if cf.mode == CompleteMode {
		ctx.Count++
	}
	return nil
}
95388
func (me *Dataset) Update(i interface{}) *CrudExec {
	sql, args, err := me.ToUpdateSql(i)
	return newCrudExec(me.database, err, sql, args...)
}
61944
func (g *StandardGaugeFloat64) Update(v float64) {
	g.mutex.Lock()
	defer g.mutex.Unlock()
	g.value = v
}
785318
func (s *GeoDirectionalPoolsService) Update(k GeoDirectionalPoolKey, val interface{}) (*http.Response, error) {
	return s.client.put(k.URI(), val, nil)
}
769179
func (c *FakeStatefulSets) Update(statefulSet *appsv1.StatefulSet) (result *appsv1.StatefulSet, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), &appsv1.StatefulSet{})

	if obj == nil {
		return nil, err
	}
	return obj.(*appsv1.StatefulSet), err
}