replication

package
v7.0.72 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 46

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type And

type And struct {
	XMLName xml.Name `xml:"And,omitempty" json:"-"`
	Prefix  string   `xml:"Prefix,omitempty" json:"Prefix,omitempty"`
	Tags    []Tag    `xml:"Tag,omitempty" json:"Tag,omitempty"`
}

And - a tag to combine a prefix and multiple tags for replication configuration rule.

type Config

type Config struct {
	XMLName xml.Name `xml:"ReplicationConfiguration" json:"-"`
	Rules   []Rule   `xml:"Rule" json:"Rules"`
	Role    string   `xml:"Role" json:"Role"`
}

Config - replication configuration specified in https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html

func (*Config) AddRule added in v7.0.3

func (c *Config) AddRule(opts Options) error

AddRule adds a new rule to existing replication config. If a rule exists with the same ID, then the rule is replaced.

func (*Config) EditRule added in v7.0.5

func (c *Config) EditRule(opts Options) error

EditRule modifies an existing rule in replication config

func (*Config) Empty

func (c *Config) Empty() bool

Empty returns true if config is not set

func (*Config) RemoveRule added in v7.0.3

func (c *Config) RemoveRule(opts Options) error

RemoveRule removes a rule from replication config.

type DeleteMarkerReplication

type DeleteMarkerReplication struct {
	Status Status `xml:"Status" json:"Status"` // should be set to "Disabled" by default
}

DeleteMarkerReplication - whether delete markers are replicated - https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html

func (DeleteMarkerReplication) IsEmpty

func (d DeleteMarkerReplication) IsEmpty() bool

IsEmpty returns true if DeleteMarkerReplication is not set

type DeleteReplication added in v7.0.6

type DeleteReplication struct {
	Status Status `xml:"Status" json:"Status"` // should be set to "Disabled" by default
}

DeleteReplication - whether versioned deletes are replicated - this is a MinIO specific extension

func (DeleteReplication) IsEmpty added in v7.0.6

func (d DeleteReplication) IsEmpty() bool

IsEmpty returns true if DeleteReplication is not set

type Destination

type Destination struct {
	XMLName      xml.Name `xml:"Destination" json:"-"`
	Bucket       string   `xml:"Bucket" json:"Bucket"`
	StorageClass string   `xml:"StorageClass,omitempty" json:"StorageClass,omitempty"`
}

Destination - destination in ReplicationConfiguration.

type ExistingObjectReplication added in v7.0.11

type ExistingObjectReplication struct {
	Status Status `xml:"Status"` // should be set to "Disabled" by default
}

ExistingObjectReplication - whether existing object replication is enabled

func (ExistingObjectReplication) IsEmpty added in v7.0.11

func (e ExistingObjectReplication) IsEmpty() bool

IsEmpty returns true if DeleteMarkerReplication is not set

func (ExistingObjectReplication) Validate added in v7.0.11

func (e ExistingObjectReplication) Validate() error

Validate validates whether the status is disabled.

type Filter

type Filter struct {
	XMLName xml.Name `xml:"Filter" json:"-"`
	Prefix  string   `json:"Prefix,omitempty"`
	And     And      `xml:"And,omitempty" json:"And,omitempty"`
	Tag     Tag      `xml:"Tag,omitempty" json:"Tag,omitempty"`
}

Filter - a filter for a replication configuration Rule.

func (Filter) Validate added in v7.0.3

func (f Filter) Validate() error

Validate - validates the filter element

type InQueueMetric added in v7.0.63

type InQueueMetric struct {
	Curr QStat `json:"curr" msg:"cq"`
	Avg  QStat `json:"avg" msg:"aq"`
	Max  QStat `json:"peak" msg:"pq"`
}

InQueueMetric holds stats for objects in replication queue

type MetricName added in v7.0.59

type MetricName string

MetricName name of replication metric

const (
	// Large is a metric name for large objects >=128MiB
	Large MetricName = "Large"
	// Small is a metric name for  objects <128MiB size
	Small MetricName = "Small"
	// Total is a metric name for total objects
	Total MetricName = "Total"
)

