Documentation ¶
Index ¶
- Constants
- func BackupDateToPath(date time.Time) string
- func NewSnapshotTag(domainName string, now time.Time) string
- type Archive
- type ArchiveOptions
- type BackupMetadata
- type BackupResult
- type BackupResults
- type BuildInfo
- type CleanupResult
- type Credentials
- type Node
- type NodeBinaries
- type NodeCallback
- type NodeCallbackResult
- type NodeCallbackResults
- type NodeInfo
- type RemoteBackup
- type RemoteBackupsByHost
- type RepairResult
- type RepairResults
- type Snapshot
- type SnapshotItem
- type Snapshots
- type SnapshotsByNode
Constants ¶
const NodeStatusOk = "UN"
NodeStatusOk a normal database node status (Up, Normal)
const SnapshotTagDateFormat = "01-02-2006-15-04"
SnapshotTagDateFormat a date format used in snapshot tag
Variables ¶
This section is empty.
Functions ¶
func BackupDateToPath ¶
BackupDateToPath converts a date to a directory path, where the backup will be stored in s3
Types ¶
type Archive ¶ added in v0.2.0
type Archive struct { Method string `yaml:"method"` ArchiveOptions ArchiveOptions `yaml:"options"` }
Archive method and options for compress
type ArchiveOptions ¶ added in v0.2.0
type ArchiveOptions struct { Compression string `yaml:"compression"` Threads string `yaml:"threads"` }
ArchiveOptions options for compress. compression level and number of threads used for compression
type BackupMetadata ¶
type BackupMetadata struct { DateCreated time.Time `yaml:"dateCreated"` Host string Keyspaces []string SnapshotTag string `yaml:"snapshotTag"` BuildInfo BuildInfo `yaml:"buildInfo"` Archive Archive `yaml:"archive"` }
BackupMetadata is written along with each backup, that will help us implement the restoration in the future.
func (BackupMetadata) Bytes ¶
func (b BackupMetadata) Bytes() []byte
type BackupResult ¶
type BackupResult struct { Error error DateStarted time.Time Duration time.Duration SnapshotTag string Keyspaces []string Uploaded bool CleanupResult CleanupResult }
BackupResult a result of running a backup on a single database node
type BackupResults ¶
type BackupResults struct { TotalNodes int BackedUpNodes int ByHost map[string]BackupResult Error error }
BackupResults a list of backup results on multiple database nodes
func (BackupResults) Report ¶
func (b BackupResults) Report() string
Report creates a human-readable report about backup results
type CleanupResult ¶
type CleanupResult struct { // an error that occurred while cleaning up files on a database node, if any LocalError error // an error that occurred while cleaning up a backup in remote storage, if any RemoteError error RemovedRemoteBackups []RemoteBackup }
type Credentials ¶
Credentials scylladb credentials
type Node ¶
type NodeBinaries ¶
NodeBinaries paths to scylladb executables on database node
type NodeCallback ¶
type NodeCallback func(ctx context.Context, node *Node) NodeCallbackResult
NodeCallback a callback function to be applied on database node
type NodeCallbackResult ¶
NodeCallbackResult a result of running a callback on database node
func CallbackError ¶
func CallbackError(err error) NodeCallbackResult
CallbackError creates a callback result with a given error
func CallbackErrorWithValue ¶
func CallbackErrorWithValue(err error, value interface{}) NodeCallbackResult
CallbackErrorWithValue creates a callback result with a given error and value
func CallbackOk ¶
func CallbackOk(value interface{}) NodeCallbackResult
CallbackOk creates a callback result with a given value
type NodeCallbackResults ¶
type NodeCallbackResults map[string]NodeCallbackResult
NodeCallbackResults callback results by hosts
func (NodeCallbackResults) Error ¶
func (results NodeCallbackResults) Error() error
Returns errors from callback results (if any) as a single error
type NodeInfo ¶
type NodeInfo struct { // ip or domain name Host string IpAddress string DomainName string DataPath string ClusterName string Datacenter string // a status according to `nodetool status` Status string Binaries NodeBinaries }
NodeInfo database node information
func NewNodeInfo ¶
func NewNodeInfo(host, dataPath string, binaries NodeBinaries, resolveDns bool) NodeInfo
NewNodeInfo initializes a node information. If resolveDns=true, then it will attempt to resolve the domain name and/or IP address.
func (NodeInfo) IsStatusOk ¶
func (NodeInfo) RemoteStoragePath ¶
RemoteStoragePath returns a path where the backup from a node should be stored in s3. The format is "cluster-name/datacenter/domain-name"
func (NodeInfo) ShortDomainName ¶
ShortDomainName returns a short domain name of a node (up to the first "."), if it is known. Otherwise, returns the "host" value from configuration. Short name is used as a part of a backup path when storing it in s3.
type RemoteBackup ¶
type RemoteBackup struct { Path string HostPrefix string DateCreated time.Time Removed bool RemoveError error }
RemoteBackup a backup info in remote storage
func NewRemoteBackupFromPath ¶
func NewRemoteBackupFromPath(path string) (RemoteBackup, error)
NewRemoteBackupFromPath parses a backup info from its path in remote storage
func (RemoteBackup) String ¶
func (r RemoteBackup) String() string
type RemoteBackupsByHost ¶
type RemoteBackupsByHost map[string][]RemoteBackup
type RepairResult ¶
RepairResult a result of "nodetool repair" command
type RepairResults ¶
type RepairResults struct { TotalNodes int RepairedNodes int ByHost map[string]RepairResult Error error }
RepairResults results of "nodetool repair" on multiple database nodes
func (RepairResults) Report ¶
func (r RepairResults) Report() string
Report creates a human-readable report string about repair results to be used in a notification
type Snapshot ¶
type Snapshot struct { Tag string // keeps the snapshots of specific database tables and indices Items []SnapshotItem }
Snapshot holds an information about database snapshot
type SnapshotItem ¶
SnapshotItem a table or index, part of a snapshot
type Snapshots ¶
Snapshots a set of snapshots, where the map key is snapshot tag
func ParseSnapshots ¶
ParseSnapshots returns a list of snapshots based on `nodetool listsnapshot` output.
type SnapshotsByNode ¶
SnapshotsByNode a set of snapshots on multiple nodes, where the map key is a hostname