package backup_util
import "github.com/influxdata/influxdb/cmd/influxd/backup_util"
Index ¶
- Constants
- func DBRetentionAndShardFromPath(path string) (db, retention, shard string, err error)
- func GetMetaBytes(fname string) (_ []byte, retErr error)
- type CountingWriter
- func (w *CountingWriter) BytesWritten() int64
- func (w *CountingWriter) Write(p []byte) (n int, err error)
- type Entry
- type Manifest
- type MetaEntry
- type PortablePacker
Constants ¶
const ( // Suffix is a suffix added to the backup while it's in-process. Suffix = ".pending" // Metafile is the base name given to the metastore backups. Metafile = "meta" // BackupFilePattern is the beginning of the pattern for a backup // file. They follow the scheme <database>.<retention>.<shardID>.<increment> BackupFilePattern = "%s.%s.%05d" PortableFileNamePattern = "20060102T150405Z" )
Functions ¶
func DBRetentionAndShardFromPath ¶
DBRetentionAndShardFromPath will take the shard relative path and split it into the database name, retention policy name and shard ID. The first part of the path should be the database name.
func GetMetaBytes ¶
Types ¶
type CountingWriter ¶
func (*CountingWriter) BytesWritten ¶
func (w *CountingWriter) BytesWritten() int64
func (*CountingWriter) Write ¶
func (w *CountingWriter) Write(p []byte) (n int, err error)
type Entry ¶
type Entry struct { Database string `json:"database"` Policy string `json:"policy"` ShardID uint64 `json:"shardID"` FileName string `json:"fileName"` Size int64 `json:"size"` LastModified int64 `json:"lastModified"` }
Entry contains the data information for a backed up shard.
func (*Entry) SizeOrZero ¶
type Manifest ¶
type Manifest struct { Meta MetaEntry `json:"meta"` Limited bool `json:"limited"` Files []Entry `json:"files"` Database string `json:"database,omitempty"` Policy string `json:"policy,omitempty"` ShardID uint64 `json:"shard_id,omitempty"` }
Manifest lists the meta and shard file information contained in the backup. If Limited is false, the manifest contains a full backup, otherwise it is a partial backup.
func (*Manifest) Save ¶
func (*Manifest) Size ¶
Size returns the size of the manifest.
type MetaEntry ¶
MetaEntry contains the meta store information for a backup.
func LoadIncremental ¶
LoadIncremental loads multiple manifest files from a given directory.
type PortablePacker ¶
func (PortablePacker) MarshalBinary ¶
func (ep PortablePacker) MarshalBinary() ([]byte, error)
func (*PortablePacker) UnmarshalBinary ¶
func (ep *PortablePacker) UnmarshalBinary(data []byte) error
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd/influxd/backup_util/internal |
- Version
- v1.12.0 (latest)
- Published
- Apr 8, 2025
- Platform
- linux/amd64
- Imports
- 14 packages
- Last checked
- 2 days ago –
Tools for package owners.