// Dump dump the request
963856
func (r *Resp) Dump() string {
	dump := new(dumpBuffer)
	if r.r.flag&Lcost != 0 {
		dump.WriteString(fmt.Sprint(r.cost))
	}
	r.dumpRequest(dump)
	l := dump.Len()
	if l > 0 {
		dump.WriteString("=================================")
		l = dump.Len()
	}

	r.dumpResponse(dump)

	return dump.String()
}
30233
func Dump(c context.Context, w io.Writer) (n int, err error) {
	return logging.Get(c).(*MemLogger).Dump(w)
}
874889
func (s *AtomicSequence) Dump() ([]byte, error) {
	if !s.IsStarted() {
		return nil, errors.New("cannot dump an uninitialized or unstarted sequence")
	}

	data := make(map[string]uint64)
	data["current"] = atomic.LoadUint64(&s.current)
	data["increment"] = atomic.LoadUint64(&s.increment)
	data["minvalue"] = atomic.LoadUint64(&s.minvalue)
	data["maxvalue"] = atomic.LoadUint64(&s.maxvalue)

	return json.Marshal(data)
}
741888
func (db *DB) Dump(dest string) error {
	db.schemaLock.Lock()
	defer db.schemaLock.Unlock()
	cpFun := func(currPath string, info os.FileInfo, err error) error {
		if err != nil {
			return err
		}
		if info.IsDir() {
			relPath, err := filepath.Rel(db.path, currPath)
			if err != nil {
				return err
			}
			destDir := path.Join(dest, relPath)
			if err := os.MkdirAll(destDir, 0700); err != nil {
				return err
			}
			tdlog.Noticef("Dump: created directory %s", destDir)
		} else {
			src, err := os.Open(currPath)
			if err != nil {
				return err
			}
			relPath, err := filepath.Rel(db.path, currPath)
			if err != nil {
				return err
			}
			destPath := path.Join(dest, relPath)
			if _, fileExists := os.Open(destPath); fileExists == nil {
				return fmt.Errorf("Destination file %s already exists", destPath)
			}
			destFile, err := os.Create(destPath)
			if err != nil {
				return err
			}
			written, err := io.Copy(destFile, src)
			if err != nil {
				return err
			}
			_ = destFile.Close()
			_ = src.Close()
			tdlog.Noticef("Dump: copied file %s, size is %d", destPath, written)
		}
		return nil
	}
	return filepath.Walk(db.path, cpFun)
}
91899
func (p *PreFilter) Dump(to []string) ([]string, int64) {
	p.mutex.RLock()
	defer p.mutex.RUnlock()
	for i := prefixesV4Dyn; i < mapCount; i++ {
		to = p.dumpOneMap(i, to)
	}
	return to, p.revision
}
413347
func DumpToString(i interface{}) string {
	buf := new(bytes.Buffer)
	Dump(buf, i)
	return buf.String()
}
695244
func (kvmsg *Kvmsg) Dump() {
	size := kvmsg.Size()
	body, _ := kvmsg.GetBody()
	seq, _ := kvmsg.GetSequence()
	key, _ := kvmsg.GetKey()
	fmt.Fprintf(os.Stderr, "[seq:%v][key:%v][size:%v] ", seq, key, size)
	p := "["
	for _, prop := range kvmsg.props {
		fmt.Fprint(os.Stderr, p, prop)
		p = ";"
	}
	if p == ";" {
		fmt.Fprint(os.Stderr, "]")
	}
	for char_nbr := 0; char_nbr < size; char_nbr++ {
		fmt.Fprintf(os.Stderr, "%02X", body[char_nbr])
	}
	fmt.Fprintln(os.Stderr)
}
1156586
func (r *Redis) Dump(key string) ([]byte, error) {
	rp, err := r.ExecuteCommand("DUMP", key)
	if err != nil {
		return nil, err
	}
	return rp.BytesValue()
}
582758
func (m *Message) Dump() (resp string) {
	var keys []string

	for k := range m.Headers {
		keys = append(keys, k)
	}

	sort.Strings(keys)

	for _, k := range keys {
		resp += fmt.Sprintf("%s: %s\r\n", k, m.Headers[k])
	}

	resp += fmt.Sprintf("BODY: %v\r\n", string(m.Body))

	return
}
844639
func (md *mongoDumper) Dump(baseDumpDir string) error {
	if err := md.dump(baseDumpDir); err != nil {
		return errors.Trace(err)
	}

	found, err := listDatabases(baseDumpDir)
	if err != nil {
		return errors.Trace(err)
	}

	// Strip the ignored database from the dump dir.
	ignored := found.Difference(md.Targets)
	// Admin must be removed only if the mongo version is 3.x or
	// above, since 2.x will not restore properly without admin.
	if md.DBInfo.MongoVersion.NewerThan(mongo.Mongo26) == -1 {
		ignored.Remove("admin")
	}
	err = stripIgnored(ignored, baseDumpDir)
	return errors.Trace(err)
}
1169504
func Dump(file string, v interface{}) error {
	b, err := Marshal(v)
	if err != nil {
		return err
	}

	return ioutil.WriteFile(file, b, 0644)
}
744985
func Sdump(a ...interface{}) string {
	var buf bytes.Buffer
	fdump(&Config, &buf, a...)
	return buf.String()
}
100181
func (o Options) Dump(values ...interface{}) {
	for i, value := range values {
		state := newDumpState(value, &o, os.Stdout)
		if i > 0 {
			state.w.Write([]byte(o.Separator))
		}
		state.dump(value)
	}
	os.Stdout.Write([]byte("\n"))
}
145614
func (met *Metrics) Dump() ([]byte, error) {
	snapshot := make(map[string]int64)

	met.storeGuard.RLock()
	for key, value := range met.store {
		snapshot[key] = atomic.LoadInt64(value)
	}
	met.storeGuard.RUnlock()

	met.rateGuard.RLock()
	for key, rate := range met.rates {
		snapshot[key] = rate.value
	}
	met.rateGuard.RUnlock()

	return json.Marshal(snapshot)
}
1056235
func (c *Config) Dumps() (dump []byte, err error) {
	dump, err = json.Marshal(c)
	if err != nil {
		return
	}
	return
}
873404
func (c *Client) dumpResponse(resp *http.Response) {
	if c.tracelog != nil {
		out, err := httputil.DumpResponse(resp, true)
		if err == nil {
			c.tracef("%s\n", string(out))
		}
	}
}
1111888
func DumpToMap() (map[string]*EndpointInfo, error) {
	m := map[string]*EndpointInfo{}
	callback := func(key bpf.MapKey, value bpf.MapValue) {
		if info, ok := value.(*EndpointInfo); ok {
			if endpointKey, ok := key.(*EndpointKey); ok {
				m[endpointKey.ToIP().String()] = info
			}
		}
	}

	if err := LXCMap.DumpWithCallback(callback); err != nil {
		return nil, fmt.Errorf("unable to read BPF endpoint list: %s", err)
	}

	return m, nil
}