mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-06 12:07:51 +01:00
feat(s3/lifecycle): event router + schedule (Phase 3 PR-C) (#9355)
feat(s3/lifecycle): event router + DueTime schedule Router consumes per-shard reader events, looks up matching ActionKeys via the engine's BucketActionKeys index, and emits Matches with DueTime = event_time + action.Delay. Evaluation runs at DueTime so the age gate passes for fresh events; the dispatcher's identity-CAS catches drift. Schedule is a min-heap by DueTime; duplicates allowed (RPC CAS handles the redundant dispatch as NOOP_RESOLVED). BucketActionKeys accessor added to engine.Snapshot.
This commit is contained in:
1 parent
0f6c6b0524
commit
8425c42858
5 files changed
+496
No files matched your search
@@ -118,3 +118,15 @@ func (s *Snapshot) BucketVersioned(bucket string) bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// BucketActionKeys returns a defensive copy of the action keys for bucket,
|
||||
// or nil if the bucket has no compiled actions in this snapshot.
|
||||
func (s *Snapshot) BucketActionKeys(bucket string) []s3lifecycle.ActionKey {
|
||||
bi, ok := s.buckets[bucket]
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
out := make([]s3lifecycle.ActionKey, len(bi.actionKeys))
|
||||
copy(out, bi.actionKeys)
|
||||
return out
|
||||
}
|
||||
Reference in new issue
Block a user