Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add solr snapshot status #119

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apis/addons/v1alpha1/addon_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ type Task struct {
// Valid values are:
// - "Restic": The underlying tool is [restic](https://restic.net/).
// - "WalG": The underlying tool is [wal-g](https://github.com/wal-g/wal-g).
// +kubebuilder:validation:Enum=Restic;WalG;VolumeSnapshotter;
// +kubebuilder:validation:Enum=Restic;WalG;VolumeSnapshotter;Solr;
Driver apis.Driver `json:"driver,omitempty"`

// Executor specifies the type of entity that will execute the task. For example, it can be a Job,
Expand Down
31 changes: 31 additions & 0 deletions apis/storage/v1alpha1/snapshot_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ type Component struct {
VolumeSnapshotterStats []VolumeSnapshotterStats `json:"volumeSnapshotterStats,omitempty"`
// WalSegments specifies a list of wall segment for individual component
WalSegments []WalSegment `json:"walSegments,omitempty"`

// SolrStats represents the Solr specific information
SolrStats []SolrStat `json:"solrStats,omitempty"`
}

// ComponentPhase represents the backup phase of the individual component.
Expand Down Expand Up @@ -246,6 +249,34 @@ type ResticStats struct {
EndTime *metav1.Time `json:"endTime,omitempty"`
}

// SolrStat specifies Solr driver related information
type SolrStat struct {
// Collection represents the name of the Solr collection.
Collection string `json:"collection,omitempty"`

// BackupId represents the Solr snapshot id.
BackupId int `json:"backupId,omitempty"`

// Location represents the location where the backup exists.
Location string `json:"location,omitempty"`

// StartTime represents the Solr backup start time.
// +optional
StartTime string `json:"startTime,omitempty"`

// IndexFileCount represents the number of index files in Solr backup.
// +optional
IndexFileCount int `json:"indexFileCount,omitempty"`

// IndexFileCount represents the size of index files in Solr backup.
// +optional
IndexSizeMB float64 `json:"indexSizeMB,omitempty"`

// IndexFileSizeUploaded represents the size uploaded solr index file size in solr backup
// +optional
UploadedIndexFileMB float64 `json:"uploadedIndexFileMB,omitempty"`
}

// VolumeSnapshotterStats specifies the "VolumeSnapshotter" driver specific information
type VolumeSnapshotterStats struct {

Expand Down
20 changes: 20 additions & 0 deletions apis/storage/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion apis/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ import (
)

// Driver specifies the name of underlying tool that is being used to upload the backed up data.
// +kubebuilder:validation:Enum=Restic;WalG;VolumeSnapshotter
// +kubebuilder:validation:Enum=Restic;WalG;VolumeSnapshotter;Solr
type Driver string

const (
DriverRestic Driver = "Restic"
DriverWalG Driver = "WalG"
DriverVolumeSnapshotter Driver = "VolumeSnapshotter"
DriverSolr Driver = "Solr"
)

// VolumeSource specifies the source of volume to mount in the backup/restore executor
Expand Down
4 changes: 4 additions & 0 deletions crds/addons.kubestash.com_addons.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ spec:
- Restic
- WalG
- VolumeSnapshotter
- Solr
- enum:
- Restic
- WalG
- VolumeSnapshotter
- Solr
type: string
executor:
enum:
Expand Down Expand Up @@ -1036,10 +1038,12 @@ spec:
- Restic
- WalG
- VolumeSnapshotter
- Solr
- enum:
- Restic
- WalG
- VolumeSnapshotter
- Solr
type: string
executor:
enum:
Expand Down
22 changes: 22 additions & 0 deletions crds/storage.kubestash.com_snapshots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ spec:
- Restic
- WalG
- VolumeSnapshotter
- Solr
type: string
duration:
type: string
Expand Down Expand Up @@ -129,6 +130,27 @@ spec:
type: array
size:
type: string
solrStats:
items:
properties:
backupId:
type: integer
collection:
type: string
indexFileCount:
type: integer
indexSizeMB:
format: double
type: number
location:
type: string
startTime:
type: string
uploadedIndexFileMB:
format: double
type: number
type: object
type: array
volumeSnapshotterStats:
items:
properties:
Expand Down
Loading