@@ -4,7 +4,8 @@ namespace NKikimr::NTestShard {
4
4
5
5
TLoadActor::TLoadActor (ui64 tabletId, ui32 generation, TActorId tablet,
6
6
const NKikimrClient::TTestShardControlRequest::TCmdInitialize& settings)
7
- : TabletId(tabletId)
7
+ : TActor(&TThis::StateFunc)
8
+ , TabletId(tabletId)
8
9
, Generation(generation)
9
10
, Tablet(tablet)
10
11
, Settings(settings)
@@ -14,6 +15,17 @@ namespace NKikimr::NTestShard {
14
15
ClearKeys ();
15
16
}
16
17
18
+ void TLoadActor::Registered (TActorSystem *sys, const TActorId& owner) {
19
+ TActor::Registered (sys, owner);
20
+ TabletActorId = owner;
21
+ auto ev = std::make_unique<IEventHandle>(TEvents::TSystem::Bootstrap, 0 , SelfId (), owner, nullptr , 0 );
22
+ if (Settings.HasSecondsBeforeLoadStart ()) {
23
+ sys->Schedule (TDuration::Seconds (Settings.GetSecondsBeforeLoadStart ()), ev.release ());
24
+ } else {
25
+ sys->Send (ev.release ());
26
+ }
27
+ }
28
+
17
29
void TLoadActor::ClearKeys () {
18
30
for (auto & [key, info] : Keys) {
19
31
Y_ABORT_UNLESS (info.ConfirmedState == ::NTestShard::TStateServer::CONFIRMED
@@ -25,18 +37,16 @@ namespace NKikimr::NTestShard {
25
37
ConfirmedKeys.clear ();
26
38
}
27
39
28
- void TLoadActor::Bootstrap (const TActorId& parentId ) {
40
+ void TLoadActor::Bootstrap () {
29
41
STLOG (PRI_DEBUG, TEST_SHARD, TS31, " TLoadActor::Bootstrap" , (TabletId, TabletId));
30
- TabletActorId = parentId;
31
42
if (Settings.HasStorageServerHost ()) {
32
43
Send (MakeStateServerInterfaceActorId (), new TEvStateServerConnect (Settings.GetStorageServerHost (),
33
44
Settings.GetStorageServerPort ()));
34
- Send (parentId , new TTestShard::TEvSwitchMode (TTestShard::EMode::STATE_SERVER_CONNECT));
45
+ Send (TabletActorId , new TTestShard::TEvSwitchMode (TTestShard::EMode::STATE_SERVER_CONNECT));
35
46
} else {
36
47
RunValidation (true );
37
48
}
38
49
NextWriteTimestamp = TActivationContext::Monotonic ();
39
- Become (&TThis::StateFunc);
40
50
}
41
51
42
52
void TLoadActor::PassAway () {
@@ -46,7 +56,7 @@ namespace NKikimr::NTestShard {
46
56
if (ValidationActorId) {
47
57
TActivationContext::Send (new IEventHandle (TEvents::TSystem::Poison, 0 , ValidationActorId, SelfId (), nullptr , 0 ));
48
58
}
49
- TActorBootstrapped ::PassAway ();
59
+ TActor ::PassAway ();
50
60
}
51
61
52
62
void TLoadActor::HandleWakeup () {
0 commit comments