code: func (w *watchCache) Replace(objs []interface{}, resourceVersion string) error {
  	version, err := w.versioner.ParseResourceVersion(resourceVersion)
  	if err != nil {
  		return err
  	}
  
  	toReplace := make([]interface{}, 0, len(objs))
  	for _, obj := range objs {
  		object, ok := obj.(runtime.Object)
  		if !ok {
  			return fmt.Errorf("didn't get runtime.Object for replace: %#v", obj)
  		}
  		key, err := w.keyFunc(object)
  		if err != nil {
  			return fmt.Errorf("couldn't compute key: %v", err)
  		}
  		objLabels, objFields, err := w.getAttrsFunc(object)
  		if err != nil {
  			return err
  		}
  		toReplace = append(toReplace, &storeElement{
  			Key:    key,
  			Object: object,
  			Labels: objLabels,
  			Fields: objFields,
  		})
  	}
  
  	w.Lock()
  	defer w.Unlock()
  
  	w.startIndex = 0
  	w.endIndex = 0
  	if err := w.store.Replace(toReplace, resourceVersion); err != nil {
  		return err
  	}
  	w.listResourceVersion = version
  	w.resourceVersion = version
  	if w.onReplace != nil {
  		w.onReplace()
  	}
  	w.cond.Broadcast()
  	klog.V(3).Infof("Replace watchCache (rev: %v) ", resourceVersion)
  	return nil
  }
docs: // Replace takes slice of runtime.Object as a parameter.