type Metrics added in v7.0.11

type Metrics struct {
	Stats map[string]TargetMetrics
	// Completed size in bytes  across targets
	ReplicatedSize uint64 `json:"completedReplicationSize,omitempty"`
	// Total Replica size in bytes  across targets
	ReplicaSize uint64 `json:"replicaSize,omitempty"`
	// Total Replica counts
	ReplicaCount int64 `json:"replicaCount,omitempty"`
	// Total Replicated count
	ReplicatedCount int64 `json:"replicationCount,omitempty"`
	// errors seen in replication in last minute, hour and total
	Errors TimedErrStats `json:"failed,omitempty"`
	// Total number of entries that are queued for replication
	QStats InQueueMetric `json:"queued"`
	// Deprecated fields
	// Total Pending size in bytes across targets
	PendingSize uint64 `json:"pendingReplicationSize,omitempty"`
	// Failed size in bytes  across targets
	FailedSize uint64 `json:"failedReplicationSize,omitempty"`
	// Total number of pending operations including metadata updates across targets
	PendingCount uint64 `json:"pendingReplicationCount,omitempty"`
	// Total number of failed operations including metadata updates across targets
	FailedCount uint64 `json:"failedReplicationCount,omitempty"`
}

Metrics represents inline replication metrics for a bucket.

type MetricsV2 added in v7.0.59

type MetricsV2 struct {
	Uptime       int64          `json:"uptime"`
	CurrentStats Metrics        `json:"currStats"`
	QueueStats   ReplQueueStats `json:"queueStats"`
}

MetricsV2 represents replication metrics for a bucket.

type OptionType added in v7.0.3

type OptionType string

OptionType specifies operation to be performed on config

const (
	// AddOption specifies addition of rule to config
	AddOption OptionType = "Add"
	// SetOption specifies modification of existing rule to config
	SetOption OptionType = "Set"

	// RemoveOption specifies rule options are for removing a rule
	RemoveOption OptionType = "Remove"
	// ImportOption is for getting current config
	ImportOption OptionType = "Import"
)

type Options added in v7.0.3

type Options struct {
	Op                      OptionType
	RoleArn                 string
	ID                      string
	Prefix                  string
	RuleStatus              string
	Priority                string
	TagString               string
	StorageClass            string
	DestBucket              string
	IsTagSet                bool
	IsSCSet                 bool
	ReplicateDeletes        string // replicate versioned deletes
	ReplicateDeleteMarkers  string // replicate soft deletes
	ReplicaSync             string // replicate replica metadata modifications
	ExistingObjectReplicate string
}

Options represents options to set a replication configuration rule

func (Options) Tags added in v7.0.3

func (opts Options) Tags() ([]Tag, error)

Tags returns a slice of tags for a rule

type QStat added in v7.0.63

type QStat struct {
	Count float64 `json:"count"`
	Bytes float64 `json:"bytes"`
}

QStat holds count and bytes for objects in replication queue

func (*QStat) Add added in v7.0.63

func (q *QStat) Add(q1 QStat)

Add 2 QStat entries

type RStat added in v7.0.63

type RStat struct {
	Count float64 `json:"count"`
	Bytes int64   `json:"bytes"`
}

RStat - has count and bytes for replication metrics

func (RStat) Add added in v7.0.63

func (r RStat) Add(r1 RStat) RStat

Add two RStat

type ReplMRFStats added in v7.0.63

type ReplMRFStats struct {
	LastFailedCount uint64 `json:"failedCount_last5min"`
	// Count of unreplicated entries that were dropped after MRF retry limit reached since cluster start.
	TotalDroppedCount uint64 `json:"droppedCount_since_uptime"`
	// Bytes of unreplicated entries that were dropped after MRF retry limit reached since cluster start.
	TotalDroppedBytes uint64 `json:"droppedBytes_since_uptime"`
}

ReplMRFStats holds stats of MRF backlog saved to disk in the last 5 minutes and number of entries that failed replication after 3 retries

type ReplQNodeStats added in v7.0.59

