// Snapshot is the list of snapshot names. If not set, defaults to all snapshots.
163283
func (s *SnapshotGetService) Snapshot(snapshots ...string) *SnapshotGetService {
	s.snapshot = append(s.snapshot, snapshots...)
	return s
}
228132
func Copy(s *Snapshot) *Snapshot {
	cs := *(s.ChangeSet)

	return &Snapshot{
		ChangeSet: &cs,
		Version:   s.Version,
	}
}
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,
	}
}
389233
func (r *Registry) Snapshot() map[string]interface{} {
	r.m.Lock()
	defer r.m.Unlock()
	instruments := r.instruments
	r.instruments = make(map[string]interface{})
	return instruments
}
1104550
func (s *Store) Snapshot() *Snapshot {
	tx := s.db.Txn(false)

	var tables []string
	for table := range s.schema.Tables {
		tables = append(tables, table)
	}
	idx := maxIndexTxn(tx, tables...)

	return &Snapshot{s, tx, idx}
}
1330683
func (s *RevokeSnapshotAccessOutput) SetSnapshot(v *Snapshot) *RevokeSnapshotAccessOutput {
	s.Snapshot = v
	return s
}
648282
func (c *Client) GetSnapshots() (snapshotList []Snapshot, err error) {
	var snapshotMap map[string]Snapshot
	if err := c.get(`snapshot/list`, &snapshotMap); err != nil {
		return nil, err
	}

	for _, snapshot := range snapshotMap {
		snapshotList = append(snapshotList, snapshot)
	}
	sort.Sort(snapshots(snapshotList))
	return snapshotList, nil
}
650344
func (cs *ConnStats) Snapshot() *ConnStats {
	return &ConnStats{
		RPCCalls:     atomic.LoadUint64(&cs.RPCCalls),
		RPCTime:      atomic.LoadUint64(&cs.RPCTime),
		BytesWritten: atomic.LoadUint64(&cs.BytesWritten),
		BytesRead:    atomic.LoadUint64(&cs.BytesRead),
		ReadCalls:    atomic.LoadUint64(&cs.ReadCalls),
		ReadErrors:   atomic.LoadUint64(&cs.ReadErrors),
		WriteCalls:   atomic.LoadUint64(&cs.WriteCalls),
		WriteErrors:  atomic.LoadUint64(&cs.WriteErrors),
		DialCalls:    atomic.LoadUint64(&cs.DialCalls),
		DialErrors:   atomic.LoadUint64(&cs.DialErrors),
		AcceptCalls:  atomic.LoadUint64(&cs.AcceptCalls),
		AcceptErrors: atomic.LoadUint64(&cs.AcceptErrors),
	}
}
69423
func (r *AllocationBitmap) Snapshot() (string, []byte) {
	r.lock.Lock()
	defer r.lock.Unlock()

	return r.rangeSpec, r.allocated.Bytes()
}
1209992
func Snapshot(name string, opts *SnapshotOpts) error {
	cmd := newCmd("snapshot")
	if opts != nil {
		cmd = addOpt(cmd, opts.Recurse, "-r")
		cmd = addProperties(cmd, opts.SetProperties)
	}
	cmd = addNonEmpty(cmd, name)
	return zExecNoOut(cmd)
}
67168
func (p *AuroraAdminClient) Snapshot(ctx context.Context) (r *Response, err error) {
  var _args344 AuroraAdminSnapshotArgs
  var _result345 AuroraAdminSnapshotResult
  if err = p.Client_().Call(ctx, "snapshot", &_args344, &_result345); err != nil {
    return
  }
  return _result345.GetSuccess(), nil
}
1309868
func (s *Store) Snapshot() (raft.FSMSnapshot, error) {
	s.restoreMu.RLock()
	defer s.restoreMu.RUnlock()

	// Snapshots are not permitted while any connection has a transaction
	// in progress, because it's not possible (not without a lot of extra
	// code anyway) to capture the state of a connection during a transaction
	// on that connection. Since only during Apply() can a connection change
	// its transaction state, and Apply() is never called concurrently with
	// this call, it's safe to check transaction state here across all connections.
	if err := func() error {
		s.connsMu.Lock()
		defer s.connsMu.Unlock()
		for _, c := range s.conns {
			if c.TransactionActive() {
				stats.Add(numSnaphotsBlocked, 1)
				return ErrTransactionActive
			}
		}
		return nil
	}(); err != nil {
		return nil, err
	}

	// Copy the database.
	fsm := &fsmSnapshot{}
	var buf bytes.Buffer
	var err error
	err = s.database(false, &buf)
	if err != nil {
		s.logger.Printf("failed to read database for snapshot: %s", err.Error())
		return nil, err
	}
	fsm.database = buf.Bytes()

	// Copy the node metadata.
	fsm.meta, err = json.Marshal(s.meta)
	if err != nil {
		s.logger.Printf("failed to encode meta for snapshot: %s", err.Error())
		return nil, err
	}

	// Copy the active connections.
	fsm.connections, err = json.Marshal(s.conns)
	if err != nil {
		s.logger.Printf("failed to encode connections for snapshot: %s", err.Error())
		return nil, err
	}
	stats.Add(numSnaphots, 1)

	return fsm, 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}
}
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
}
1027695
func (v *RsyncVolume) Snapshots() ([]string, error) {
	glog.Infof("Snapshots()")
	v.Lock()
	defer v.Unlock()
	return v.getSnapshotList()
}
796098
func (f *FSM) Snapshot() (raft.FSMSnapshot, error) {
	f.mu.Lock()

	entries := make(map[SnapshotKey]SnapshotEntry)
	for _, group := range f.groups {
		for key, entry := range group {
			entries[SnapshotKey{
				Namespace: key.Namespace,
				ModelUUID: key.ModelUUID,
				Lease:     key.Lease,
			}] = SnapshotEntry{
				Holder:   entry.holder,
				Start:    entry.start,
				Duration: entry.duration,
			}
		}
	}

	pinned := make(map[SnapshotKey][]string)
	for key, entities := range f.pinned {
		if entities.IsEmpty() {
			continue
		}
		pinned[SnapshotKey{
			Namespace: key.Namespace,
			ModelUUID: key.ModelUUID,
			Lease:     key.Lease,
		}] = entities.SortedValues()
	}

	f.mu.Unlock()

	return &Snapshot{
		Version:    SnapshotVersion,
		Entries:    entries,
		Pinned:     pinned,
		GlobalTime: f.globalTime,
	}, nil
}
906874
func (r *Reservoir) Snapshot() []int64 {
	r.m.Lock()
	defer r.m.Unlock()
	s := atomic.SwapInt64(&r.size, 0)
	v := make([]int64, min(int(s), len(r.values)))
	copy(v, r.values)
	r.values = make([]int64, cap(r.values))
	sorted(v)
	return v
}