@@ -74,6 +74,9 @@ pub trait EventListener: Send + Sync {
7474 /// Notifies the listener that region starts to send a region change result to worker.
7575 async fn on_notify_region_change_result_begin ( & self , _region_id : RegionId ) { }
7676
77+ /// Notifies the listener that region starts to send a enter staging result to worker.
78+ async fn on_enter_staging_result_begin ( & self , _region_id : RegionId ) { }
79+
7780 /// Notifies the listener that the index build task is executed successfully.
7881 async fn on_index_build_finish ( & self , _region_file_id : RegionFileId ) { }
7982
@@ -307,6 +310,37 @@ impl EventListener for NotifyRegionChangeResultListener {
307310 region_id
308311 ) ;
309312 self . notify . notified ( ) . await ;
313+ info ! (
314+ "Continue to sending region change result for region {}" ,
315+ region_id
316+ ) ;
317+ }
318+ }
319+
320+ #[ derive( Default ) ]
321+ pub struct NotifyEnterStagingResultListener {
322+ notify : Notify ,
323+ }
324+
325+ impl NotifyEnterStagingResultListener {
326+ /// Continue to sending enter staging result.
327+ pub fn wake_notify ( & self ) {
328+ self . notify . notify_one ( ) ;
329+ }
330+ }
331+
332+ #[ async_trait]
333+ impl EventListener for NotifyEnterStagingResultListener {
334+ async fn on_enter_staging_result_begin ( & self , region_id : RegionId ) {
335+ info ! (
336+ "Wait on notify to start notify enter staging result for region {}" ,
337+ region_id
338+ ) ;
339+ self . notify . notified ( ) . await ;
340+ info ! (
341+ "Continue to sending enter staging result for region {}" ,
342+ region_id
343+ ) ;
310344 }
311345}
312346
0 commit comments