type ReplQNodeStats struct {
	NodeName string     `json:"nodeName"`
	Uptime   int64      `json:"uptime"`
	Workers  WorkerStat `json:"activeWorkers"`

	XferStats    map[MetricName]XferStats            `json:"transferSummary"`
	TgtXferStats map[string]map[MetricName]XferStats `json:"tgtTransferStats"`

	QStats   InQueueMetric `json:"queueStats"`
	MRFStats ReplMRFStats  `json:"mrfStats"`
}

ReplQNodeStats holds stats for a node in replication queue

type ReplQStats added in v7.0.59

type ReplQStats struct {
	Uptime  int64      `json:"uptime"`
	Workers WorkerStat `json:"workers"`

	XferStats    map[MetricName]XferStats            `json:"xferStats"`
	TgtXferStats map[string]map[MetricName]XferStats `json:"tgtXferStats"`

	QStats   InQueueMetric `json:"qStats"`
	MRFStats ReplMRFStats  `json:"mrfStats"`
}

ReplQStats holds stats for objects in replication queue

type ReplQueueStats added in v7.0.59

type ReplQueueStats struct {
	Nodes []ReplQNodeStats `json:"nodes"`
}

ReplQueueStats holds stats for replication queue across nodes

func (ReplQueueStats) QStats added in v7.0.59

func (q ReplQueueStats) QStats() (r ReplQStats)

QStats returns cluster level stats for objects in replication queue

func (ReplQueueStats) Workers added in v7.0.59

func (q ReplQueueStats) Workers() (tot WorkerStat)

Workers returns number of workers across all nodes

type ReplicaModifications added in v7.0.7

type ReplicaModifications struct {
	Status Status `xml:"Status" json:"Status"` // should be set to "Enabled" by default
}

ReplicaModifications specifies if replica modification sync is enabled

type ResyncTarget added in v7.0.14

type ResyncTarget struct {
	Arn       string    `json:"arn"`
	ResetID   string    `json:"resetid"`
	StartTime time.Time `json:"startTime,omitempty"`
	EndTime   time.Time `json:"endTime,omitempty"`
	// Status of resync operation
	ResyncStatus string `json:"resyncStatus,omitempty"`
	// Completed size in bytes
	ReplicatedSize int64 `json:"completedReplicationSize,omitempty"`
	// Failed size in bytes
	FailedSize int64 `json:"failedReplicationSize,omitempty"`
	// Total number of failed operations
	FailedCount int64 `json:"failedReplicationCount,omitempty"`
	// Total number of completed operations
	ReplicatedCount int64 `json:"replicationCount,omitempty"`
	// Last bucket/object replicated.
	Bucket string `json:"bucket,omitempty"`
	Object string `json:"object,omitempty"`
}

ResyncTarget provides the replica resources and resetID to initiate resync replication.

type ResyncTargetsInfo added in v7.0.14

type ResyncTargetsInfo struct {
	Targets []ResyncTarget `json:"target,omitempty"`
}

ResyncTargetsInfo provides replication target information to resync replicated data.

type Rule

type Rule struct {
	XMLName                   xml.Name                  `xml:"Rule" json:"-"`
	ID                        string                    `xml:"ID,omitempty"`
	Status                    Status                    `xml:"Status"`
	Priority                  int                       `xml:"Priority"`
	DeleteMarkerReplication   DeleteMarkerReplication   `xml:"DeleteMarkerReplication"`
	DeleteReplication         DeleteReplication         `xml:"DeleteReplication"`
	Destination               Destination               `xml:"Destination"`
	Filter                    Filter                    `xml:"Filter" json:"Filter"`
	SourceSelectionCriteria   SourceSelectionCriteria   `xml:"SourceSelectionCriteria" json:"SourceSelectionCriteria"`
	ExistingObjectReplication ExistingObjectReplication `xml:"ExistingObjectReplication,omitempty" json:"ExistingObjectReplication,omitempty"`
}

Rule - a rule for replication configuration.

func (Rule) Prefix added in v7.0.3

func (r Rule) Prefix() string

Prefix - a rule can either have prefix under <filter></filter> or under <filter><and></and></filter>. This method returns the prefix from the location where it is available

func (Rule) Tags added in v7.0.3

