objectttl

package
v1.35.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coordinator

type Coordinator struct {
	// contains filtered or unexported fields
}

func NewCoordinator

func NewCoordinator(schemaReader schemaUC.SchemaReader, schemaGetter schemaUC.SchemaGetter, db *db.DB, logger logrus.FieldLogger, clusterClient *http.Client, nodeResolver nodeResolver) *Coordinator

func (*Coordinator) Start

func (c *Coordinator) Start(ctx context.Context, targetOwnNode bool, ttlTime, deletionTime time.Time) error

Start triggers the deletion of expired objects.

It is expected to be called periodically, e.g., via a cron job on the RAFT Leader to ensure that there are no parallel executions running. The RAFT leader will send a request to a remote node in multi-node clusters as the coordinator of the next deletion run to not add any additional load on the leader. In single-node clusters, it will execute the deletion locally.

There should always only one deletion run ongoing at any time. In case of remote deletions it will check with the last node used for deletion if the previous run is still ongoing and skip the current run if so.

type ObjectsExpiredPayload

type ObjectsExpiredPayload struct {
	Class        string `json:"class"`
	ClassVersion uint64 `json:"class_version"`
	Prop         string `json:"prop"`
	TtlMilli     int64  `json:"ttlMilli"`
	DelMilli     int64  `json:"delMilli"`
}

func (ObjectsExpiredPayload) CheckContentTypeHeaderReq

func (p ObjectsExpiredPayload) CheckContentTypeHeaderReq(r *http.Request) (string, bool)

func (ObjectsExpiredPayload) MIME

func (p ObjectsExpiredPayload) MIME() string

func (ObjectsExpiredPayload) SetContentTypeHeaderReq

func (p ObjectsExpiredPayload) SetContentTypeHeaderReq(r *http.Request)

type ObjectsExpiredStatusResponse

type ObjectsExpiredStatusResponse struct {
	DeletionOngoing bool `json:"deletion_ongoing"`
}

func (ObjectsExpiredStatusResponse) CheckContentTypeHeaderReq

func (p ObjectsExpiredStatusResponse) CheckContentTypeHeaderReq(r *http.Request) (string, bool)

func (ObjectsExpiredStatusResponse) MIME

func (ObjectsExpiredStatusResponse) SetContentTypeHeader

func (p ObjectsExpiredStatusResponse) SetContentTypeHeader(w http.ResponseWriter)

func (ObjectsExpiredStatusResponse) SetContentTypeHeaderReq

func (p ObjectsExpiredStatusResponse) SetContentTypeHeaderReq(r *http.Request)

Jump to

Keyboard shortcuts

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