11use crate :: domains:: QueryIO ;
22use crate :: domains:: caches:: cache_objects:: { CacheValue , TypedValue } ;
3- use crate :: domains :: cluster_actors :: hash_ring :: BatchId ;
3+
44use crate :: domains:: cluster_actors:: hash_ring:: { HashRing , tests:: migration_task_create_helper} ;
55
66use std:: time:: Duration ;
@@ -376,7 +376,7 @@ async fn test_migrate_batch_send_migrate_batch_peer_message() {
376376 // THEN
377377 assert_expected_queryio (
378378 & buf,
379- QueryIO :: MigrateBatch ( MigrateBatch { batch_id : batch. id , cache_entries : vec ! [ ] } ) ,
379+ QueryIO :: MigrateBatch ( MigrateBatch { batch_id : batch. batch_id , cache_entries : vec ! [ ] } ) ,
380380 )
381381 . await ;
382382}
@@ -390,7 +390,7 @@ async fn test_receive_batch_when_empty_cache_entries() {
390390 let ( buf, _id) = cluster_actor. test_add_peer ( 6909 , Some ( replid. clone ( ) ) , true ) ;
391391
392392 // WHEN
393- let batch = MigrateBatch { batch_id : BatchId ( "empty_test" . into ( ) ) , cache_entries : vec ! [ ] } ;
393+ let batch = MigrateBatch { batch_id : "empty_test" . into ( ) , cache_entries : vec ! [ ] } ;
394394 cluster_actor. receive_batch ( batch. clone ( ) , & cache_manager, _id) . await ;
395395
396396 // THEN - verify that no log index is incremented
@@ -416,10 +416,8 @@ async fn test_receive_batch_when_consensus_is_required() {
416416
417417 let cache_entries = vec ! [ CacheEntry :: new( "success_key3" , "value2" ) ] ;
418418
419- let batch = MigrateBatch {
420- batch_id : BatchId ( "success_test" . into ( ) ) ,
421- cache_entries : cache_entries. clone ( ) ,
422- } ;
419+ let batch =
420+ MigrateBatch { batch_id : "success_test" . into ( ) , cache_entries : cache_entries. clone ( ) } ;
423421
424422 // WHEN
425423 cluster_actor. receive_batch ( batch, & cache_manager, ack_to. clone ( ) ) . await ;
@@ -456,10 +454,8 @@ async fn test_receive_batch_when_noreplica_found() {
456454 let cache_entries =
457455 vec ! [ CacheEntry :: new( "success_key3" , "value2" ) , CacheEntry :: new( "success_key4" , "value4" ) ] ;
458456
459- let batch = MigrateBatch {
460- batch_id : BatchId ( "success_test" . into ( ) ) ,
461- cache_entries : cache_entries. clone ( ) ,
462- } ;
457+ let batch =
458+ MigrateBatch { batch_id : "success_test" . into ( ) , cache_entries : cache_entries. clone ( ) } ;
463459
464460 // WHEN
465461 let task = tokio:: spawn ( recv. wait_message ( SchedulerMessage :: SendBatchAck {
@@ -495,7 +491,7 @@ async fn test_unblock_write_reqs_if_done_when_migrations_still_pending() {
495491
496492 // Add pending migration (simulating migration still in progress)
497493 let ( callback, _migration_rx) = Callback :: create ( ) ;
498- let batch_id = BatchId ( "test_batch" . into ( ) ) ;
494+ let batch_id = "test_batch" . into ( ) ;
499495 cluster_actor
500496 . pending_migrations
501497 . as_mut ( )
@@ -566,7 +562,7 @@ async fn test_handle_migration_ack_failure() {
566562 let mut cluster_actor = setup_blocked_cluster_actor_with_requests ( 1 ) . await ;
567563 let ( _hwm, _cache_manager) = Helper :: cache_manager ( ) ;
568564 let ( callback, callback_rx) = Callback :: create ( ) ;
569- let batch_id = BatchId ( "failure_batch" . into ( ) ) ;
565+ let batch_id = "failure_batch" . to_string ( ) ;
570566
571567 // Ensure pending_migrations is set up
572568 assert ! ( cluster_actor. pending_migrations. is_some( ) ) ;
@@ -606,9 +602,9 @@ async fn test_handle_migration_ack_batch_id_not_found() {
606602 . pending_migrations
607603 . as_mut ( )
608604 . unwrap ( )
609- . add_batch ( BatchId ( "existing_batch" . into ( ) ) , PendingMigrationBatch :: new ( callback, vec ! [ ] ) ) ;
605+ . add_batch ( "existing_batch" . into ( ) , PendingMigrationBatch :: new ( callback, vec ! [ ] ) ) ;
610606
611- let non_existent_batch_id = BatchId ( "non_existent_batch" . into ( ) ) ;
607+ let non_existent_batch_id = "non_existent_batch" . into ( ) ;
612608 let ack = MigrationBatchAck { batch_id : non_existent_batch_id, success : true } ;
613609
614610 // WHEN
@@ -648,7 +644,7 @@ async fn test_handle_migration_ack_success_case_with_pending_reqs_and_migration(
648644
649645 // Add the last pending migration with the test keys
650646 let ( callback, callback_rx) = Callback :: create ( ) ;
651- let batch_id = BatchId ( "last_batch" . into ( ) ) ;
647+ let batch_id = "last_batch" . to_string ( ) ;
652648 cluster_actor
653649 . pending_migrations
654650 . as_mut ( )
0 commit comments