func (r Rule) Tags() string

Tags - a rule can either have tag under <filter></filter> or under <filter><and></and></filter>. This method returns all the tags from the rule in the format tag1=value1&tag2=value2

func (Rule) Validate added in v7.0.3

func (r Rule) Validate() error

Validate validates the rule for correctness

type SourceSelectionCriteria added in v7.0.7

type SourceSelectionCriteria struct {
	ReplicaModifications ReplicaModifications `xml:"ReplicaModifications" json:"ReplicaModifications"`
}

SourceSelectionCriteria - specifies additional source selection criteria in ReplicationConfiguration.

func (SourceSelectionCriteria) IsValid added in v7.0.7

func (s SourceSelectionCriteria) IsValid() bool

IsValid - checks whether SourceSelectionCriteria is valid or not.

func (SourceSelectionCriteria) Validate added in v7.0.7

func (s SourceSelectionCriteria) Validate() error

Validate source selection criteria

type Status

type Status string

Status represents Enabled/Disabled status

const (
	Enabled  Status = "Enabled"
	Disabled Status = "Disabled"
)

Supported status types

type Tag

type Tag struct {
	XMLName xml.Name `json:"-"`
	Key     string   `xml:"Key,omitempty" json:"Key,omitempty"`
	Value   string   `xml:"Value,omitempty" json:"Value,omitempty"`
}

Tag - a tag for a replication configuration Rule filter.

func (Tag) IsEmpty added in v7.0.3

func (tag Tag) IsEmpty() bool

IsEmpty returns whether this tag is empty or not.

func (Tag) String added in v7.0.3

func (tag Tag) String() string

func (Tag) Validate added in v7.0.3

func (tag Tag) Validate() error

Validate checks this tag.

type TargetMetrics added in v7.0.14

type TargetMetrics struct {
	// Completed count
	ReplicatedCount uint64 `json:"replicationCount,omitempty"`
	// Completed size in bytes
	ReplicatedSize uint64 `json:"completedReplicationSize,omitempty"`
	// Bandwidth limit in bytes/sec for this target
	BandWidthLimitInBytesPerSecond int64 `json:"limitInBits,omitempty"`
	// Current bandwidth used in bytes/sec for this target
	CurrentBandwidthInBytesPerSecond float64 `json:"currentBandwidth,omitempty"`
	// errors seen in replication in last minute, hour and total
	Failed TimedErrStats `json:"failed,omitempty"`
	// Deprecated fields
	// Pending size in bytes
	PendingSize uint64 `json:"pendingReplicationSize,omitempty"`
	// Total Replica size in bytes
	ReplicaSize uint64 `json:"replicaSize,omitempty"`
	// Failed size in bytes
	FailedSize uint64 `json:"failedReplicationSize,omitempty"`
	// Total number of pending operations including metadata updates
	PendingCount uint64 `json:"pendingReplicationCount,omitempty"`
	// Total number of failed operations including metadata updates
	FailedCount uint64 `json:"failedReplicationCount,omitempty"`
}

TargetMetrics represents inline replication metrics such as pending, failed and completed bytes in total for a bucket remote target

type TimedErrStats added in v7.0.63

type TimedErrStats struct {
	LastMinute RStat `json:"lastMinute"`
	LastHour   RStat `json:"lastHour"`
	Totals     RStat `json:"totals"`
}

TimedErrStats holds error stats for a time period

func (TimedErrStats) Add added in v7.0.63

Add two TimedErrStats

type WorkerStat added in v7.0.63

type WorkerStat struct {
	Curr int32   `json:"curr"`
	Avg  float32 `json:"avg"`
	Max  int32   `json:"max"`
}

WorkerStat has stats on number of replication workers

type XferStats added in v7.0.59

type XferStats struct {
	AvgRate  float64 `json:"avgRate"`
	PeakRate float64 `json:"peakRate"`
	CurrRate float64 `json:"currRate"`
}

XferStats holds transfer rate info for uploads/sec

func (*XferStats) Merge added in v7.0.63

func (x *XferStats) Merge(x1 XferStats)

Merge two XferStats

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL