// CheckChanges is a no-op for vSphere cloud, for now.
198978
func (_ *VMPowerOn) CheckChanges(a, e, changes *VMPowerOn) error {
	glog.Info("VMPowerOn.CheckChanges invoked!")
	return nil
}
1217615
func (s *Settings) changes() settings.ItemChanges {
	var changes settings.ItemChanges

	for key := range cacheKeys(s.disk, s.core) {
		old, onDisk := s.disk[key]
		live, inCore := s.core[key]
		if reflect.DeepEqual(live, old) {
			continue
		}

		var change settings.ItemChange
		switch {
		case inCore && onDisk:
			change = settings.MakeModification(key, old, live)
		case inCore && !onDisk:
			change = settings.MakeAddition(key, live)
		case onDisk && !inCore:
			change = settings.MakeDeletion(key, old)
		default:
			panic("unreachable")
		}
		changes = append(changes, change)
	}
	sort.Sort(changes)
	return changes
}
996570
func (n *Node) handleChanges(changes []Change) {
	n.disseminator.AdjustMaxPropagations()
	for _, change := range changes {
		n.disseminator.RecordChange(change)

		switch change.Status {
		case Alive:
			n.stateTransitions.Cancel(change)

		case Suspect:
			n.stateTransitions.ScheduleSuspectToFaulty(change)

		case Faulty:
			n.stateTransitions.ScheduleFaultyToTombstone(change)

		case Leave:
			// XXX: should this also reap?
			n.stateTransitions.Cancel(change)

		case Tombstone:
			n.stateTransitions.ScheduleTombstoneToEvict(change)
		}
	}
}
735825
func (fr *fileReader) pollChanges(ctx context.Context) {
	ticker := time.Tick(time.Duration(int64(time.Second) * fr.Cfg.UpdateIntervalSeconds))
	for {
		select {
		case <-ticker:
			if err := fr.startWalkingDisk(); err != nil {
				fr.log.Error("failed to search for dashboards", "error", err)
			}
		case <-ctx.Done():
			return
		}
	}
}
635658
func SelectionChange(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "selectionchange", Listener: listener}
}
1348253
func (c *UpdatesClient) Check(ctx context.Context) (*apitypes.UpdateInfo, error) {
	var needsUpdate apitypes.UpdateInfo
	err := c.client.DaemonRoundTrip(ctx, "GET", "/updates", nil, nil, &needsUpdate, nil)
	return &needsUpdate, err
}
159655
func (c *CommitFile) GetChanges() int {
	if c == nil || c.Changes == nil {
		return 0
	}
	return *c.Changes
}
938248
func (k *Store) logChange(op operation, key string, value interface{}) {
	k.log = append(k.log, change{op, key, value})
}
1355044
func (g *Git) HasStagedChanges(ctx context.Context) bool {
	st, err := g.wt.Status()
	if err != nil {
		out.Error(ctx, "Error: Unable to get status: %s", err)
		return false
	}
	return !st.IsClean()
}
793215
func (b *BundleAPI) GetChanges(args params.BundleChangesParams) (params.BundleChangesResults, error) {
	vs := validators{
		verifyConstraints: func(s string) error {
			_, err := constraints.Parse(s)
			return err
		},
		verifyStorage: func(s string) error {
			_, err := storage.ParseConstraints(s)
			return err
		},
		verifyDevices: func(s string) error {
			_, err := devices.ParseConstraints(s)
			return err
		},
	}
	return getChanges(args, vs, func(changes []bundlechanges.Change, results *params.BundleChangesResults) error {
		results.Changes = make([]*params.BundleChange, len(changes))
		for i, c := range changes {
			var guiArgs []interface{}
			switch c := c.(type) {
			case *bundlechanges.AddApplicationChange:
				guiArgs = c.GUIArgsWithDevices()
			default:
				guiArgs = c.GUIArgs()
			}
			results.Changes[i] = &params.BundleChange{
				Id:       c.Id(),
				Method:   c.Method(),
				Args:     guiArgs,
				Requires: c.Requires(),
			}
		}
		return nil
	})
}
400935
func (rdb RethinkDB) GetChanges(changeID string, pageSize int, filterName string) ([]Change, error) {
	var (
		lower, upper, bound []interface{}
		idx                 = "rdb_created_at_id"
		max                 = []interface{}{gorethink.Now().Sub(blackoutTime), gorethink.MaxVal}
		min                 = []interface{}{gorethink.MinVal, gorethink.MinVal}
		order               gorethink.OrderByOpts
		reversed            bool
	)
	if filterName != "" {
		idx = "rdb_gun_created_at_id"
		max = append([]interface{}{filterName}, max...)
		min = append([]interface{}{filterName}, min...)
	}

	switch changeID {
	case "0", "-1":
		lower = min
		upper = max
	default:
		bound, idx = rdb.bound(changeID, filterName)
		if pageSize < 0 {
			lower = min
			upper = bound
		} else {
			lower = bound
			upper = max
		}
	}

	if changeID == "-1" || pageSize < 0 {
		reversed = true
		order = gorethink.OrderByOpts{Index: gorethink.Desc(idx)}
	} else {
		order = gorethink.OrderByOpts{Index: gorethink.Asc(idx)}
	}

	if pageSize < 0 {
		pageSize = pageSize * -1
	}

	changes := make([]Change, 0, pageSize)

	// Between returns a slice of results from the rethinkdb table.
	// The results are ordered using BetweenOpts.Index, which will
	// default to the index of the immediately preceding OrderBy.
	// The lower and upper are the start and end points for the slice
	// and the Left/RightBound values determine whether the lower and
	// upper values are included in the result per normal set semantics
	// of "open" and "closed"
	res, err := gorethink.DB(rdb.dbName).
		Table(Change{}.TableName(), gorethink.TableOpts{ReadMode: "majority"}).
		OrderBy(order).
		Between(
			lower,
			upper,
			gorethink.BetweenOpts{
				LeftBound:  "open",
				RightBound: "open",
			},
		).Limit(pageSize).Run(rdb.sess)
	if err != nil {
		return nil, err
	}
	defer res.Close()

	defer func() {
		if reversed {
			// results are currently newest to oldest, should be oldest to newest
			for i, j := 0, len(changes)-1; i < j; i, j = i+1, j-1 {
				changes[i], changes[j] = changes[j], changes[i]
			}
		}
	}()

	return changes, res.All(&changes)
}
679358
func (h *healthcheckManager) update(vserverName string, checks map[checkKey]*check) {
	if checks == nil {
		delete(h.vserverChecks, vserverName)
	} else {
		h.vserverChecks[vserverName] = checks
	}
	h.buildMaps()
}
299337
func (n *Node) BroadcastChanges(updateChildren bool) error {
	n.nodeManager.mu.Lock()
	defer n.nodeManager.mu.Unlock()
	return n.nodeManager.updateNodeAndBroadcastLocked(n, updateChildren)
}
159840
func (c *ConfigParser) CheckTypes(m map[string]interface{}) error {
	return c.evaluateExpressions(m, nil, true)
}
289861
func processChange(p proxy.Proxy, ch interface{}) error {
	switch change := ch.(type) {
	case *engine.HostUpserted:
		return p.UpsertHost(change.Host)
	case *engine.HostDeleted:
		return p.DeleteHost(change.HostKey)

	case *engine.ListenerUpserted:
		return p.UpsertListener(change.Listener)

	case *engine.ListenerDeleted:
		return p.DeleteListener(change.ListenerKey)

	case *engine.FrontendUpserted:
		return p.UpsertFrontend(change.Frontend)
	case *engine.FrontendDeleted:
		return p.DeleteFrontend(change.FrontendKey)

	case *engine.MiddlewareUpserted:
		return p.UpsertMiddleware(change.FrontendKey, change.Middleware)

	case *engine.MiddlewareDeleted:
		return p.DeleteMiddleware(change.MiddlewareKey)

	case *engine.BackendUpserted:
		return p.UpsertBackend(change.Backend)
	case *engine.BackendDeleted:
		return p.DeleteBackend(change.BackendKey)

	case *engine.ServerUpserted:
		return p.UpsertServer(change.BackendKey, change.Server)
	case *engine.ServerDeleted:
		return p.DeleteServer(change.ServerKey)
	}
	return fmt.Errorf("unsupported change: %#v", ch)
}
661786
func (s *DataMsgServiceServer) DataChanges(stream msg.DataMsgService_DataChangesServer) error {
	for {
		chng, err := stream.Recv()

		if err == io.EOF {
			return nil
		}
		if err != nil {
			return err
		}

		for _, sub := range s.adapter.base.Subscriptions() {
			for _, keyPrefix := range sub.KeyPrefixes {
				if strings.HasPrefix(chng.Key, keyPrefix) {
					sub.ChangeChan <- msg.NewChangeWatchResp(context.Background(), chng, func(err2 error) {
						err = stream.Send(&msg.DataChangeReply{Key: chng.Key, OperationType: chng.OperationType,
							Result: 0 /*TODO VPP Result*/})
						if err != nil {
							logrus.DefaultLogger().Error(err) //Not able to propagate it somewhere else
						}
					})
				}
			}
		}
	}
}
347124
func (c *Client) ContainerChanges(id string) ([]Change, error) {
	path := "/containers/" + id + "/changes"
	resp, err := c.do("GET", path, doOptions{})
	if err != nil {
		if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {
			return nil, &NoSuchContainer{ID: id}
		}
		return nil, err
	}
	defer resp.Body.Close()
	var changes []Change
	if err := json.NewDecoder(resp.Body).Decode(&changes); err != nil {
		return nil, err
	}
	return changes, nil
}