// Reinit the resource.
546347
func (r *AutoVXLANCfgResource) Reinit(rsrcCfg interface{}) error {

	cfg, ok := rsrcCfg.(*AutoVXLANCfgResource)
	if !ok {
		return core.Errorf("Invalid vxlan resource config.")
	}

	prevVXLANs := r.VXLANs
	prevFreeStart := r.FreeVXLANsStart

	r.VXLANs = cfg.VXLANs
	r.LocalVLANs = cfg.LocalVLANs
	r.FreeVXLANsStart = cfg.FreeVXLANsStart

	err := r.Write()
	if err != nil {
		return err
	}
	defer func() {
		if err != nil {
			r.Clear()
		}
	}()

	oper := &AutoVXLANOperResource{}
	oper.StateDriver = r.StateDriver
	oper.ID = r.ID

	err = oper.Read(r.ID)
	if err != nil {
		return err
	}

	prevVXLANs.InPlaceSymmetricDifference(oper.FreeVXLANs)

	oper.FreeVXLANs = r.VXLANs
	for i, e := prevVXLANs.NextSet(0); e; i, e = prevVXLANs.NextSet(i + 1) {
		vxlan := i + prevFreeStart
		oper.FreeVXLANs.Clear(vxlan - r.FreeVXLANsStart)
	}

	oper.FreeLocalVLANs = oper.FreeLocalVLANs.Intersection(r.LocalVLANs)

	return oper.Write()
}
227678
func (i *RefreshableInstance) Refresh(ctx context.ProviderCallContext) error {
	instances, err := i.Env.Instances(ctx, []instance.Id{i.Id()})
	if err != nil {
		return errors.Trace(err)
	}
	i.Instance = instances[0]
	return nil
}
1248996
func (s *ReindexService) Refresh(refresh string) *ReindexService {
	s.refresh = refresh
	return s
}
189365
func restore() (err error) {
	if _, err = stty("echo"); err != nil {
		return
	}

	if _, err = stty(originalState); err != nil {
		return
	}

	return
}
618939
func (res *Resource) Open() {
	res.stmu.Lock()
	defer res.stmu.Unlock()

	res.chmu.Lock()
	res.ch = make(chan struct{})
	res.chmu.Unlock()
}
763577
func (s *Storage) Reset() {
	s.setBadger(storage.TotalCountKey, 0)
	s.setBadger(storage.IosSuccessKey, 0)
	s.setBadger(storage.IosErrorKey, 0)
	s.setBadger(storage.AndroidSuccessKey, 0)
	s.setBadger(storage.AndroidErrorKey, 0)
}
408328
func (s *server) ReinitConfig(ctx context.Context, request *mysqlctlpb.ReinitConfigRequest) (*mysqlctlpb.ReinitConfigResponse, error) {
	return &mysqlctlpb.ReinitConfigResponse{}, s.mysqld.ReinitConfig(ctx, s.cnf)
}
1313211
func (it *Not) Reset() {
	it.result = nil
	it.primaryIt.Reset()
	it.allIt.Reset()
}
6341
func (c *Client) Refresh(indices ...string) *RefreshService {
	builder := NewRefreshService(c)
	builder.Indices(indices...)
	return builder
}
715920
func (p *ParamParser) Reset(src string) {
	p.src = src
	p.errors = []string{}
}
1224333
func (s *subscriptions) Reset() []*subscription {
	subs := s.reset()
	s.lock.Lock()
	s.hbActive = false
	s.subsBySubID = make(map[string]*subscription)
	s.subsByChanID = make(map[int64]*subscription)
	s.lock.Unlock()
	return subs
}
122793
func (c *CloudService) Refresh() error {
	_, err := c.CloudService()
	return errors.Trace(err)
}
757636
func (s *ServerImpl) Restart() error {
	if s.config.AttachPid != 0 {
		return errors.New("cannot restart process Delve did not create")
	}
	return s.s2.Restart(rpc2.RestartIn{}, nil)
}
994526
func (r *Service) Reload() (*Service, error) {
	return r.collection.Get(r.Metadata.Name)
}
331089
func (s *StorageOverseer) Regenerate(w http.ResponseWriter, r *http.Request) error {
	id, err := s.options.getCookieValue(w, r)
	if err != nil {
		return errors.Wrap(err, "unable to get session id from cookie")
	}

	val, err := s.Storer.Get(id)
	if err != nil {
		return errors.Wrap(err, "unable to get session value")
	}

	// Delete the old session
	_ = s.Storer.Del(id)

	// Generate a new ID
	id = uuid.NewV4().String()

	// Create a new session with the old value
	if err = s.Storer.Set(id, val); err != nil {
		return errors.Wrap(err, "unable to set session value")
	}

	// Override the old cookie with the new cookie
	w.(cookieWriter).SetCookie(s.options.makeCookie(id))

	return nil
}
103984
func (r *Reference) refreshValue() {
	if value, err := r.initializer(nil); err != nil {
		logger.Warnf("Error - initializer returned error: %s. Will retry again later", err)
	} else {
		r.set(value)
	}
}
1140082
func (s *IndexService) Refresh(refresh string) *IndexService {
	s.refresh = refresh
	return s
}