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, localStatus *LocalStatus, ) *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 DeletedCounters ¶ added in v1.36.0
func (DeletedCounters) ToLogFields ¶ added in v1.36.0
func (dc DeletedCounters) ToLogFields(maxCollectionNameLen int) (fields logrus.Fields, total int32)
type LocalStatus ¶ added in v1.36.0
type LocalStatus struct {
// contains filtered or unexported fields
}
LocalStatus keeps status of ongoing TTL deletion on local node. isRunning is set to true when TTL deletion start and reset when finishes. Status is global per node. Only one deletion can run at a time, following requests to start new deletion should be rejected until ongoing one finishes. When running flag is set new context is created to be passed to started process. Context can be cancelled by abort call, which should eventually stop ongoing deletion. Abort call do not change isRunning flag. It is changed when deletion is actually finished, as context can be verified with delay.
func NewLocalStatus ¶ added in v1.36.0
func NewLocalStatus() *LocalStatus
func (*LocalStatus) IsRunning ¶ added in v1.36.0
func (s *LocalStatus) IsRunning() bool
func (*LocalStatus) ResetRunning ¶ added in v1.36.0
func (s *LocalStatus) ResetRunning(cause string) (success bool)
func (*LocalStatus) SetRunning ¶ added in v1.36.0
func (s *LocalStatus) SetRunning() (success bool, ctx context.Context)
type ObjectsExpiredAbortResponse ¶ added in v1.36.0
type ObjectsExpiredAbortResponse struct {
Aborted bool `json:"aborted"`
}
func (ObjectsExpiredAbortResponse) CheckContentTypeHeader ¶ added in v1.36.0
func (p ObjectsExpiredAbortResponse) CheckContentTypeHeader(r *http.Response) (string, bool)
func (ObjectsExpiredAbortResponse) MIME ¶ added in v1.36.0
func (p ObjectsExpiredAbortResponse) MIME() string
func (ObjectsExpiredAbortResponse) SetContentTypeHeader ¶ added in v1.36.0
func (p ObjectsExpiredAbortResponse) SetContentTypeHeader(w http.ResponseWriter)
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) CheckContentTypeHeader ¶ added in v1.36.0
func (p ObjectsExpiredStatusResponse) CheckContentTypeHeader(r *http.Response) (string, bool)
func (ObjectsExpiredStatusResponse) MIME ¶
func (p ObjectsExpiredStatusResponse) MIME() string
func (ObjectsExpiredStatusResponse) SetContentTypeHeader ¶
func (p ObjectsExpiredStatusResponse) SetContentTypeHeader(w http.ResponseWriter)