@@ -337,21 +337,13 @@ impl InflightActivationStoreConfig {
337337
338338#[ async_trait]
339339pub trait InflightActivationStore : Send + Sync {
340- /// Trigger incremental vacuum to reclaim free pages in the database
341- async fn vacuum_db ( & self ) -> Result < ( ) , Error > ;
342-
343- /// Perform a full vacuum on the database
344- async fn full_vacuum_db ( & self ) -> Result < ( ) , Error > ;
345-
346- /// Get the size of the database in bytes
347- async fn db_size ( & self ) -> Result < u64 , Error > ;
348-
349- /// Get an activation by id
350- async fn get_by_id ( & self , id : & str ) -> Result < Option < InflightActivation > , Error > ;
351-
340+ /// CONSUMER OPERATIONS
352341 /// Store a batch of activations
353342 async fn store ( & self , batch : Vec < InflightActivation > ) -> Result < QueryResult , Error > ;
354343
344+ fn assign_partitions ( & self , partitions : Vec < i32 > ) -> Result < ( ) , Error > ;
345+
346+ /// SERVER OPERATIONS
355347 /// Get a single pending activation, optionally filtered by namespace
356348 async fn get_pending_activation (
357349 & self ,
@@ -385,6 +377,14 @@ pub trait InflightActivationStore: Send + Sync {
385377 limit : Option < i32 > ,
386378 ) -> Result < Vec < InflightActivation > , Error > ;
387379
380+ /// Update the status of a specific activation
381+ async fn set_status (
382+ & self ,
383+ id : & str ,
384+ status : InflightActivationStatus ,
385+ ) -> Result < Option < InflightActivation > , Error > ;
386+
387+ /// COUNT OPERATIONS
388388 /// Get the age of the oldest pending activation in seconds
389389 async fn pending_activation_max_lag ( & self , now : & DateTime < Utc > ) -> f64 ;
390390
@@ -400,12 +400,9 @@ pub trait InflightActivationStore: Send + Sync {
400400 /// Count all activations
401401 async fn count ( & self ) -> Result < usize , Error > ;
402402
403- /// Update the status of a specific activation
404- async fn set_status (
405- & self ,
406- id : & str ,
407- status : InflightActivationStatus ,
408- ) -> Result < Option < InflightActivation > , Error > ;
403+ /// ACTIVATION OPERATIONS
404+ /// Get an activation by id
405+ async fn get_by_id ( & self , id : & str ) -> Result < Option < InflightActivation > , Error > ;
409406
410407 /// Set the processing deadline for a specific activation
411408 async fn set_processing_deadline (
@@ -417,12 +414,20 @@ pub trait InflightActivationStore: Send + Sync {
417414 /// Delete an activation by id
418415 async fn delete_activation ( & self , id : & str ) -> Result < ( ) , Error > ;
419416
417+ /// DATABASE OPERATIONS
418+ /// Trigger incremental vacuum to reclaim free pages in the database
419+ async fn vacuum_db ( & self ) -> Result < ( ) , Error > ;
420+
421+ /// Perform a full vacuum on the database
422+ async fn full_vacuum_db ( & self ) -> Result < ( ) , Error > ;
423+
424+ /// Get the size of the database in bytes
425+ async fn db_size ( & self ) -> Result < u64 , Error > ;
426+
427+ /// UPKEEP OPERATIONS
420428 /// Get all activations with status Retry
421429 async fn get_retry_activations ( & self ) -> Result < Vec < InflightActivation > , Error > ;
422430
423- /// Clear all activations from the store
424- async fn clear ( & self ) -> Result < ( ) , Error > ;
425-
426431 /// Update tasks that exceeded their processing deadline
427432 async fn handle_processing_deadline ( & self ) -> Result < u64 , Error > ;
428433
@@ -447,6 +452,10 @@ pub trait InflightActivationStore: Send + Sync {
447452 /// Remove killswitched tasks
448453 async fn remove_killswitched ( & self , killswitched_tasks : Vec < String > ) -> Result < u64 , Error > ;
449454
455+ /// TEST OPERATIONS
456+ /// Clear all activations from the store
457+ async fn clear ( & self ) -> Result < ( ) , Error > ;
458+
450459 /// Remove the database, used only in tests
451460 async fn remove_db ( & self ) -> Result < ( ) , Error > {
452461 Ok ( ( ) )
@@ -714,6 +723,10 @@ impl InflightActivationStore for SqliteActivationStore {
714723 Ok ( Some ( row. into ( ) ) )
715724 }
716725
726+ fn assign_partitions ( & self , partitions : Vec < i32 > ) -> Result < ( ) , Error > {
727+ Ok ( ( ) )
728+ }
729+
717730 #[ instrument( skip_all) ]
718731 async fn store ( & self , batch : Vec < InflightActivation > ) -> Result < QueryResult , Error > {
719732 if batch. is_empty ( ) {
0 commit comments