// Snapshot provides a mock function with given fields: info
325447
func (_m *DFS) Snapshot(info dfs.SnapshotInfo, spaceFactor int) (string, error) {
	ret := _m.Called(info)

	var r0 string
	if rf, ok := ret.Get(0).(func(dfs.SnapshotInfo) string); ok {
		r0 = rf(info)
	} else {
		r0 = ret.Get(0).(string)
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(dfs.SnapshotInfo) error); ok {
		r1 = rf(info)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
1322323
func (client *Client) CreateSnapshot(args *CreateSnapshotArgs) (snapshotId string, err error) {

	response := CreateSnapshotResponse{}

	err = client.Invoke("CreateSnapshot", args, &response)
	if err == nil {
		snapshotId = response.SnapshotId
	}
	return snapshotId, err
}
26421
func (v *VserverEntry) Snapshot() *seesaw.VserverEntry {
	return &seesaw.VserverEntry{
		Port:          v.Port,
		Proto:         v.Proto,
		Scheduler:     v.Scheduler,
		Mode:          v.Mode,
		Persistence:   v.Persistence,
		OnePacket:     v.OnePacket,
		HighWatermark: v.HighWatermark,
		LowWatermark:  v.LowWatermark,
		LThreshold:    v.LThreshold,
		UThreshold:    v.UThreshold,
	}
}
111432
func (d *driver) VolumeSnapshot(
	ctx types.Context,
	volumeID, snapshotName string,
	opts types.Store) (*types.Snapshot, error) {
	// TODO Snapshots are not implemented yet
	return nil, types.ErrNotImplemented
}
317395
func (m *MockVolumeDriver) Snapshot(arg0 string, arg1 bool, arg2 *api.VolumeLocator, arg3 bool) (string, error) {
	ret := m.ctrl.Call(m, "Snapshot", arg0, arg1, arg2, arg3)
	ret0, _ := ret[0].(string)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
503125
func (cs *ConnStats) Snapshot() *ConnStats {
	cs.lock.Lock()
	snapshot := *cs
	cs.lock.Unlock()

	snapshot.lock = sync.Mutex{}
	return &snapshot
}
248162
func (kvm *Clone) Snapshot(wr io.Writer) error {
	kvm.mu.RLock()
	defer kvm.mu.RUnlock()
	data, err := json.Marshal(kvm.keys)
	if err != nil {
		return err
	}
	if _, err := wr.Write(data); err != nil {
		return err
	}
	return nil
}
743913
func (c *Client) GetSnapshot(id string, name string) (Snapshot, error) {
	initiator, err := c.api.GetSnapshot(id, name)
	if err != nil {
		return nil, err
	}
	return initiator.Content, nil
}
1113724
func (s *Store) Snapshot() *Store {
	if s.IsReadOnly() {
		return s
	}

	s.collLock.RLock()
	defer s.collLock.RUnlock()

	// Return a read-only Store with the new Collection set.
	snap := &Store{
		collLock:  nil,
		colls:     make(map[string]*Collection, len(s.colls)),
		collNames: s.collNames,
	}

	// Create a read-only Collection for each coll.
	for k, coll := range s.colls {
		newColl := &Collection{
			name: coll.name,
		}
		newColl.setRoot(coll.currentRoot())
		snap.colls[k] = newColl
	}
	return snap
}
265936
func (db *memDB) Snapshot() View {
	return &memdbView{
		txn: db.store.Txn(false),
	}
}
767656
func (m *CountMeter) Snapshot() metrics.Meter {
	m.mtx.RLock()
	defer m.mtx.RUnlock()
	return &MeterSnapshot{
		m.overall,
		m.rate1(),
		m.rate5(),
		m.rate15(),
		m.rateMean(),
	}
}
612522
func (f *fragment) Snapshot() error {
	f.mu.Lock()
	defer f.mu.Unlock()
	return f.snapshot()
}
175531
func (t *StandardTimer) Snapshot() Timer {
	t.mutex.Lock()
	defer t.mutex.Unlock()
	return &TimerSnapshot{
		histogram: t.histogram.Snapshot().(*HistogramSnapshot),
		meter:     t.meter.Snapshot().(*MeterSnapshot),
	}
}
341751
func (v *volumeClient) Snapshot(volumeID string,
	readonly bool,
	locator *api.VolumeLocator,
	noRetry bool,
) (string, error) {
	response := &api.SnapCreateResponse{}
	request := &api.SnapCreateRequest{
		Id:       volumeID,
		Readonly: readonly,
		Locator:  locator,
		NoRetry:  noRetry,
	}
	if err := v.c.Post().Resource(snapPath).Body(request).Do().Unmarshal(response); err != nil {
		return "", err
	}

	// TODO(pedge): this probably should not be embedded in this way
	if response.VolumeCreateResponse != nil &&
		response.VolumeCreateResponse.VolumeResponse != nil &&
		response.VolumeCreateResponse.VolumeResponse.Error != "" {
		return "", errors.New(
			response.VolumeCreateResponse.VolumeResponse.Error)
	}
	if response.VolumeCreateResponse != nil {
		return response.VolumeCreateResponse.Id, nil
	}
	return "", nil
}
433409
func (mc *mirrorColl) snapshot() *mirrorColl {
	kvs := map[string]string{}
	keys := make([]string, 0, len(kvs))
	for k, v := range mc.kvs {
		kvs[k] = v
		keys = append(keys, k)
	}
	sort.Strings(keys)
	return &mirrorColl{kvs: kvs, keys: keys}
}
683005
func (v *NFSVolume) Snapshot(label, message string, tags []string) (err error) {
	return ErrNotSupported
}
170749
func (c *Cache) snapshot() (ss snapshot) {
	c.lock.RLock()
	defer c.lock.RUnlock()

	if len(c.cache) > 0 {
		ss = make(snapshot)
		for k, e := range c.cache {
			ss[k] = e.Value.(*cacheEntry).v
		}
	}
	return
}